RepeatableSpec

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

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.

Parameters

iterations

the count of iterations. Should be at least 1.

animation

the AnimationSpec to be repeated

repeatMode

whether animation should repeat by starting from the beginning (i.e. RepeatMode.Restart) or from the end (i.e. RepeatMode.Reverse)

initialStartOffset

offsets the start of the animation

See also

Constructors

Link copied to clipboard
constructor(iterations: Int, animation: DurationBasedAnimationSpec<T>, repeatMode: RepeatMode = RepeatMode.Restart, initialStartOffset: StartOffset = StartOffset(0))

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int