DeferredAnimation

@RestrictTo(value = [RestrictTo.Scope.LIBRARY])
inner class DeferredAnimation<T, V : AnimationVector>

DeferredAnimation can be constructed using Transition.createDeferredAnimation during composition and initialized later. It is useful for animations, the target values for which are unknown at composition time (e.g. layout size/position, etc).

Once a DeferredAnimation is created, it can be configured and updated as needed using DeferredAnimation.animate method.

Properties

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun animate(transitionSpec: Transition.Segment<S>.() -> FiniteAnimationSpec<T>, targetValueByState: (state: S) -> T): State<T>

DeferredAnimation allows the animation setup to be deferred until a later time after composition. animate can be used to set up a DeferredAnimation. Like other Transition animations such as Transition.animateFloat, DeferredAnimation also expects transitionSpec and targetValueByState for the mapping from target state to animation spec and target value, respectively.