AnimationParameterBuilders.Easing


@RequiresSchemaVersion(major = 1, minor = 200)
interface AnimationParameterBuilders.Easing


Interface defining the easing to be used for adjusting an animation's fraction. This allows animation to speed up and slow down, rather than moving at a constant rate. If not set, defaults to Linear Interpolator.

Summary

Constants

const AnimationParameterBuilders.Easing

Elements exiting a screen use acceleration easing, where they start at rest and end at peak velocity.

const AnimationParameterBuilders.Easing
@RequiresSchemaVersion(major = 1, minor = 200)
FAST_OUT_SLOW_IN_EASING

Elements that begin and end at rest use this standard easing.

const AnimationParameterBuilders.Easing

Incoming elements are animated using deceleration easing, which starts a transition at peak velocity (the fastest point of an element’s movement) and ends at rest.

Public functions

java-static AnimationParameterBuilders.Easing
@RequiresSchemaVersion(major = 1, minor = 200)
cubicBezier(x1: Float, y1: Float, x2: Float, y2: Float)

The cubic polynomial easing that implements third-order Bezier curves.

java-static AnimationParameterBuilders.Easing

Creates a Easing from a byte array generated by toEasingByteArray.

ByteArray<Byte>

Creates a byte array that can later be used with fromByteArray.

Constants

FAST_OUT_LINEAR_IN_EASING

Added in 1.0.0
@RequiresSchemaVersion(major = 1, minor = 200)
const val FAST_OUT_LINEAR_IN_EASINGAnimationParameterBuilders.Easing

Elements exiting a screen use acceleration easing, where they start at rest and end at peak velocity.

This is equivalent to the Compose FastOutLinearInEasing.

FAST_OUT_SLOW_IN_EASING

Added in 1.0.0
@RequiresSchemaVersion(major = 1, minor = 200)
const val FAST_OUT_SLOW_IN_EASINGAnimationParameterBuilders.Easing

Elements that begin and end at rest use this standard easing. They speed up quickly and slow down gradually, in order to emphasize the end of the transition.

Standard easing puts subtle attention at the end of an animation, by giving more time to deceleration than acceleration. It is the most common form of easing.

This is equivalent to the Compose FastOutSlowInEasing.

LINEAR_OUT_SLOW_IN_EASING

Added in 1.0.0
@RequiresSchemaVersion(major = 1, minor = 200)
const val LINEAR_OUT_SLOW_IN_EASINGAnimationParameterBuilders.Easing

Incoming elements are animated using deceleration easing, which starts a transition at peak velocity (the fastest point of an element’s movement) and ends at rest.

This is equivalent to the Compose LinearOutSlowInEasing.

Public functions

cubicBezier

Added in 1.0.0
@RequiresSchemaVersion(major = 1, minor = 200)
java-static fun cubicBezier(x1: Float, y1: Float, x2: Float, y2: Float): AnimationParameterBuilders.Easing

The cubic polynomial easing that implements third-order Bezier curves. This is equivalent to the Android PathInterpolator.

Parameters
x1: Float

the x coordinate of the first control point. The line through the point (0, 0) and the first control point is tangent to the easing at the point (0, 0).

y1: Float

the y coordinate of the first control point. The line through the point (0, 0) and the first control point is tangent to the easing at the point (0, 0).

x2: Float

the x coordinate of the second control point. The line through the point (1, 1) and the second control point is tangent to the easing at the point (1, 1).

y2: Float

the y coordinate of the second control point. The line through the point (1, 1) and the second control point is tangent to the easing at the point (1, 1).

fromByteArray

Added in 1.0.0
java-static fun fromByteArray(byteArray: ByteArray): AnimationParameterBuilders.Easing

Creates a Easing from a byte array generated by toEasingByteArray.

toEasingByteArray

Added in 1.0.0
fun toEasingByteArray(): ByteArray<Byte>

Creates a byte array that can later be used with fromByteArray.