Easing

fun interface Easing

Defines an easing curve that controls the rate of change of an animation over time.

An easing function maps normalized time (0 to 1) to an output fraction that determines how far along the animation has progressed. Different easing curves create different motion characteristics — linear, accelerating, decelerating, or bouncing.

Built-in Presets

Easing.Linear        // constant rate
Easing.EaseIn // starts slow, accelerates
Easing.EaseOut // starts fast, decelerates
Easing.EaseInOut // slow start and end, fast middle
Easing.FastOutSlowIn // Material Design standard curve

Custom Easing

// Cubic bezier curve
val custom = CubicBezierEasing(0.4f, 0.0f, 0.2f, 1.0f)

// Arbitrary easing function
val bounce = Easing { fraction -> /* custom math */}

See also

Inheritors

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard

Converts this Easing to an Android Interpolator.

Link copied to clipboard
abstract fun transform(@FloatRange(from = 0.0, to = 1.0) fraction: Float): Float

Transforms a normalized time fraction into an eased output fraction.