InfiniteTransition

InfiniteTransition is responsible for running child animations. Child animations can be added using InfiniteTransition.animateColor, InfiniteTransition.animateFloat, or InfiniteTransition.animateValue. Child animations will start running as soon as they enter the composition, and will not stop until they are removed from the composition.

Parameters

label

A label for differentiating this animation from others.

Types

Link copied to clipboard
inner class TransitionAnimationState<T, V : AnimationVector> : State<T>

Each animation created using InfiniteTransition.animateColor, InfiniteTransition.animateFloat, or InfiniteTransition.animateValue is represented as a TransitionAnimationState in InfiniteTransition. typeConverter converts the animation value from/to an AnimationVector. label differentiates this animation from others.

Properties

Link copied to clipboard

Functions

Link copied to clipboard
@Composable
fun InfiniteTransition.animateColor(initialValue: Color, targetValue: Color, animationSpec: InfiniteRepeatableSpec<Color>, label: String = "ColorAnimation"): State<Color>

Creates a Color animation that runs infinitely as a part of the given InfiniteTransition.

Link copied to clipboard
@Composable
fun InfiniteTransition.animateFloat(initialValue: Float, targetValue: Float, animationSpec: InfiniteRepeatableSpec<Float>, label: String = "FloatAnimation"): State<Float>

Creates an animation of Float type that runs infinitely as a part of the given InfiniteTransition.

Link copied to clipboard
@Composable
fun <T, V : AnimationVector> InfiniteTransition.animateValue(initialValue: T, targetValue: T, typeConverter: TwoWayConverter<T, V>, animationSpec: InfiniteRepeatableSpec<T>, label: String = "ValueAnimation"): State<T>

Creates an animation of type T that runs infinitely as a part of the given InfiniteTransition. Any data type can be animated so long as it can be converted from and to an AnimationVector. This conversion needs to be provided as a typeConverter. Some examples of such TwoWayConverter are: Int.VectorConverter, IntSize.Companion.VectorConverter, etc