Skip to content

Commit

Permalink
Indicate when connections are cancelled or impossible
Browse files Browse the repository at this point in the history
Closes #598
  • Loading branch information
grote committed Apr 30, 2019
1 parent b0e9d29 commit 8414ba2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,13 @@ internal class TripViewHolder(private val v: View) : BaseViewHolder(v) {
private val duration: TextView = v.findViewById(R.id.duration)

fun bind(trip: Trip, listener: OnTripClickListener) {
// Relative Departure Time
setRelativeDepartureTime(fromTimeRel, trip.firstDepartureTime)
if (trip.isTravelable) {
// Relative Departure Time
setRelativeDepartureTime(fromTimeRel, trip.firstDepartureTime)
} else {
fromTimeRel.setText(R.string.trip_not_travelable)
fromTimeRel.visibility = VISIBLE
}

// Departure Time and Delay
val firstLeg = trip.legs[0]
Expand Down Expand Up @@ -96,6 +101,7 @@ internal class TripViewHolder(private val v: View) : BaseViewHolder(v) {
}

private fun Trip.hasProblem(): Boolean {
if (!isTravelable) return true
for (leg in legs) {
if (leg !is Public) continue
if (!isNullOrEmpty(leg.message)) return true
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ and always knows where you are to not miss where to get off the bus.
<string name="trip_error_service_down">The data provider is currently down :(\nPlease try again later.</string>
<string name="trip_error_pte">If you want to report this error, please report it to public-transport-enabler directly and attach a screenshot.</string>
<string name="trip_issue">There might be a problem with this connection.</string>
<string name="trip_not_travelable">Impossible or cancelled</string>
<string name="try_again">Try Again</string>

<!-- This string shows the number of meters one has to walk. Please keep the translation short. -->
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/xml/changelog_master.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<changelog>

<release version="2.0.6" versioncode="115">
<change>Indicate when connections are cancelled or impossible</change>
<change>Fix bug where search results would sometimes not appear</change>
<change>New translation: Ukrainian (Thanks Paul!)</change>
</release>
Expand Down

0 comments on commit 8414ba2

Please sign in to comment.