@ExperimentalMaterial3AdaptiveApi
class ListDetailSceneStrategy<T : Any> : SceneStrategy


A ListDetailSceneStrategy supports arranging NavEntrys into an adaptive ListDetailPaneScaffold. By using listPane, detailPane, or extraPane in a NavEntry's metadata, entries can be assigned as belonging to a list pane, detail 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>
detailPane(sceneKey: Any)

Constructs metadata to mark a NavEntry as belonging to a detail pane within a ListDetailPaneScaffold.

Map<StringAny>
extraPane(sceneKey: Any)

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

Map<StringAny>
listPane(sceneKey: Any, detailPlaceholder: @Composable ThreePaneScaffoldScope.() -> Unit)

Constructs metadata to mark a NavEntry as belonging to a list pane within a ListDetailPaneScaffold.

Public constructors

<T : Any> ListDetailSceneStrategy(
    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 list-detail 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

detailPane

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

Constructs metadata to mark a NavEntry as belonging to a detail pane within a ListDetailPaneScaffold.

Parameters
sceneKey: Any = Unit

the key to distinguish the scene of the list-detail scaffold, in case multiple list-detail scaffolds are supported within the same NavDisplay.

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 ListDetailPaneScaffold.

Parameters
sceneKey: Any = Unit

the key to distinguish the scene of the list-detail scaffold, in case multiple list-detail scaffolds are supported within the same NavDisplay.

listPane

Added in 1.0.0-alpha01
fun listPane(sceneKey: Any = Unit, detailPlaceholder: @Composable ThreePaneScaffoldScope.() -> Unit = {}): Map<StringAny>

Constructs metadata to mark a NavEntry as belonging to a list pane within a ListDetailPaneScaffold.

Parameters
sceneKey: Any = Unit

the key to distinguish the scene of the list-detail scaffold, in case multiple list-detail scaffolds are supported within the same NavDisplay.

detailPlaceholder: @Composable ThreePaneScaffoldScope.() -> Unit = {}

composable content to display in the detail pane in case there is no other NavEntry representing a detail pane in the backstack. Note that this content does not receive the same scoping mechanisms as a full-fledged NavEntry.

Public constructors

ListDetailSceneStrategy

Added in 1.0.0-alpha01
<T : Any> ListDetailSceneStrategy(
    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 list-detail 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 list-detail scaffold should arrange its panes.