AnimationState

Class
Common
public class AnimationState<T, V : AnimationVector>(
    public val typeConverter: TwoWayConverter<T, V>,
    initialValue: T,
    initialVelocityVector: V? = null,
    lastFrameTimeNanos: Long = AnimationConstants.UnspecifiedTime,
    finishedTimeNanos: Long = AnimationConstants.UnspecifiedTime,
    isRunning: Boolean = false,
) : State<T>

AnimationState contains the necessary information to indicate the state of an animation. Once an AnimationState is constructed, it can only be updated/mutated by animations. If there's a need to mutate some of the fields of an AnimationState, consider using copy functions.

Parameters

typeConverter TwoWayConverter to convert type T from and to AnimationVector
initialValue initial value of the AnimationState
initialVelocityVector initial velocity of the AnimationState, null (i.e. no velocity) by default.
lastFrameTimeNanos last frame time of the animation, AnimationConstants.UnspecifiedTime by default
finishedTimeNanos the time that the animation finished successfully, AnimationConstants.UnspecifiedTime until then
isRunning whether the AnimationState is currently being updated by an animation. False by default