animateDecay
Function
Common
public suspend fun animateDecay(
    initialValue: Float,
    initialVelocity: Float,
    animationSpec: FloatDecayAnimationSpec,
    block: (value: Float, velocity: Float) -> Unit,
)
Decay animation that slows down from the given initialVelocity starting at initialValue until
the velocity reaches 0. This is often used after a fling gesture.
This is a convenient method for decay animation. If there's a need to access more info related to
the animation such as start time, target, etc, consider using AnimationState.animateDecay.
Parameters
| initialValue | The initial value to animate from. | 
| initialVelocity | The initial velocity of the animation. | 
| animationSpec | Defines the decay animation that will be used for this animation. Some options for this animationSpecinclude:splineBasedDecayandexponentialDecay. | 
| block | Will be invoked on each animation frame with up-to-date value and velocity. | 
Common
public suspend fun <T, V : AnimationVector> AnimationState<T, V>.animateDecay(
    animationSpec: DecayAnimationSpec<T>,
    sequentialAnimation: Boolean = false,
    block: AnimationScope<T, V>.() -> Unit = {},
)
Decay animation that slows down from the current velocity and value captured in AnimationState
until the velocity reaches 0. During the animation, the given AnimationState will be updated
with the up-to-date value/velocity, frame time, etc. This is often used to animate the result of
a fling gesture.
Parameters
| animationSpec | Defines the decay animation that will be used for this animation. Some options for animationSpecinclude:splineBasedDecayandexponentialDecay. | 
| sequentialAnimation | Indicates whether the animation should use the AnimationState.lastFrameTimeNanosas the starting time (if true), or start in a new frame. By default,sequentialAnimationis false, to start the animation in a few frame. In cases where an on-going animation is interrupted and a new animation is started to carry over the momentum, using the interruption time (captured inAnimationState.lastFrameTimeNanos) creates a smoother animation. | 
| block | will be invoked on every frame during the animation, and the AnimationScopewill be checked against cancellation before the animation continues. To cancel the animation from theblock, simply callAnimationScope.cancelAnimation. AfterAnimationScope.cancelAnimationis called,blockwill not be invoked again. The animation loop will exit after theblockreturns. All the animation related info can be accessed viaAnimationScope. | 
