androidx.navigation3.ui

Objects

NavDisplay

Object that indicates the features that can be handled by the NavDisplay

Cmn
NavDisplay.PopTransitionKey

The key for NavEntry.metadata or Scene.metadata to notify the NavDisplay of how the content should be animated when popping from backstack.

Cmn
NavDisplay.PredictivePopTransitionKey

The key for NavEntry.metadata or Scene.metadata to notify the NavDisplay of how the content should be animated when popping from backstack using a Predictive back gesture.

Cmn
NavDisplay.TransitionKey

The key for NavEntry.metadata or Scene.metadata to notify the NavDisplay of how the content should be animated when adding to the backstack.

Cmn

Composables

NavDisplay

A nav display that renders and animates between different Scenes, each of which can render one or more NavEntrys.

Cmn

Top-level functions summary

AnimatedContentTransitionScope<Scene<T>>.() -> ContentTransform

Default transitionSpec for pop navigation to be used by NavDisplay.

Cmn
android
AnimatedContentTransitionScope<Scene<T>>.(Int) -> ContentTransform

Default transitionSpec for predictive pop navigation to be used by NavDisplay.

Cmn
android
AnimatedContentTransitionScope<Scene<T>>.() -> ContentTransform

Default transitionSpec for forward navigation to be used by NavDisplay.

Cmn
android

Top-level properties summary

Top-level functions

defaultPopTransitionSpec

fun <T : Any> defaultPopTransitionSpec(): AnimatedContentTransitionScope<Scene<T>>.() -> ContentTransform

Default transitionSpec for pop navigation to be used by NavDisplay.

defaultPredictivePopTransitionSpec

fun <T : Any> defaultPredictivePopTransitionSpec(): AnimatedContentTransitionScope<Scene<T>>.(Int) -> ContentTransform

Default transitionSpec for predictive pop navigation to be used by NavDisplay.

defaultTransitionSpec

fun <T : Any> defaultTransitionSpec(): AnimatedContentTransitionScope<Scene<T>>.() -> ContentTransform

Default transitionSpec for forward navigation to be used by NavDisplay.

Top-level properties

LocalNavAnimatedContentScope

val LocalNavAnimatedContentScopeProvidableCompositionLocal<AnimatedContentScope>

Local provider of AnimatedContentScope to NavEntry.Content.

This does not have a default value since the AnimatedContentScope is provided at runtime by AnimatedContent.

import androidx.compose.animation.SharedTransitionLayout
import androidx.compose.runtime.remember
import androidx.navigation3.runtime.entryProvider
import androidx.navigation3.runtime.rememberNavBackStack
import androidx.navigation3.ui.NavDisplay

val backStack = rememberNavBackStack(CatList)
SharedTransitionLayout {
    NavDisplay(
        backStack = backStack,
        onBack = { backStack.removeAt(backStack.lastIndex) },
        entryProvider =
            entryProvider {
                entry<CatList> {
                    CatList(this@SharedTransitionLayout) { cat ->
                        backStack.add(CatDetail(cat))
                    }
                }
                entry<CatDetail> { args ->
                    CatDetail(args.cat, this@SharedTransitionLayout) {
                        backStack.removeAt(backStack.lastIndex)
                    }
                }
            },
    )
}