Object

HorizontalSharedAxisNavigationTransitions

Provides horizontal shared axis navigation transforms adhering to Material 3 motion specifications.

Source set: Common
public object HorizontalSharedAxisNavigationTransitions

Provides horizontal shared axis navigation transforms adhering to Material 3 motion specifications.

Use these animations for transitions between destinations with a spatial or directional relationship, such as moving forward and backward through a screen hierarchy or sequential flow. Incoming and outgoing destinations move simultaneously along a shared horizontal (x) axis to reinforce their spatial relationship.

These animations are consistent with the default system cross-activity navigation animations. See Material 3 transition patterns.

Properties

scrimColor

Source set: Common
public val scrimColor: Color

The recommended scrim color for horizontal shared axis predictive back transitions.

Uses ColorScheme.scrim as the base color and adjusts its opacity based on the luminance of ColorScheme.onSurface.

Functions

forwardTransform

Source set: Common
public fun forwardTransform(): ContentTransform

Creates a ContentTransform for a forward horizontal shared axis transition.

backwardTransform

Source set: Common
public fun backwardTransform(): ContentTransform

Creates a ContentTransform for the commit phase of a horizontal shared axis backward transition.

predictiveBackTransform

Source set: Common
public fun predictiveBackTransform(
        backEvent: () -> NavigationEvent,
        density: Density,
        scrimColor: Color,
    ): MutableContentTransform

Creates a MutableContentTransform configured for the gesture phase of a horizontal shared axis predictive back transition.

Parameters

backEvent provider of the ongoing NavigationEvent.
density the Density used to convert display bounds margins to pixels.
scrimColor color of the scrim overlay applied to the entering content. Use HorizontalSharedAxisNavigationTransitions.scrimColor for the recommended scrim color that adapts to the theme.
Jetpack Compose beyond MaterialFree components, screens and templates for apps that don’t look like Google’s. Copy them into your app, or let your coding agent add them.Browse for free

Content updated: