Google is committed to advancing racial equity for Black communities. See how.

ElevationConstants

object ElevationConstants
kotlin.Any
   ↳ androidx.compose.material.ElevationConstants

Contains default AnimationSpecs used for animating elevation between different Interactions.

Typically you should use animateElevation instead, which uses these AnimationSpecs internally. animateElevation in turn is used by the defaults for Button and FloatingActionButton - inside ButtonConstants.animateDefaultElevation and FloatingActionButtonConstants.animateDefaultElevation respectively.

Summary

Public methods
AnimationSpec<Dp>?

Returns the AnimationSpecs used when animating elevation to interaction, either from a previous Interaction, or from the default state.

AnimationSpec<Dp>?

Returns the AnimationSpecs used when animating elevation away from interaction, to the default state.

Public methods

incomingAnimationSpecForInteraction

fun incomingAnimationSpecForInteraction(interaction: Interaction): AnimationSpec<Dp>?

Returns the AnimationSpecs used when animating elevation to interaction, either from a previous Interaction, or from the default state. If interaction is unknown, then returns null.

Parameters
interaction: Interaction the Interaction that is being animated to

outgoingAnimationSpecForInteraction

fun outgoingAnimationSpecForInteraction(interaction: Interaction): AnimationSpec<Dp>?

Returns the AnimationSpecs used when animating elevation away from interaction, to the default state. If interaction is unknown, then returns null.

Parameters
interaction: Interaction the Interaction that is being animated away from