Google is committed to advancing racial equity for Black communities. See how.

VectorizedSnapSpec

class VectorizedSnapSpec<V : AnimationVector> : VectorizedDurationBasedAnimationSpec<V>
kotlin.Any
   ↳ androidx.compose.animation.core.VectorizedSnapSpec

VectorizedSnapSpec immediately snaps the animating value to the end value.

Summary

Public constructors
<init>(delayMillis: Int = 0)

VectorizedSnapSpec immediately snaps the animating value to the end value.

Public methods
V
getValue(playTime: Long, start: V, end: V, startVelocity: V)

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

V
getVelocity(playTime: Long, start: V, end: V, startVelocity: V)

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

Inherited functions
Properties
Int

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

Int

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

Public constructors

<init>

VectorizedSnapSpec(delayMillis: Int = 0)

VectorizedSnapSpec immediately snaps the animating value to the end value.

Parameters
delayMillis: Int = 0 the amount of time (in milliseconds) that the animation should wait before it starts. Defaults to 0.

Public methods

getValue

fun getValue(
    playTime: Long,
    start: V,
    end: V,
    startVelocity: V
): V

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

Parameters
playTime: Long time since the start of the animation
start: V start value of the animation
end: V end value of the animation
startVelocity: V start velocity of the animation

getVelocity

fun getVelocity(
    playTime: Long,
    start: V,
    end: V,
    startVelocity: V
): V

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

Parameters
playTime: Long time since the start of the animation
start: V start value of the animation
end: V end value of the animation
startVelocity: V start velocity of the animation

Properties

delayMillis

val delayMillis: Int

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

durationMillis

val durationMillis: Int

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