AnimationParameterBuilders.Easing


@RequiresSchemaVersion(major = 1, minor = 200)
public 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

default static final @NonNull AnimationParameterBuilders.Easing

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

default static final @NonNull AnimationParameterBuilders.Easing
@RequiresSchemaVersion(major = 1, minor = 200)
FAST_OUT_SLOW_IN_EASING

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

default static final @NonNull 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 methods

default static @NonNull AnimationParameterBuilders.Easing
@RequiresSchemaVersion(major = 1, minor = 200)
cubicBezier(float x1, float y1, float x2, float y2)

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

default static @NonNull AnimationParameterBuilders.Easing
fromByteArray(@NonNull byte[] byteArray)

Creates a Easing from a byte array generated by toEasingByteArray.

default @NonNull 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)
default static final @NonNull AnimationParameterBuilders.Easing FAST_OUT_LINEAR_IN_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)
default static final @NonNull AnimationParameterBuilders.Easing FAST_OUT_SLOW_IN_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)
default static final @NonNull AnimationParameterBuilders.Easing LINEAR_OUT_SLOW_IN_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 methods

cubicBezier

Added in 1.0.0
@RequiresSchemaVersion(major = 1, minor = 200)
default static @NonNull AnimationParameterBuilders.Easing cubicBezier(float x1, float y1, float x2, float y2)

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

Parameters
float x1

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).

float y1

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).

float x2

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).

float y2

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
default static @NonNull AnimationParameterBuilders.Easing fromByteArray(@NonNull byte[] byteArray)

Creates a Easing from a byte array generated by toEasingByteArray.

toEasingByteArray

Added in 1.0.0
default @NonNull byte[] toEasingByteArray()

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