Hey <@UNH9ZT3NZ> are there any samples of how to u...
# compose
m
Hey @Doris Liu are there any samples of how to use low-level animation APIs like Animation,
animate
and
AnimationState
?
It might be a good idea to add an example for at least
animate
in the official tutorial here: https://developer.android.com/jetpack/compose/animation cc+ @Rebecca Franks
m
@Doris Liu there is already an example on TargetBasedAnimation that animates a value. However, it does not show its use for any UI related animation. I made a small demo with the help of TargetBasedAnimation. Is this how it’s supposed to be used?
d
Your demo is definitely a good way to use
TargetBasedAnimation
. 🙂 The distinct feature of TargetBasedAnimation is that it allows you to query value and velocity for any playtime once it's set up. It has no lifecycle. Nor does it expect the playtime to be monotonically increasing. Therefore you could potentially use gestures to manipulate that playtime before feeding it to
TargetBasedAnimation
to achieve seeking. That's how we intend for seeking to work in Transition some day, by changing the playtime on the
TargetBasedAnimation
s that it creates under the hood.