. Let say to switch an image every second. Does anyone know how to achieve this using Compose animation API or transition? Or might there is some other way to do it?
z
Zach Klippenstein (he/him) [MOD]
06/25/2020, 2:37 PM
“Switch an image every second” is a distinct thing from animation. You could launch a coroutine that does this in a loop with a delay, or use a Flow, etc. For animating, how do you want to animate? Might be able to use the
Crossfade
composable.
a
aipok
06/25/2020, 2:39 PM
ok, I was thinking about coroutines as well. Will give it a try
aipok
06/25/2020, 2:42 PM
Do you know a proper way to run coroutines inside composable? Or should I use something like Flow.asState from VM?