@ExperimentalMaterial3AdaptiveApi
class SupportingPaneSceneStrategy<T : Any> : SceneStrategy


A SupportingPaneSceneStrategy supports arranging NavEntrys into an adaptive SupportingPaneScaffold. By using mainPane, supportingPane, or extraPane in a NavEntry's metadata, entries can be assigned as belonging to a main pane, supporting pane, or extra pane. These panes will be displayed together if the window size is sufficiently large, and will automatically adapt if the window size changes, for example, on a foldable device.

Summary

Public companion functions

Map<StringAny>
extraPane(sceneKey: Any)

Constructs metadata to mark a NavEntry as belonging to an extra pane within a SupportingPaneScaffold.

Map<StringAny>
mainPane(sceneKey: Any)

Constructs metadata to mark a NavEntry as belonging to a main pane within a SupportingPaneScaffold.

Map<StringAny>
supportingPane(sceneKey: Any)

Constructs metadata to mark a NavEntry as belonging to a supporting pane within a SupportingPaneScaffold.

Public constructors

<T : Any> SupportingPaneSceneStrategy(
    backNavigationBehavior: BackNavigationBehavior,
    directive: PaneScaffoldDirective
)

Public functions

open Scene<T>?
@Composable
calculateScene(entries: List<NavEntry<T>>, onBack: (count: Int) -> Unit)

Given a back stack of entries, calculate whether this SceneStrategy should take on the task of rendering one or more of those entries.

Public properties

BackNavigationBehavior

the behavior describing which backstack entries may be skipped during the back navigation.

PaneScaffoldDirective

The top-level directives about how the scaffold should arrange its panes.

Inherited functions

From androidx.navigation3.ui.SceneStrategy
open infix SceneStrategy<T>
then(sceneStrategy: SceneStrategy<T>)

Chains this SceneStrategy with another sceneStrategy to return a combined SceneStrategy.

Public companion functions

extraPane

Added in 1.0.0-alpha01
fun extraPane(sceneKey: Any = Unit): Map<StringAny>

Constructs metadata to mark a NavEntry as belonging to an extra pane within a SupportingPaneScaffold.

Parameters
sceneKey: Any = Unit

the key to distinguish the scene of the supporting-pane scaffold, in case multiple supporting-pane scaffolds are used within the same NavDisplay.

mainPane

Added in 1.0.0-alpha01
fun mainPane(sceneKey: Any = Unit): Map<StringAny>

Constructs metadata to mark a NavEntry as belonging to a main pane within a SupportingPaneScaffold.

Parameters
sceneKey: Any = Unit

the key to distinguish the scene of the supporting-pane scaffold, in case multiple supporting-pane scaffolds are used within the same NavDisplay.

supportingPane

Added in 1.0.0-alpha01
fun supportingPane(sceneKey: Any = Unit): Map<StringAny>

Constructs metadata to mark a NavEntry as belonging to a supporting pane within a SupportingPaneScaffold.

Parameters
sceneKey: Any = Unit

the key to distinguish the scene of the supporting-pane scaffold, in case multiple supporting-pane scaffolds are used within the same NavDisplay.

Public constructors

SupportingPaneSceneStrategy

Added in 1.0.0-alpha01
<T : Any> SupportingPaneSceneStrategy(
    backNavigationBehavior: BackNavigationBehavior,
    directive: PaneScaffoldDirective
)
Parameters
backNavigationBehavior: BackNavigationBehavior

the behavior describing which backstack entries may be skipped during the back navigation. See BackNavigationBehavior.

directive: PaneScaffoldDirective

The top-level directives about how the scaffold should arrange its panes.

Public functions

calculateScene

@Composable
open fun calculateScene(entries: List<NavEntry<T>>, onBack: (count: Int) -> Unit): Scene<T>?

Given a back stack of entries, calculate whether this SceneStrategy should take on the task of rendering one or more of those entries.

By returning a non-null Scene, your Scene takes on the responsibility of rendering the set of entries you declare in Scene.entries. If you return null, the next available SceneStrategy will be called.

Parameters
entries: List<NavEntry<T>>

The entries on the back stack that should be considered valid to render via a returned Scene.

onBack: (count: Int) -> Unit

a callback that should be connected to any internal handling of system back done by the returned Scene. The passed Int should be the number of entries were popped.

Public properties

backNavigationBehavior

val backNavigationBehaviorBackNavigationBehavior

the behavior describing which backstack entries may be skipped during the back navigation. See BackNavigationBehavior.

directive

Added in 1.0.0-alpha01
val directivePaneScaffoldDirective

The top-level directives about how the scaffold should arrange its panes.