androidx.compose.animation.core

RepeatableSpec

Class · from org.jetbrains.compose.animation:animation-core:1.12.2

No hand-written docs yet.

RepeatableSpec takes another DurationBasedAnimationSpec and plays it iterations times. For creating infinitely repeating animation spec, consider using InfiniteRepeatableSpec.

class RepeatableSpec<T>(
    iterations: Int,
    animation: DurationBasedAnimationSpec<T>,
    repeatMode: RepeatMode = RepeatMode.Restart,
    initialStartOffset: StartOffset = StartOffset(0),
) : FiniteAnimationSpec<T>

Is a

How to get one

Create it

Properties

iterations

val iterations: Int

animation

val animation: DurationBasedAnimationSpec<T>

repeatMode

val repeatMode: RepeatMode

initialStartOffset

val initialStartOffset: StartOffset
Library docs

RepeatableSpec takes another DurationBasedAnimationSpec and plays it iterations times. For creating infinitely repeating animation spec, consider using InfiniteRepeatableSpec.

Note: When repeating in the RepeatMode.Reverse mode, it's highly recommended to have an odd number of iterations. Otherwise, the animation may jump to the end value when it finishes the last iteration.

initialStartOffset can be used to either delay the start of the animation or to fast forward the animation to a given play time. This start offset will not be repeated, whereas the delay in the animation (if any) will be repeated. By default, the amount of offset is 0.