VectorizedDurationBasedAnimationSpec

Known direct subclasses
VectorizedKeyframesSpec

VectorizedKeyframesSpec class manages the animation based on the values defined at different timestamps in the duration of the animation (i.e. different keyframes).

VectorizedSnapSpec

VectorizedSnapSpec immediately snaps the animating value to the end value.

VectorizedTweenSpec

VectorizedTweenSpec animates a AnimationVector value by interpolating the start and end value, in the given durationMillis using the given easing curve.


Base class for VectorizedAnimationSpecs that are based on a fixed durationMillis.

Summary

Public functions

open Long
getDurationNanos(initialValue: V, targetValue: V, initialVelocity: V)

Calculates the duration of an animation.

Cmn

Public properties

Int

delay defines the amount of time that animation can be delayed.

Cmn
Int

duration is the amount of time while animation is not yet finished.

Cmn

Inherited functions

From androidx.compose.animation.core.VectorizedAnimationSpec
open V
getEndVelocity(initialValue: V, targetValue: V, initialVelocity: V)

Calculates the end velocity of the animation with the provided start/end values, and start velocity.

Cmn
V
getValueFromNanos(
    playTimeNanos: Long,
    initialValue: V,
    targetValue: V,
    initialVelocity: V
)

Calculates the value of the animation at given the playtime, with the provided start/end values, and start velocity.

Cmn
V
getVelocityFromNanos(
    playTimeNanos: Long,
    initialValue: V,
    targetValue: V,
    initialVelocity: V
)

Calculates the velocity of the animation at given the playtime, with the provided start/end values, and start velocity.

Cmn

Inherited properties

From androidx.compose.animation.core.VectorizedFiniteAnimationSpec
open Boolean

Whether or not the VectorizedAnimationSpec specifies an infinite animation.

Cmn

Public functions

getDurationNanos

open fun getDurationNanos(initialValue: V, targetValue: V, initialVelocity: V): Long

Calculates the duration of an animation. For duration-based animations, this will return the pre-defined duration. For physics-based animations, the duration will be estimated based on the physics configuration (such as spring stiffness, damping ratio, visibility threshold) as well as the initialValue, targetValue values, and initialVelocity.

Parameters
initialValue: V

start value of the animation

targetValue: V

end value of the animation

initialVelocity: V

start velocity of the animation

Public properties

delayMillis

val delayMillisInt

delay defines the amount of time that animation can be delayed.

durationMillis

val durationMillisInt

duration is the amount of time while animation is not yet finished.