Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update timeline color to match actual line color of transport mode #249

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.runtime.Composable
import androidx.compose.runtime.remember
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
Expand Down Expand Up @@ -50,6 +51,7 @@ fun LegView(
val density = LocalDensity.current
// todo can be reusable logic for consistent icon size
val iconSize = with(density) { 14.sp.toDp() }
val timelineColor = remember(transportModeLine) { transportModeLine.lineColorCode.hexToComposeColor() }

Column(
modifier = modifier
Expand Down Expand Up @@ -103,7 +105,7 @@ fun LegView(
isProminent = true,
modifier = Modifier
.timeLineTop(
color = transportModeLine.transportMode.colorCode.hexToComposeColor(),
color = timelineColor,
strokeWidth = strokeWidth,
circleRadius = circleRadius,
)
Expand All @@ -113,7 +115,7 @@ fun LegView(
Column(
modifier = Modifier
.timeLineCenter(
color = transportModeLine.transportMode.colorCode.hexToComposeColor(),
color = timelineColor,
strokeWidth = strokeWidth,
)
.padding(start = 16.dp, top = 12.dp),
Expand Down Expand Up @@ -141,12 +143,12 @@ fun LegView(
isProminent = false,
modifier = Modifier
.timeLineCenterWithStop(
color = transportModeLine.transportMode.colorCode.hexToComposeColor(),
color = timelineColor,
strokeWidth = strokeWidth,
circleRadius = circleRadius,
)
.timeLineTop(
color = transportModeLine.transportMode.colorCode.hexToComposeColor(),
color = timelineColor,
strokeWidth = strokeWidth,
circleRadius = circleRadius,
)
Expand All @@ -161,7 +163,7 @@ fun LegView(
isProminent = true,
modifier = Modifier
.timeLineBottom(
color = transportModeLine.transportMode.colorCode.hexToComposeColor(),
color = timelineColor,
strokeWidth = strokeWidth,
circleRadius = circleRadius,
)
Expand Down