Skip to content

Commit

Permalink
Build the content view correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
ianthetechie committed Oct 30, 2024
1 parent b2b28c1 commit 7aa483f
Showing 1 changed file with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ fun InstructionsView(
distanceFormatter: DistanceFormatter = LocalizedDistanceFormatter(),
theme: InstructionRowTheme = DefaultInstructionRowTheme,
remainingSteps: List<RouteStep>? = null,
content: @Composable () -> Unit = {
ManeuverImage(instructions.primaryContent, tint = MaterialTheme.colorScheme.primary)
contentBuilder: @Composable (VisualInstruction) -> Unit = {
ManeuverImage(it.primaryContent, tint = MaterialTheme.colorScheme.primary)
}
) {
var isExpanded by remember { mutableStateOf(false) }
Expand All @@ -76,8 +76,10 @@ fun InstructionsView(
text = instructions.primaryContent.text,
distanceFormatter = distanceFormatter,
distanceToNextManeuver = distanceToNextManeuver,
theme = theme,
content = content)
theme = theme) {
contentBuilder(instructions)
}

// TODO: Secondary content

// Expanded content
Expand All @@ -91,8 +93,9 @@ fun InstructionsView(
text = upcomingInstruction.primaryContent.text,
distanceFormatter = distanceFormatter,
distanceToNextManeuver = step.distance,
theme = theme,
content = content)
theme = theme) {
contentBuilder(upcomingInstruction)
}
Spacer(modifier = Modifier.height(8.dp))
HorizontalDivider(thickness = 1.dp)
}
Expand Down

0 comments on commit 7aa483f

Please sign in to comment.