Skip to content

Commit

Permalink
Updated versioning of the app for pre-release
Browse files Browse the repository at this point in the history
  • Loading branch information
afg360 committed Jun 3, 2024
1 parent 102cce9 commit f951084
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 6 deletions.
26 changes: 26 additions & 0 deletions .idea/androidTestResultsUserPreferences.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions .idea/deploymentTargetDropDown.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 14 additions & 1 deletion app/src/androidTest/java/dev/mainhq/bus2go/TimeClassTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,20 @@ class TimeClassTest {
@Test
fun testSubErr(){
val time1 = Time(3,2,1)
val time2 = Time(2,3,23)
val time2 = Time(5,3,23)
assertTrue(time2.subtract(time1) == null)
}

@Test
fun testCompare1(){
assertTrue(Time(0,3,59).compareTo(Time(0,4,0)) == -1)
}
@Test
fun testCompare2(){
assertTrue(Time(3,3,59).compareTo(Time(3,4,0)) == -1)
}
@Test
fun testCompare3(){
assertTrue(Time(0,3,59).compareTo(Time(0,3,0)) == 1)
}
}
2 changes: 1 addition & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
android:supportsRtl="true"
android:theme="@style/MaterialTheme.Bus2Go"
android:versionCode="1"
android:versionName="0.1-alpha"
android:versionName="v1.0.0-alpha"
tools:targetApi="31">
<receiver android:name=".fragments.AlarmReceiver" />
<activity
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ class FavouritesListElemsAdapter(private val list : List<FavouriteBusInfo>, recy
holder.timeRemainingTextView.text = getTimeRemaining(info.arrivalTime)
if (info.arrivalTime.timeRemaining()?.compareTo(Time(0,3,59)) == -1)
holder.timeRemainingTextView.setTextColor(holder.itemView.resources.getColor(R.color.red, null))
else
holder.timeRemainingTextView.setTextColor(holder.itemView.resources.getColor(R.color.basic_blue, null))
holder.onLongClick(holder.itemView)
holder.onClick(holder.itemView)
holder.checkBoxView.setOnClickListener {
Expand Down Expand Up @@ -86,6 +88,7 @@ class FavouritesListElemsAdapter(private val list : List<FavouriteBusInfo>, recy
((container[1] as ViewGroup)[1] as MaterialTextView).text = getTimeRemaining(favouritesBusInfo.arrivalTime)
if (favouritesBusInfo.arrivalTime.timeRemaining()?.compareTo(Time(0,3,59)) == -1) ((container[1] as ViewGroup)[1] as MaterialTextView)
.setTextColor(viewGroup.resources.getColor(R.color.red, null))
else ((container[1] as ViewGroup)[1] as MaterialTextView).setTextColor(viewGroup.resources.getColor(R.color.basic_blue, null))
}

private fun getTimeRemaining(arrivalTime: Time): String {
Expand Down
1 change: 1 addition & 0 deletions app/src/main/java/dev/mainhq/bus2go/utils/Time.kt
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ class Time(hour : Int, min : Int, sec : Int) : Comparable<Time>, Parcelable {
this.sec = serializableTime.sec
}

/** Returns null if this < time and this > 3 */
fun subtract(time : Time) : Time?{
val rel = this.compareTo(time)
if (rel == -1) {
Expand Down

0 comments on commit f951084

Please sign in to comment.