elye
02/09/2022, 12:51 PMDoris Liu
02/09/2022, 7:18 PMAnimation
- TargetBasedAnimation
. Now that I look at the doc, even though TargetBasedAnimation
is mentioned, the connection between the two could be made more clear.
AnimationState
and animate
weren't covered in the doc because we decided to leave them out to avoid confusing developers new to Compose. They are for one-shot use cases - when you build coroutine animations and don't care about the continuity (or manage the continuity yourself) between animation runs. Animatable
uses AnimationState
under the hood for each animation run. On top of that, it also manages the lifecycle, ensures mutual exclusiveness of the animations started via animateTo
/`animateDecay` , and maintains continuity of the animation value (and velocity if possible) when interrupted. If you only know Animatable
, you could use that powerful API to achieve anything that AnimationState
and animate
could do, although it might not always be the most ergonomic choice.
Since there's interest in learning about animate
and AnimationState
, we could include them in this doc for completeness. Could you file a bug for this? Thanks again for the interest! 🙏elye
02/10/2022, 6:37 AMAnimationState
at https://developer.android.com/reference/kotlin/androidx/compose/animation/core/AnimationState. I think that will be a great start.
I have also file an issue https://issuetracker.google.com/issues/218645216 as per requested. Thanks for providing all the great code examples 🙏