czuckie
10/21/2022, 4:35 PMval rotation by animateFloatAsState(
targetValue = if (state) 360.0f else 0f,
animationSpec = if (state) InfiniteRepeatableSpec(tween(durationMillis = 500, easing = LinearEasing)) else snap())
Which I use to rotate an image of a fan when the fan is on, and when it is off, it rotates to a final stationary position.
However if the composable first appears in an on state, the animation will not start. How should I handle this?Jhonatan Sabadi
10/23/2022, 6:25 PMczuckie
10/24/2022, 7:47 AMInfiniteRepeatableSpec
so I would imagine if it was supposed to be animating, it would animate indefinitely? I'll see if I can't get something working with a delay though, cheers