Closed 4rzumanyan closed 2 years ago
@4rzumanyan if you do the change below, the speedometer will react in according to the Slider
.
@Composable
fun SpeedometerScreen() {
var targetValue by remember {
mutableStateOf(0f)
}
val speed by remember {
derivedStateOf {
(targetValue * 55).toInt()
}
}
//...
Speedometer(speed) // << use the new state
}
Thank you @nglauber, I already did that using "animateFloatAsState."
Is it possible to make the speedometer work more than once, but when the state changes, like a real car speedometer?