Google is committed to advancing racial equity for Black communities. See how.

AnimatedFloatModel

@Stable class AnimatedFloatModel : AnimatedFloat
kotlin.Any
   ↳ androidx.animation.BaseAnimatedValue<kotlin.Float, androidx.animation.AnimationVector1D>
   ↳ androidx.animation.AnimatedFloat
   ↳ androidx.ui.animation.AnimatedFloatModel

Model class for AnimatedFloat. This class tracks the value field change, so that composables that read from this field can get promptly recomposed as the animation updates the value.

Summary

Public constructors
<init>(initialValue: Float, clock: AnimationClockObservable, visibilityThreshold: Float = Spring.DefaultDisplacementThreshold)

Model class for AnimatedFloat.

Inherited functions
Inherited extension functions
From androidx.animation
Unit
AnimatedFloat.fling(startVelocity: Float, decay: FloatDecayAnimationSpec = ExponentialDecay(), onEnd: OnAnimationEnd? = null)

Starts a fling animation with the specified starting velocity.

Unit
AnimatedFloat.fling(startVelocity: Float, decay: FloatDecayAnimationSpec = ExponentialDecay(), adjustTarget: (Float) -> TargetAnimation?, onEnd: OnAnimationEnd? = null)

Starts a fling animation with the specified starting velocity.

From androidx.ui.foundation.animation
Unit
AnimatedFloat.fling(config: FlingConfig, startVelocity: Float)

Starts a fling animation with the specified starting velocity and fling configuration.

Properties
Float

Current value of the animation.

Inherited properties

Public constructors

<init>

AnimatedFloatModel(
    initialValue: Float,
    clock: AnimationClockObservable,
    visibilityThreshold: Float = Spring.DefaultDisplacementThreshold)

Model class for AnimatedFloat. This class tracks the value field change, so that composables that read from this field can get promptly recomposed as the animation updates the value.

Parameters
initialValue: Float The overridden value field that can only be mutated by animation
clock: AnimationClockObservable The animation clock that will be used to drive the animation

Properties

value

var value: Float

Current value of the animation.