InfiniteAnimationGroup

The per-render handle returned by useInfiniteAnimationGroup and the public surface for declaring a container's loops (animateFloat, animateDimen, …).

Each call to useInfiniteAnimationGroup creates a fresh InfiniteAnimation, isolating per-render bookkeeping (the slot counter, pending descriptors) from the shared InfiniteAnimationGroupState. Declaring a loop allocates no AnimatedValue and mutates nothing: it records an InfiniteSlotDescriptor and returns a stable Value handle.

Functions

Link copied to clipboard
fun animateColor(from: Color, to: Color, animation: DurationBasedAnimationSpec<Color> = tween(), repeatMode: RepeatMode = RepeatMode.Reverse, initialStartOffset: StartOffset = StartOffset(0), label: String = "color"): Value<Color>

Loops a Color (per-channel) between from and to. See animateFloat.

Link copied to clipboard
fun animateDimen(from: Dimen, to: Dimen, animation: DurationBasedAnimationSpec<Dimen> = tween(), repeatMode: RepeatMode = RepeatMode.Reverse, initialStartOffset: StartOffset = StartOffset(0), label: String = "dimen"): Value<Dimen>

Loops a Dimen between from and to. See animateFloat.

Link copied to clipboard
fun animateFloat(from: Float, to: Float, animation: DurationBasedAnimationSpec<Float> = tween(), repeatMode: RepeatMode = RepeatMode.Reverse, initialStartOffset: StartOffset = StartOffset(0), label: String = "float"): Value<Float>

Loops a Float between from and to.

Link copied to clipboard
fun animateInt(from: Int, to: Int, animation: DurationBasedAnimationSpec<Int> = tween(), repeatMode: RepeatMode = RepeatMode.Reverse, initialStartOffset: StartOffset = StartOffset(0), label: String = "int"): Value<Int>

Loops an Int between from and to. See animateFloat.

Link copied to clipboard
fun <T> animateValue(from: T, to: T, typeConverter: TypeConverter<T>, animation: DurationBasedAnimationSpec<T> = tween(), repeatMode: RepeatMode = RepeatMode.Reverse, initialStartOffset: StartOffset = StartOffset(0), label: String = ""): Value<T>

Loops a value of type T between from and to using a custom TypeConverter. The generic form behind animateFloat / animateInt / animateColor / animateDimen. Allocates no AnimatedValue — it records a descriptor and returns a stable slot handle.