VectorizedSpringSpec


VectorizedSpringSpec uses spring animations to animate (each dimension of) AnimationVectors.

Summary

Public constructors

<V : AnimationVector> VectorizedSpringSpec(
    dampingRatio: Float,
    stiffness: Float,
    visibilityThreshold: V?
)

Creates a VectorizedSpringSpec that uses the same spring constants (i.e. dampingRatio and stiffness on all dimensions.

Cmn

Public properties

Float
Cmn
Float
Cmn

Inherited functions

From androidx.compose.animation.core.VectorizedAnimationSpec
open Long
getDurationNanos(initialValue: V, targetValue: V, initialVelocity: V)

Calculates the duration of an animation.

Cmn
open V
getEndVelocity(initialValue: V, targetValue: V, initialVelocity: V)

Calculates the end velocity of the animation with the provided start/end values, and start velocity.

Cmn
open V
getValueFromNanos(
    playTimeNanos: Long,
    initialValue: V,
    targetValue: V,
    initialVelocity: V
)

Calculates the value of the animation at given the playtime, with the provided start/end values, and start velocity.

Cmn
open V
getVelocityFromNanos(
    playTimeNanos: Long,
    initialValue: V,
    targetValue: V,
    initialVelocity: V
)

Calculates the velocity of the animation at given the playtime, with the provided start/end values, and start velocity.

Cmn

Inherited properties

From androidx.compose.animation.core.VectorizedFiniteAnimationSpec
open Boolean

Whether or not the VectorizedAnimationSpec specifies an infinite animation.

Cmn

Public constructors

VectorizedSpringSpec

<V : AnimationVector> VectorizedSpringSpec(
    dampingRatio: Float = Spring.DampingRatioNoBouncy,
    stiffness: Float = Spring.StiffnessMedium,
    visibilityThreshold: V? = null
)

Creates a VectorizedSpringSpec that uses the same spring constants (i.e. dampingRatio and stiffness on all dimensions. The optional visibilityThreshold defines when the animation should be considered to be visually close enough to target to stop. By default, Spring.DefaultDisplacementThreshold is used on all dimensions of the AnimationVector.

Parameters
dampingRatio: Float = Spring.DampingRatioNoBouncy

damping ratio of the spring. Spring.DampingRatioNoBouncy by default.

stiffness: Float = Spring.StiffnessMedium

stiffness of the spring. Spring.StiffnessMedium by default.

visibilityThreshold: V? = null

specifies the visibility threshold for each dimension.

Public properties

dampingRatio

val dampingRatioFloat

stiffness

val stiffnessFloat