public static class NavDisplay


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

Summary

Public fields

static @NonNull NavDisplay

Public methods

final @NonNull Map<@NonNull String, @NonNull Object>

Function to be called on the NavEntry.metadata or Scene.metadata to notify the NavDisplay that, when popping from backstack, the content should be animated using the provided ContentTransform.

final @NonNull Map<@NonNull String, @NonNull Object>

Function to be called on the NavEntry.metadata or Scene.metadata to notify the NavDisplay that, when popping from backstack using a Predictive back gesture, the content should be animated using the provided ContentTransform.

final @NonNull Map<@NonNull String, @NonNull Object>

Function to be called on the NavEntry.metadata or Scene.metadata to notify the NavDisplay of how the content should be animated using the provided ContentTransform.

Public fields

INSTANCE

Added in 1.0.0-rc01
public static @NonNull NavDisplay INSTANCE

Public methods

popTransitionSpec

Added in 1.0.0-rc01
public final @NonNull Map<@NonNull String, @NonNull ObjectpopTransitionSpec(
    @NonNull Function1<@NonNull AnimatedContentTransitionScope<@NonNull Scene<@NonNull ?>>, ContentTransform> popTransitionSpec
)

Function to be called on the NavEntry.metadata or Scene.metadata to notify the NavDisplay that, when popping from backstack, the content should be animated using the provided ContentTransform.

IMPORTANT NavDisplay only looks at the Scene.metadata to determine the popTransitionSpec, it is the responsibility of the Scene.metadata to decide which popTransitionSpec to return, whether that be from the NavEntry.metadata or something custom.

Parameters
@NonNull Function1<@NonNull AnimatedContentTransitionScope<@NonNull Scene<@NonNull ?>>, ContentTransform> popTransitionSpec

the ContentTransform to be used when popping from backstack. If this is null, the transition will fallback to the transition set on the NavDisplay

predictivePopTransitionSpec

Added in 1.0.0-rc01
public final @NonNull Map<@NonNull String, @NonNull ObjectpredictivePopTransitionSpec(
    @NonNull Function2<@NonNull AnimatedContentTransitionScope<@NonNull Scene<@NonNull ?>>, @NonNull IntegerContentTransform> predictivePopTransitionSpec
)

Function to be called on the NavEntry.metadata or Scene.metadata to notify the NavDisplay that, when popping from backstack using a Predictive back gesture, the content should be animated using the provided ContentTransform.

IMPORTANT NavDisplay only looks at the Scene.metadata to determine the predictivePopTransitionSpec, it is the responsibility of the Scene.metadata to decide which predictivePopTransitionSpec to return, whether that be from the NavEntry.metadata or something custom.

Parameters
@NonNull Function2<@NonNull AnimatedContentTransitionScope<@NonNull Scene<@NonNull ?>>, @NonNull IntegerContentTransform> predictivePopTransitionSpec

the ContentTransform to be used when popping from backStack with predictive back gesture. If this is null, the transition will fallback to the transition set on the NavDisplay

transitionSpec

Added in 1.0.0-rc01
public final @NonNull Map<@NonNull String, @NonNull ObjecttransitionSpec(
    @NonNull Function1<@NonNull AnimatedContentTransitionScope<@NonNull Scene<@NonNull ?>>, ContentTransform> transitionSpec
)

Function to be called on the NavEntry.metadata or Scene.metadata to notify the NavDisplay of how the content should be animated using the provided ContentTransform.

IMPORTANT NavDisplay only looks at the Scene.metadata to determine the transitionSpec, it is the responsibility of the Scene.metadata to decide which transitionSpec to return, whether that be from the NavEntry.metadata or something custom.

Parameters
@NonNull Function1<@NonNull AnimatedContentTransitionScope<@NonNull Scene<@NonNull ?>>, ContentTransform> transitionSpec

the ContentTransform to be used when adding to the backstack. If this is null, the transition will fallback to the transition set on the NavDisplay