InfiniteRepeatableSpec

class InfiniteRepeatableSpec<T>(val animation: DurationBasedAnimationSpec<T>, val repeatMode: RepeatMode = RepeatMode.Restart, val initialStartOffset: StartOffset = StartOffset(0)) : AnimationSpec<T>

InfiniteRepeatableSpec repeats the provided animation infinite amount of times. It will never naturally finish. This means the animation will only be stopped via some form of manual cancellation. When used with transition or other animation composables, the infinite animations will stop when the composable is removed from the compose tree.

For non-infinite repeating animations, consider RepeatableSpec.

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

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(animation: DurationBasedAnimationSpec<T>, repeatMode: RepeatMode = RepeatMode.Restart, initialStartOffset: StartOffset = StartOffset(0))

Properties

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