VectorizedSnapSpec


VectorizedSnapSpec immediately snaps the animating value to the end value.

Summary

Public constructors

<V : AnimationVector> VectorizedSnapSpec(delayMillis: Int)
Cmn

Public functions

open 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
open 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

Public properties

open Int

the amount of time (in milliseconds) that the animation should wait before it starts.

Cmn
open 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
From androidx.compose.animation.core.VectorizedDurationBasedAnimationSpec
open Long
getDurationNanos(initialValue: V, targetValue: V, initialVelocity: V)

Calculates the duration of an animation.

Cmn

Inherited properties

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

Whether or not the VectorizedAnimationSpec specifies an infinite animation.

Cmn

Public constructors

VectorizedSnapSpec

<V : AnimationVector> VectorizedSnapSpec(delayMillis: Int = 0)
Parameters
delayMillis: Int = 0

the amount of time (in milliseconds) that the animation should wait before it starts. Defaults to 0.

Public functions

getValueFromNanos

open fun getValueFromNanos(
    playTimeNanos: Long,
    initialValue: V,
    targetValue: V,
    initialVelocity: V
): V

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

Parameters
playTimeNanos: Long

time since the start of the animation

initialValue: V

start value of the animation

targetValue: V

end value of the animation

initialVelocity: V

start velocity of the animation

getVelocityFromNanos

open fun getVelocityFromNanos(
    playTimeNanos: Long,
    initialValue: V,
    targetValue: V,
    initialVelocity: V
): V

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

Parameters
playTimeNanos: Long

time since the start of the animation

initialValue: V

start value of the animation

targetValue: V

end value of the animation

initialVelocity: V

start velocity of the animation

Public properties

delayMillis

open val delayMillisInt

the amount of time (in milliseconds) that the animation should wait before it starts. Defaults to 0.

durationMillis

open val durationMillisInt

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