ElevationConstants
objectElevationConstants
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 ButtonDefaults.elevation and FloatingActionButtonDefaults.elevation respectively.
Summary
Public methods | |
---|---|
AnimationSpec<Dp>? |
incomingAnimationSpecForInteraction(interaction: Interaction) Returns the AnimationSpecs used when animating elevation to interaction, either from a previous Interaction, or from the default state. |
AnimationSpec<Dp>? |
outgoingAnimationSpecForInteraction(interaction: Interaction) 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 |