interface MotionScheme


A motion scheme provides all the FiniteAnimationSpecs for a MaterialTheme.

Motion schemes are designed to create a harmonious motion for components in the app.

There are two built-in schemes, a standardMotionScheme and an expressiveMotionScheme, that can be used as-is or customized.

Summary

Public functions

FiniteAnimationSpec<T>

A default effects motion FiniteAnimationSpec.

FiniteAnimationSpec<T>

A default spatial motion FiniteAnimationSpec.

FiniteAnimationSpec<T>
<T : Any?> fastEffectsSpec()

A fast effects motion FiniteAnimationSpec.

FiniteAnimationSpec<T>
<T : Any?> fastSpatialSpec()

A fast spatial motion FiniteAnimationSpec.

FiniteAnimationSpec<T>
<T : Any?> slowEffectsSpec()

A slow effects motion FiniteAnimationSpec.

FiniteAnimationSpec<T>
<T : Any?> slowSpatialSpec()

A slow spatial motion FiniteAnimationSpec.

Extension functions

inline FiniteAnimationSpec<T>

A default effects motion FiniteAnimationSpec that is remembered across compositions.

inline FiniteAnimationSpec<T>

A default spatial motion FiniteAnimationSpec that is remembered across compositions.

inline FiniteAnimationSpec<T>

A fast effects motion FiniteAnimationSpec that is remembered across compositions.

inline FiniteAnimationSpec<T>

A fast spatial motion FiniteAnimationSpec that is remembered across compositions.

inline FiniteAnimationSpec<T>

A slow effects motion FiniteAnimationSpec that is remembered across compositions.

inline FiniteAnimationSpec<T>

A slow spatial motion FiniteAnimationSpec that is remembered across compositions.

Public functions

defaultEffectsSpec

Added in 1.0.0-alpha25
fun <T : Any?> defaultEffectsSpec(): FiniteAnimationSpec<T>

A default effects motion FiniteAnimationSpec.

This motion spec is designed to be applied to animations that do not change the shape or bounds of the component. For example, color animation.

T is the generic data type that will be animated by the system, as long as the appropriate TwoWayConverter for converting the data to and from an AnimationVector is supplied.

When called from a Composable, use rememberDefaultEffectsSpec extension to ensure that the returned animation spec is remembered across compositions.

defaultSpatialSpec

Added in 1.0.0-alpha25
fun <T : Any?> defaultSpatialSpec(): FiniteAnimationSpec<T>

A default spatial motion FiniteAnimationSpec.

This motion spec is designed to be applied to animations that may change the shape or bounds of the component. For color or alpha animations use the effects equivalent which ensures a "non-spatial" motion.

T is the generic data type that will be animated by the system, as long as the appropriate TwoWayConverter for converting the data to and from an AnimationVector is supplied.

When called from a Composable, use rememberDefaultSpatialSpec extension to ensure that the returned animation spec is remembered across compositions.

fastEffectsSpec

Added in 1.0.0-alpha25
fun <T : Any?> fastEffectsSpec(): FiniteAnimationSpec<T>

A fast effects motion FiniteAnimationSpec.

This motion spec is designed to be applied to animations that do not change the shape or bounds of the component. For example, color animation.

T is the generic data type that will be animated by the system, as long as the appropriate TwoWayConverter for converting the data to and from an AnimationVector is supplied.

When called from a Composable, use rememberFastEffectsSpec extension to ensure that the returned animation spec is remembered across compositions.

fastSpatialSpec

Added in 1.0.0-alpha25
fun <T : Any?> fastSpatialSpec(): FiniteAnimationSpec<T>

A fast spatial motion FiniteAnimationSpec.

This motion spec is designed to be applied to animations that may change the shape or bounds of the component. For color or alpha animations use the effects equivalent which ensures a "non-spatial" motion.

T is the generic data type that will be animated by the system, as long as the appropriate TwoWayConverter for converting the data to and from an AnimationVector is supplied.

When called from a Composable, use rememberFastSpatialSpec extension to ensure that the returned animation spec is remembered across compositions.

slowEffectsSpec

Added in 1.0.0-alpha25
fun <T : Any?> slowEffectsSpec(): FiniteAnimationSpec<T>

A slow effects motion FiniteAnimationSpec.

This motion spec is designed to be applied to animations that do not change the shape or bounds of the component. For example, color animation.

T is the generic data type that will be animated by the system, as long as the appropriate TwoWayConverter for converting the data to and from an AnimationVector is supplied.

When called from a Composable, use rememberSlowEffectsSpec extension to ensure that the returned animation spec is remembered across compositions.

slowSpatialSpec

Added in 1.0.0-alpha25
fun <T : Any?> slowSpatialSpec(): FiniteAnimationSpec<T>

A slow spatial motion FiniteAnimationSpec.

This motion spec is designed to be applied to animations that may change the shape or bounds of the component. For color or alpha animations use the effects equivalent which ensures a "non-spatial" motion.

T is the generic data type that will be animated by the system, as long as the appropriate TwoWayConverter for converting the data to and from an AnimationVector is supplied.

When called from a Composable, use rememberSlowSpatialSpec extension to ensure that the returned animation spec is remembered across compositions.

Extension functions

rememberDefaultEffectsSpec

@Composable
inline fun <T : Any?> MotionScheme.rememberDefaultEffectsSpec(): FiniteAnimationSpec<T>

A default effects motion FiniteAnimationSpec that is remembered across compositions.

T is the generic data type that will be animated by the system.

rememberDefaultSpatialSpec

@Composable
inline fun <T : Any?> MotionScheme.rememberDefaultSpatialSpec(): FiniteAnimationSpec<T>

A default spatial motion FiniteAnimationSpec that is remembered across compositions.

T is the generic data type that will be animated by the system, as long as the appropriate TwoWayConverter for converting the data to and from an AnimationVector is supplied.

rememberFastEffectsSpec

@Composable
inline fun <T : Any?> MotionScheme.rememberFastEffectsSpec(): FiniteAnimationSpec<T>

A fast effects motion FiniteAnimationSpec that is remembered across compositions.

T is the generic data type that will be animated by the system.

See also
fastEffectsSpec

rememberFastSpatialSpec

@Composable
inline fun <T : Any?> MotionScheme.rememberFastSpatialSpec(): FiniteAnimationSpec<T>

A fast spatial motion FiniteAnimationSpec that is remembered across compositions.

T is the generic data type that will be animated by the system.

See also
fastSpatialSpec

rememberSlowEffectsSpec

@Composable
inline fun <T : Any?> MotionScheme.rememberSlowEffectsSpec(): FiniteAnimationSpec<T>

A slow effects motion FiniteAnimationSpec that is remembered across compositions.

T is the generic data type that will be animated by the system.

See also
slowEffectsSpec

rememberSlowSpatialSpec

@Composable
inline fun <T : Any?> MotionScheme.rememberSlowSpatialSpec(): FiniteAnimationSpec<T>

A slow spatial motion FiniteAnimationSpec that is remembered across compositions.

T is the generic data type that will be animated by the system.

See also
slowSpatialSpec