Skip to content

Commit

Permalink
Add support for progressive bus dismissals
Browse files Browse the repository at this point in the history
  • Loading branch information
edwfeng committed Oct 18, 2020
1 parent 3a0e52c commit 409e91b
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ android {
applicationId "com.yourbcabus.android.yourbcabus"
minSdkVersion 22
targetSdkVersion 28
versionCode 9
versionName "1.1.0-beta.3"
versionCode 10
versionName "1.1.1-beta"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import java.util.*
import android.support.v7.app.AlertDialog
import android.view.LayoutInflater
import android.widget.*
import java.text.SimpleDateFormat


/**
Expand Down Expand Up @@ -296,6 +297,20 @@ class BusListActivity : AppCompatActivity() {
detailString = "Arrived at BCA"
}

if (item.departure != null) {
val cal = GregorianCalendar()
cal.set(Calendar.HOUR_OF_DAY, item.departure / 60)
cal.set(Calendar.MINUTE, item.departure % 60)
cal.set(Calendar.SECOND, 0)

val departureString = SimpleDateFormat("h:mm", Locale.US).format(cal.time)

detailString = if (Date() <= cal.time)
"Departs at $departureString"
else
"Departed at $departureString"
}

holder.busBoardingView.background.setTint(resources.getColor(indicatorColor))
holder.busDetailView.text = detailString

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ data class Bus(
val available: Boolean,
val locations: Array<String>? = null,
val boarding: Int? = null,
val departure: Int? = null,
@KlaxonDate val invalidate_time: Date? = null
) {
fun isValidated(asOf: Date): Boolean {
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/play/release-notes/en-US/default.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
This is a test.
Add support for progressive bus dismissals.

0 comments on commit 409e91b

Please sign in to comment.