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

<V : AnimationVector> VectorizedTweenSpec(
    durationMillis: Int,
    delayMillis: Int,
    easing: Easing
)
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 the animation should wait before it starts running, 0 by default.

Cmn
open Int

duration of the VectorizedTweenSpec animation.

Cmn
Easing

the easing curve used by the animation.

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

VectorizedTweenSpec

<V : AnimationVector> VectorizedTweenSpec(
    durationMillis: Int = DefaultDurationMillis,
    delayMillis: Int = 0,
    easing: Easing = FastOutSlowInEasing
)
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 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 the animation should wait before it starts running, 0 by default.

durationMillis

open val durationMillisInt

duration of the VectorizedTweenSpec animation. Defaults to DefaultDurationMillis.

easing

val easingEasing

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