I have seen some Animation examples online, but no...
# compose
d
I have seen some Animation examples online, but not able to use
onActive{}
. • Does it still exist, or does it have a different name/approach now? Currently using compose version
1.0.0-beta3
, i did import
runtime
,
livedata
and
rxjava2
but still cant see these methods. • I would like the animation to start as soon as its rendered. For this I would use
animateFloatAsState
for this together with
onActive{}
. I guess the is how we handle animation.
i
Have you read the official animation docs? They are quite detailed and up to date with the latest Compose APIs: https://developer.android.com/jetpack/compose/animation
Specifically, you don't need to do anything with
animateFloatAsState
besides use the returned value (it'll handle recomposition, etc. all for you): https://developer.android.com/jetpack/compose/animation#animate-as-state