AnimatedValueHolder

@Model class AnimatedValueHolder : ValueHolder<Float>
kotlin.Any
   ↳ androidx.ui.foundation.animation.AnimatedValueHolder

Value holder that allows to animate value that it holds.

The main purpose of this class is to represent state of Draggable and provide both drag value retrieval and animation/fling capabilities by implementing ValueHolder and DynamicTargetAnimation interfaces respectively.

Summary

Public constructors

<init>(initial: Float)

Value holder that allows to animate value that it holds.

Public methods

Unit
fling(config: FlingConfig, startVelocity: Float)

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

Unit
setBounds(min: Float = Float.NEGATIVE_INFINITY, max: Float = Float.POSITIVE_INFINITY)

Sets up the bounds that this value should be constrained to.

Properties

AnimatedFloat

Float

current value of this holder

Public constructors

<init>

AnimatedValueHolder(initial: Float)

Value holder that allows to animate value that it holds.

The main purpose of this class is to represent state of Draggable and provide both drag value retrieval and animation/fling capabilities by implementing ValueHolder and DynamicTargetAnimation interfaces respectively.

Public methods

fling

fun fling(
    config: FlingConfig,
    startVelocity: Float
): Unit

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

Parameters
config: FlingConfig configuration that specifies fling behaviour
startVelocity: Float Starting velocity of the fling animation

setBounds

fun setBounds(
    min: Float = Float.NEGATIVE_INFINITY,
    max: Float = Float.POSITIVE_INFINITY
): Unit

Sets up the bounds that this value should be constrained to.

Parameters
min: Float = Float.NEGATIVE_INFINITY Lower bound of the value. Defaults to Float.NEGATIVE_INFINITY
max: Float = Float.POSITIVE_INFINITY Upper bound of the value. Defaults to Float.POSITIVE_INFINITY

Properties

animatedFloat

val animatedFloat: AnimatedFloat

value

var value: Float

current value of this holder