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

VectorizedTweenSpec

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

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

Summary

Public constructors
<init>(durationMillis: Int = DefaultDurationMillis, delayMillis: Int = 0, easing: Easing = FastOutSlowInEasing)

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

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 the animation should wait before it starts running, 0 by default.

Int

duration of the VectorizedTweenSpec animation.

Easing

the easing curve used by the animation.

Public constructors

<init>

VectorizedTweenSpec(
    durationMillis: Int = DefaultDurationMillis,
    delayMillis: Int = 0,
    easing: Easing = FastOutSlowInEasing)

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

Parameters
durationMillis: Int = DefaultDurationMillis duration of the VectorizedTweenSpec animation. Defaults to DefaultDurationMillis.
delayMillis: Int = 0 the amount of time the animation should wait before it starts running, 0 by default.
easing: Easing = FastOutSlowInEasing the easing curve used by the animation. FastOutSlowInEasing by default.

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 the animation should wait before it starts running, 0 by default.

durationMillis

val durationMillis: Int

duration of the VectorizedTweenSpec animation. Defaults to DefaultDurationMillis.

easing

val easing: Easing

the easing curve used by the animation. FastOutSlowInEasing by default.