androidx.dynamicanimation.animation

Classes

DynamicAnimation

This class is the base class of physics-based animations.

FlingAnimation

Fling animation is an animation that continues an initial momentum (most often from gesture velocity) and gradually slows down.

FloatPropertyCompat

FloatPropertyCompat is an abstraction that can be used to represent a mutable float value that is held in a host object.

FloatValueHolder

FloatValueHolder holds a float value.

SpringAnimation

SpringAnimation is an animation that is driven by a SpringForce.

SpringForce

Spring Force defines the characteristics of the spring being used in the animation.

Top-level functions summary

FlingAnimation

Creates FlingAnimation for object.

SpringAnimation
K.springAnimationOf(property: FloatPropertyCompat<K>, finalPosition: Float = Float.NaN)

Creates SpringAnimation for object.

Extension functions summary

For SpringAnimation
SpringAnimation

Updates or applies spring force properties like SpringForce.mDampingRatio, SpringForce.mFinalPosition and stiffness on SpringAnimation.

Top-level functions

flingAnimationOf

inline fun <K> K.flingAnimationOf(property: FloatPropertyCompat<K>): FlingAnimation

Creates FlingAnimation for object.

Parameters
property object's property to be animated.
Return
FlingAnimation

springAnimationOf

inline fun <K> K.springAnimationOf(property: FloatPropertyCompat<K>, finalPosition: Float = Float.NaN): SpringAnimation

Creates SpringAnimation for object. If finalPosition is not Float.NaN then create SpringAnimation with SpringForce.mFinalPosition.

Parameters
property object's property to be animated.
finalPosition SpringForce.mFinalPosition Final position of spring.
Return
SpringAnimation

Extension functions

withSpringForceProperties

inline fun SpringAnimation.withSpringForceProperties(func: SpringForce.() -> Unit): SpringAnimation

Updates or applies spring force properties like SpringForce.mDampingRatio, SpringForce.mFinalPosition and stiffness on SpringAnimation.

If SpringAnimation.mSpring is null in case SpringAnimation is created without final position it will be created and attached to SpringAnimation

Parameters
func lambda with receiver on SpringForce
Return
SpringAnimation