data class CrossingInfo(
val actualStreetName: String,
val nextStreetName: String,
val pictoFileName: String,
val streetType: CrosswayStreetType,
val metersToCrossing: Double,
val secondsToCrossing: Double
)
@Composable
fun CoiInfo(modifier: Modifier = Modifier, crossingInfo: CrossingInfo?) {
Column(modifier, verticalArrangement = Arrangement.spacedBy(4.dp)) {
if (crossingInfo?.metersToCrossing != null) {
Text("${crossingInfo.metersToCrossing.roundToLong()}${R.string.meterAbbreviation}")
}
}
}
@Preview(
showBackground = true, name = "Light mode"
)
@Preview(
showBackground = true, uiMode = Configuration.UI_MODE_NIGHT_YES, name = "Dark mode"
)
@Composable
fun CoiInfoPreview() {
CoiInfo(crossingInfo = CrossingInfo(
"Some street",
"Some other street",
"coi_uturn",
CrosswayStreetType.UTURN,
150.0,
10.0
))
}