🌈 Create new beautiful Compose Gradients with our new wesite ->
Class

InfiniteTransition

InfiniteTransition is responsible for running child animations.

Source set: Common
public class InfiniteTransition internal constructor(public val label: String)

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 in android studio.

Properties

animations

Source set: Common
public val animations: List<TransitionAnimationState<*, *>>

List of TransitionAnimationStates that are in a InfiniteTransition.

Members

TransitionAnimationState

Source set: Common
public inner class TransitionAnimationState<T, V : AnimationVector> internal constructor(
        internal var initialValue: T,
        internal var targetValue: T,
        public val typeConverter: TwoWayConverter<T, V>,
        animationSpec: AnimationSpec<T>,
        public val label: String,
    ) : 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 in android studio.

Properties

value

Source set: Common
override var value: T by mutableStateOf(initialValue)

animationSpec

Source set: Common
public var animationSpec: AnimationSpec<T> = animationSpec

AnimationSpec that is used for current animation run.

animation

Source set: Common
public var animation: TargetBasedAnimation<T, V> =
            TargetBasedAnimation(this.animationSpec, typeConverter, initialValue, targetValue)

All the animation configurations including initial value/velocity & target value for animating from initialValue to targetValue are captured in animation.