https://kotlinlang.org logo
#compose
Title
# compose
l

Lukasz Burcon

02/04/2022, 9:30 AM
Hey, is there any way of chaining multiple animations depending on each other? Let’s say I want to animate both view’s X offset and it’s size, but the size should start animating after X offset’s animation is finished. Wondering what’s the best approach here
a

Albert Chang

02/04/2022, 9:42 AM
You can use
Animatable.animateTo()
. As it is a suspend fun you can easily chain multiple calls.
l

Lukasz Burcon

02/04/2022, 9:49 AM
Yeah, that’s one possibility. I was wondering if there’s any other way of chaining animations that use
animateAsFloat
as their values source
a

Albert Chang

02/04/2022, 9:53 AM
You mean
animateFloatAsState
? It also uses
Animatable
under the hood.
4 Views