From e69e8821ee09a710531fc4d1a61a9a6740434cbf Mon Sep 17 00:00:00 2001 From: Michael Angelo Reyes Date: Tue, 7 May 2024 22:42:41 +0800 Subject: [PATCH] [19921] - [TripKit] update GetTravelledLineForTrip to use roadTags colors when available for street segments - [TripKitUI] update TripResultMapContributor and refactor on how data are being observed. Also move the logic for observing the mapTiles availability - [TripKitUI] update TripResultMapViewModel and refactor how selected trip and its data is being observed and handled - [TripKitUI] update TripSegmentListFragment and remove the mapTiles handling from there --- .../skedgo/tripkit/a2brouting/GetTravelledLineForTrip.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/TripKitAndroid/src/main/java/com/skedgo/tripkit/a2brouting/GetTravelledLineForTrip.kt b/TripKitAndroid/src/main/java/com/skedgo/tripkit/a2brouting/GetTravelledLineForTrip.kt index 9b96fc01..2455b2c5 100644 --- a/TripKitAndroid/src/main/java/com/skedgo/tripkit/a2brouting/GetTravelledLineForTrip.kt +++ b/TripKitAndroid/src/main/java/com/skedgo/tripkit/a2brouting/GetTravelledLineForTrip.kt @@ -47,9 +47,7 @@ class GetTravelledLineForTrip @Inject constructor() { else it.serviceColor.color val decodedWayPoints = PolyUtil.decode(it.encodedWaypoints) - println("tag123, a: ${decodedWayPoints.size}") val simplified = decodedWayPoints.simplify(LAT_LNG_SIMPLIFY_TOLERANCE) - println("tag123, b: ${simplified.size}") simplified.zipWithNext() .map { (start, end) -> com.skedgo.tripkit.LineSegment( @@ -70,8 +68,10 @@ class GetTravelledLineForTrip @Inject constructor() { .map { (start, end) -> var lineColor = (getColorForWheelchairAndBicycle(street, modeId) ?: color) - if (!street.roadTags().isNullOrEmpty()) { - lineColor = Color.BLUE + street.roadTags()?.let { + it.firstOrNull()?.let { + lineColor = it.getRoadTagColor() + } } com.skedgo.tripkit.LineSegment( TripKitLatLng(start.latitude, start.longitude),