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

VectorizedRepeatableSpec

class VectorizedRepeatableSpec<V : AnimationVector> : VectorizedAnimationSpec<V>
kotlin.Any
   ↳ androidx.compose.animation.core.VectorizedRepeatableSpec

This animation takes another VectorizedDurationBasedAnimationSpec and plays it iterations times.

Summary

Public constructors
<init>(iterations: Int, animation: VectorizedDurationBasedAnimationSpec<V>, repeatMode: RepeatMode = RepeatMode.Restart)

This animation takes another VectorizedDurationBasedAnimationSpec and plays it iterations times.

Public methods
Long
getDurationMillis(start: V, end: V, startVelocity: V)

Calculates the duration of an animation.

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

Public constructors

<init>

VectorizedRepeatableSpec(
    iterations: Int,
    animation: VectorizedDurationBasedAnimationSpec<V>,
    repeatMode: RepeatMode = RepeatMode.Restart)

This animation takes another VectorizedDurationBasedAnimationSpec and plays it iterations times.

Parameters
iterations: Int the count of iterations. Should be at least 1. Infinite can be used to have an infinity repeating animation.
animation: VectorizedDurationBasedAnimationSpec<V> the VectorizedAnimationSpec describing each repetition iteration.

Public methods

getDurationMillis

fun getDurationMillis(
    start: V,
    end: V,
    startVelocity: V
): Long

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 start, end values, and startVelocity.

Parameters
start: V start value of the animation
end: V end value of the animation
startVelocity: V start velocity of the animation

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