Google se compromete a impulsar la igualdad racial para las comunidades afrodescendientes. Obtén información al respecto.

AnimationState

class AnimationState<T, V : AnimationVector> : State<T>
kotlin.Any
   ↳ androidx.compose.animation.core.AnimationState

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.

Summary

Public constructors
<init>(typeConverter: TwoWayConverter<T, V>, initialValue: T, initialVelocityVector: V? = null, lastFrameTime: Uptime = Uptime.Unspecified, finishedTime: Uptime = Uptime.Unspecified, isRunning: Boolean = false)

AnimationState contains the necessary information to indicate the state of an animation.

Extension functions
From androidx.compose.animation.core
suspend Unit
AnimationState<Float, AnimationVector1D>.animateDecay(animationSpec: FloatDecayAnimationSpec, sequentialAnimation: Boolean = false, block: AnimationScope<Float, AnimationVector1D>.() -> Unit = {})

Decay animation that slows down from the current velocity and value captured in AnimationState until the velocity reaches 0.

suspend Unit
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.

suspend Unit
AnimationState<T, V>.animateTo(targetValue: T, animationSpec: AnimationSpec<T> = spring(), sequentialAnimation: Boolean = false, block: AnimationScope<T, V>.() -> Unit = {})

Target based animation that takes the value and velocity from the AnimationState as the starting condition, and animate to the targetValue, using the animationSpec.

AnimationState<T, V>
AnimationState<T, V>.copy(value: T = this.value, velocityVector: V? = this.velocityVector.copy(), lastFrameTime: Uptime = this.lastFrameTime, finishedTime: Uptime = this.finishedTime, isRunning: Boolean = this.isRunning)

Creates a new AnimationState from a given AnimationState.

AnimationState<Float, AnimationVector1D>
AnimationState<Float, AnimationVector1D>.copy(value: Float = this.value, velocity: Float = this.velocityVector.value, lastFrameTime: Uptime = this.lastFrameTime, finishedTime: Uptime = this.finishedTime, isRunning: Boolean = this.isRunning)

Creates a new AnimationState of Float value type from a given AnimationState of the same type.

Inherited extension functions
From androidx.compose.runtime
operator T
State<T>.getValue(thisObj: Any?, property: KProperty<*>)

Permits property delegation of vals using by for State.

Properties
Uptime

The time when the animation finished successfully.

Boolean

Indicates whether the animation is currently running.

Uptime

Last frame time of the animation.

TwoWayConverter<T, V>

TwoWayConverter to convert type T from and to AnimationVector

T

Current value of the AnimationState.

T

Velocity of type T, converted from velocityVector.

V

Current velocity vector of the AnimationState.

Extension properties
From androidx.compose.animation.core
Boolean

Indicates whether the given AnimationState is for an animation that has finished, indicated by AnimationState.finishedTime having a specified value.

Public constructors

<init>

AnimationState(
    typeConverter: TwoWayConverter<T, V>,
    initialValue: T,
    initialVelocityVector: V? = null,
    lastFrameTime: Uptime = Uptime.Unspecified,
    finishedTime: Uptime = Uptime.Unspecified,
    isRunning: