DeferredTargetAnimation
DeferredTargetAnimation is intended for animations where the target is unknown at the time of instantiation. Such use cases include, but are not limited to, size or position animations created during composition or the initialization of a Modifier.Node, yet the target size or position stays unknown until the later measure and placement phase.
DeferredTargetAnimation offers a declarative updateTarget function, which requires a target to either set up the animation or update the animation, and to read the current value of the animation.
Properties
isIdle returns true when the animation has finished running and reached its pendingTarget, or when the animation has not been set up (i.e. updateTarget has never been called).
Returns the target value from the most recent updateTarget call.
Functions
updateTarget sets up an animation, or updates an already running animation, based on the target in the given coroutineScope. pendingTarget will be updated to track the last seen target.