AnimationState

fun AnimationState(initialValue: Float, initialVelocity: Float = 0.0f, lastFrameTimeNanos: Long = AnimationConstants.UnspecifiedTime, finishedTimeNanos: Long = AnimationConstants.UnspecifiedTime, isRunning: Boolean = false): AnimationState<Float, AnimationVector1D>

Factory method for creating an AnimationState for Float initialValue.

Return

A new AnimationState instance

Parameters

initialValue

initial value of the AnimationState

initialVelocity

initial velocity of the AnimationState, 0 (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 by default.

isRunning

whether the AnimationState is currently being updated by an animation. False by default


fun <T, V : AnimationVector> AnimationState(typeConverter: TwoWayConverter<T, V>, initialValue: T, initialVelocity: T, lastFrameTimeNanos: Long = AnimationConstants.UnspecifiedTime, finishedTimeNanos: Long = AnimationConstants.UnspecifiedTime, isRunning: Boolean = false): AnimationState<T, V>

Factory method for creating an AnimationState with an initialValue and an initialVelocity.

Return

A new AnimationState instance

Parameters

typeConverter
initialValue

initial value of the AnimationState

initialVelocity

initial velocity of the AnimationState

lastFrameTimeNanos

last frame time of the animation, AnimationConstants.UnspecifiedTime by default

finishedTimeNanos

the time that the animation finished successfully, AnimationConstants.UnspecifiedTime by default.

isRunning

whether the AnimationState is currently being updated by an animation. False by default