{% setvar book_path %}/reference/androidx/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}

VectorizedTweenSpec

public final class VectorizedTweenSpec<V extends AnimationVector> implements VectorizedDurationBasedAnimationSpec


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 extends AnimationVector> VectorizedTweenSpec(
    int durationMillis,
    int delayMillis,
    @NonNull Easing easing
)

Public methods

int

the amount of time the animation should wait before it starts running, 0 by default.

int

duration of the VectorizedTweenSpec animation.

final @NonNull Easing

the easing curve used by the animation.

@NonNull V
getValueFromNanos(
    long playTimeNanos,
    @NonNull V initialValue,
    @NonNull V targetValue,
    @NonNull V initialVelocity
)

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

@NonNull V
getVelocityFromNanos(
    long playTimeNanos,
    @NonNull V initialValue,
    @NonNull V targetValue,
    @NonNull V initialVelocity
)

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

Inherited methods

From androidx.compose.animation.core.VectorizedAnimationSpec
@NonNull V
getEndVelocity(
    @NonNull V initialValue,
    @NonNull V targetValue,
    @NonNull V initialVelocity
)

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

From androidx.compose.animation.core.VectorizedDurationBasedAnimationSpec
long
getDurationNanos(
    @NonNull V initialValue,
    @NonNull V targetValue,
    @NonNull V initialVelocity
)

Calculates the duration of an animation.

From androidx.compose.animation.core.VectorizedFiniteAnimationSpec
boolean

Whether or not the VectorizedAnimationSpec specifies an infinite animation.

Public constructors

VectorizedTweenSpec

public <V extends AnimationVector> VectorizedTweenSpec(
    int durationMillis,
    int delayMillis,
    @NonNull Easing easing
)
Parameters
int durationMillis

duration of the VectorizedTweenSpec animation. Defaults to DefaultDurationMillis.

int delayMillis

the amount of time the animation should wait before it starts running, 0 by default.

@NonNull Easing easing

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

Public methods

getDelayMillis

public int getDelayMillis()

the amount of time the animation should wait before it starts running, 0 by default.

getDurationMillis

public int getDurationMillis()

duration of the VectorizedTweenSpec animation. Defaults to DefaultDurationMillis.

getEasing

public final @NonNull Easing getEasing()

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

getValueFromNanos

public @NonNullgetValueFromNanos(
    long playTimeNanos,
    @NonNull V initialValue,
    @NonNull V targetValue,
    @NonNull V initialVelocity
)

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

Parameters
long playTimeNanos

time since the start of the animation

@NonNull V initialValue

start value of the animation

@NonNull V targetValue

end value of the animation

@NonNull V initialVelocity

start velocity of the animation

getVelocityFromNanos

public @NonNullgetVelocityFromNanos(
    long playTimeNanos,
    @NonNull V initialValue,
    @NonNull V targetValue,
    @NonNull V initialVelocity
)

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

Parameters
long playTimeNanos

time since the start of the animation

@NonNull V initialValue

start value of the animation

@NonNull V targetValue

end value of the animation

@NonNull V initialVelocity

start velocity of the animation