Creates a SpringSpec that uses the given spring constants (i.e. dampingRatio and stiffness. The optional visibilityThreshold defines when the animation should be considered to be visually close enough to round off to its target.

Summary

Public constructors

<T : Any?> SpringSpec(
    dampingRatio: Float,
    stiffness: Float,
    visibilityThreshold: T?
)
Cmn

Public functions

open operator Boolean
equals(other: Any?)
Cmn
open Int
Cmn
open VectorizedSpringSpec<V>
<V : AnimationVector> vectorize(converter: TwoWayConverter<T, V>)

Creates a VectorizedAnimationSpec with the given TwoWayConverter.

Cmn

Public properties

Float

damping ratio of the spring.

Cmn
Float

stiffness of the spring.

Cmn
T?

specifies the visibility threshold

Cmn

Public constructors

SpringSpec

<T : Any?> SpringSpec(
    dampingRatio: Float = Spring.DampingRatioNoBouncy,
    stiffness: Float = Spring.StiffnessMedium,
    visibilityThreshold: T? = null
)
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: T? = null

specifies the visibility threshold

Public functions

equals

open operator fun equals(other: Any?): Boolean

hashCode

open fun hashCode(): Int

vectorize

open fun <V : AnimationVector> vectorize(converter: TwoWayConverter<T, V>): VectorizedSpringSpec<V>

Creates a VectorizedAnimationSpec with the given TwoWayConverter.

The underlying animation system operates on AnimationVectors. T will be converted to AnimationVector to animate. VectorizedAnimationSpec describes how the converted AnimationVector should be animated. E.g. The animation could simply interpolate between the start and end values (i.e.TweenSpec), or apply spring physics to produce the motion (i.e. SpringSpec), etc)

Parameters
converter: TwoWayConverter<T, V>

converts the type T from and to AnimationVector type

Public properties

dampingRatio

val dampingRatioFloat

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

stiffness

val stiffnessFloat

stiffness of the spring. Spring.StiffnessMedium by default.

visibilityThreshold

val visibilityThreshold: T?

specifies the visibility threshold