DialogSceneStrategy



A SceneStrategy that displays entries that have added dialog to their NavEntry.metadata within a Dialog instance.

This strategy should always be added before any non-overlay scene strategies.

Summary

Public companion functions

Map<StringAny>
dialog(dialogProperties: DialogProperties)

Function to be called on the NavEntry.metadata to mark this entry as something that should be displayed within a Dialog.

Cmn

Public constructors

Cmn

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.

Cmn

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.

Cmn

Public companion functions

dialog

fun dialog(dialogProperties: DialogProperties = DialogProperties()): Map<StringAny>

Function to be called on the NavEntry.metadata to mark this entry as something that should be displayed within a Dialog.

Parameters
dialogProperties: DialogProperties = DialogProperties()

properties that should be passed to the containing Dialog.

Public constructors

DialogSceneStrategy

<T : Any> DialogSceneStrategy()

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.