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

VectorizedDurationBasedAnimationSpec

@<Error class: unknown class>
public interface VectorizedDurationBasedAnimationSpec<V extends AnimationVector> extends VectorizedFiniteAnimationSpec

Known direct subclasses
VectorizedKeyframesSpec

VectorizedKeyframesSpec class manages the animation based on the values defined at different timestamps in the duration of the animation (i.e. different keyframes).

VectorizedSnapSpec

VectorizedSnapSpec immediately snaps the animating value to the end value.

VectorizedTweenSpec

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


Base class for VectorizedAnimationSpecs that are based on a fixed durationMillis.

Summary

Public methods

abstract int

delay defines the amount of time that animation can be delayed.

abstract int

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

default long
getDurationNanos(
    @NonNull V initialValue,
    @NonNull V targetValue,
    @NonNull V initialVelocity
)

Calculates the duration of an animation.

Inherited methods

From androidx.compose.animation.core.VectorizedAnimationSpec
default @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.

abstract @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.

abstract @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.

From androidx.compose.animation.core.VectorizedFiniteAnimationSpec
default boolean

Whether or not the VectorizedAnimationSpec specifies an infinite animation.

Public methods

getDelayMillis

abstract int getDelayMillis()

delay defines the amount of time that animation can be delayed.

getDurationMillis

abstract int getDurationMillis()

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

getDurationNanos

default long getDurationNanos(
    @NonNull V initialValue,
    @NonNull V targetValue,
    @NonNull V initialVelocity
)

Calculates the duration of an animation. For duration-based animations, this will return the pre-defined duration. For physics-based animations, the duration will be estimated based on the physics configuration (such as spring stiffness, damping ratio, visibility threshold) as well as the initialValue, targetValue values, and initialVelocity.

Parameters
@NonNull V initialValue

start value of the animation

@NonNull V targetValue

end value of the animation

@NonNull V initialVelocity

start velocity of the animation