From 9f74c3593c9f87498aaac185ecce8705bf6c934c Mon Sep 17 00:00:00 2001 From: Karan Sharma <55722391+ksharma-xyz@users.noreply.github.com> Date: Tue, 22 Oct 2024 12:55:41 +1100 Subject: [PATCH] Update colors (#236) --- .../krail/trip_planner/ui/components/JourneyLeg.kt | 10 ++++++---- .../trip_planner/ui/components/TransportModeInfo.kt | 3 ++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/feature/trip-planner/ui/src/main/kotlin/xyz/ksharma/krail/trip_planner/ui/components/JourneyLeg.kt b/feature/trip-planner/ui/src/main/kotlin/xyz/ksharma/krail/trip_planner/ui/components/JourneyLeg.kt index 5973e118..51ce4d4f 100644 --- a/feature/trip-planner/ui/src/main/kotlin/xyz/ksharma/krail/trip_planner/ui/components/JourneyLeg.kt +++ b/feature/trip-planner/ui/src/main/kotlin/xyz/ksharma/krail/trip_planner/ui/components/JourneyLeg.kt @@ -2,6 +2,7 @@ package xyz.ksharma.krail.trip_planner.ui.components import androidx.compose.foundation.Image import androidx.compose.foundation.background +import androidx.compose.foundation.isSystemInDarkTheme import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.ExperimentalLayoutApi @@ -47,7 +48,7 @@ fun JourneyLeg( .background( color = transportModeLine.transportMode.colorCode .hexToComposeColor() - .copy(alpha = 0.15f) + .copy(alpha = if (isSystemInDarkTheme()) 0.7f else 0.2f) ) .padding(vertical = 8.dp, horizontal = 8.dp), ) { @@ -60,13 +61,14 @@ fun JourneyLeg( backgroundColor = transportModeLine.transportMode.colorCode.hexToComposeColor(), badgeText = transportModeLine.lineName, badgeColor = transportModeLine.lineColorCode.hexToComposeColor(), + borderEnabled = isSystemInDarkTheme(), modifier = Modifier.align(Alignment.CenterVertically), ) Text( text = stopsInfo, modifier = Modifier.align(Alignment.CenterVertically), style = KrailTheme.typography.title, - color = KrailTheme.colors.onSurface,//transportModeLine.transportMode.colorCode.hexToComposeColor(), + color = if (isSystemInDarkTheme()) KrailTheme.colors.onSurface else transportModeLine.transportMode.colorCode.hexToComposeColor(), ) } FlowRow( @@ -87,8 +89,8 @@ fun JourneyLeg( .size(size) .align(Alignment.CenterVertically), colorFilter = ColorFilter.tint( - color = transportModeLine.transportMode.colorCode.hexToComposeColor() - .copy(alpha = 0.9f) + color = if (isSystemInDarkTheme()) KrailTheme.colors.onSurface else transportModeLine.transportMode.colorCode.hexToComposeColor() + .copy(alpha = 0.9f), ), ) Text( diff --git a/feature/trip-planner/ui/src/main/kotlin/xyz/ksharma/krail/trip_planner/ui/components/TransportModeInfo.kt b/feature/trip-planner/ui/src/main/kotlin/xyz/ksharma/krail/trip_planner/ui/components/TransportModeInfo.kt index 98c02565..ff39bfdf 100644 --- a/feature/trip-planner/ui/src/main/kotlin/xyz/ksharma/krail/trip_planner/ui/components/TransportModeInfo.kt +++ b/feature/trip-planner/ui/src/main/kotlin/xyz/ksharma/krail/trip_planner/ui/components/TransportModeInfo.kt @@ -15,10 +15,11 @@ fun TransportModeInfo( backgroundColor: Color, badgeColor: Color, badgeText: String, + borderEnabled: Boolean = false, modifier: Modifier = Modifier, ) { Row(modifier = modifier, horizontalArrangement = Arrangement.spacedBy(8.dp)) { - TransportModeIcon(letter = letter, backgroundColor = backgroundColor) + TransportModeIcon(letter = letter, backgroundColor = backgroundColor, borderEnabled = borderEnabled) TransportModeBadge( backgroundColor = badgeColor,