androidx.compose.animation.core

AnimationState

Class · from org.jetbrains.compose.animation:animation-core:1.12.2

No hand-written docs yet.

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.

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

Is a

How to get one

Create it

Properties

velocityVector

val velocityVector: V

Current velocity vector of the AnimationState.

lastFrameTimeNanos

val lastFrameTimeNanos: Long

Last frame time of the animation.

finishedTimeNanos

val finishedTimeNanos: Long

The time when the animation finished successfully in the System.nanoTime timebase.

isRunning

val isRunning: Boolean

Indicates whether the animation is currently running.

velocity

val velocity: T

Velocity of type T, converted from velocityVector.

typeConverter

val typeConverter: TwoWayConverter<T, V>
Library docs

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.