Skip to content

Commit

Permalink
Merge branch 'refs/heads/develop' into task/23022-tripkitui-refactor-…
Browse files Browse the repository at this point in the history
…phase2

# Conflicts:
#	TripKitAndroidUI/src/main/java/com/skedgo/tripkit/ui/timetables/TimetableMapContributor.kt
  • Loading branch information
MichaelFlexAI committed Feb 6, 2025
2 parents d98433f + db7531c commit e72141c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -307,10 +307,13 @@ class TimetableMapContributor(val fragment: Fragment) : TripKitMapContributor {
if (service!!.serviceColor == null || service!!.serviceColor?.color == Color.BLACK) fragment.resources.getColor(
R.color.v4_color
) else service!!.serviceColor?.color!!
val maxLength = 3
val text =
(if (TextUtils.isEmpty(service!!.serviceNumber)) if (mStop == null || mStop!!.type == null) "" else StringUtils.capitalizeFirst(
mStop!!.type.toString()
) else service!!.serviceNumber)!!
(if (TextUtils.isEmpty(service!!.serviceNumber)) {
if (mStop == null || mStop!!.type == null) "" else StringUtils.capitalizeFirst(mStop!!.type.toString())
} else service!!.serviceNumber)!!.let {
if (it.length > maxLength) it.take(maxLength - 1) + "" else it
}
val icon = vehicleMarkerIconCreatorLazy.get().call(bearing, color, text)
val markerTitle = title
googleMap?.let { map: GoogleMap ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,12 @@ class TripResultViewModel @Inject constructor(
moreButtonText.set(context.resources.getString(R.string.more))
moreButtonVisible.set(true)
}

sortTripResults()
}

private fun sortTripResults() {
tripResults.sortBy { it.trip?.startTimeInSecs ?: Long.MAX_VALUE }
}

override fun equals(other: Any?): Boolean {
Expand Down

0 comments on commit e72141c

Please sign in to comment.