ModifierAnimation

data class ModifierAnimation(val transition: Transition, val horizontalDistance: Float, val verticalDistance: Float, val isExitTransition: Boolean, val onTransitionProgress: (Float) -> Unit = {}, val onTransitionEnd: () -> Unit = {})

Holds all parameters needed to drive a single screen's entry or exit animation.

Parameters

transition

The Transition strategy describing the animation type (e.g. slide, none).

horizontalDistance

The total horizontal offset in pixels for a horizontal slide.

verticalDistance

The total vertical offset in pixels for a vertical slide.

isExitTransition

Whether this animation represents an exit (true) or an entry (false).

onTransitionProgress

Callback invoked with the current animation progress (0f → 1f).

onTransitionEnd

Callback invoked once the animation has finished.

Constructors

Link copied to clipboard
constructor(transition: Transition, horizontalDistance: Float, verticalDistance: Float, isExitTransition: Boolean, onTransitionProgress: (Float) -> Unit = {}, onTransitionEnd: () -> Unit = {})

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun fromBottom(progress: Float): Float

Calculates a translation that animates the content in from below the visible area.

Link copied to clipboard
fun fromTop(progress: Float): Float

Calculates a translation that animates the content in from above the visible area.

Link copied to clipboard
fun toBottom(progress: Float): Float

Calculates a translation that moves the content downward by the full distance.

Link copied to clipboard
fun toTop(progress: Float): Float

Calculates a translation that moves the content upward by the full distance.