SceneStrategy


Known direct subclasses
DialogSceneStrategy

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

ListDetailSceneStrategy

A ListDetailSceneStrategy supports arranging NavEntrys into an adaptive ListDetailPaneScaffold.

SinglePaneSceneStrategy

A SceneStrategy that always creates a 1-entry Scene simply displaying the last entry in the list.

SupportingPaneSceneStrategy

A SupportingPaneSceneStrategy supports arranging NavEntrys into an adaptive SupportingPaneScaffold.

SwipeDismissableSceneStrategy

A SceneStrategy that displays entries within a Wear Material component.


A strategy that tries to calculate a Scene given a list of NavEntry.

If the list of NavEntry does not result in a Scene for this strategy, null will be returned instead to delegate to another strategy.

Summary

Public functions

Scene<T>?

Given a SceneStrategyScope, calculate whether this SceneStrategy should take on the task of rendering one or more of the entries in the scope.

Cmn
open Scene<T>

Given a SceneStrategyScope, calculate whether this SceneStrategy should take on the task of rendering along with the given Scene in the scope.

Cmn
open infix SceneStrategy<T>
then(sceneStrategy: SceneStrategy<T>)

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

Cmn

Public functions

calculateScene

fun SceneStrategyScope<T>.calculateScene(entries: List<NavEntry<T>>): Scene<T>?

Given a SceneStrategyScope, calculate whether this SceneStrategy should take on the task of rendering one or more of the entries in the scope.

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.

calculateScene

open fun SceneStrategyScope<T>.calculateScene(scene: Scene<T>): Scene<T>

Given a SceneStrategyScope, calculate whether this SceneStrategy should take on the task of rendering along with the given Scene in the scope.

This will always return a non-null Scene where if a SceneStrategy does not want to use the given scene it should just return it.

Parameters
scene: Scene<T>

The scene that should be considered valid to render via a returned Scene.

then

open infix fun then(sceneStrategy: SceneStrategy<T>): SceneStrategy<T>

Chains this SceneStrategy with another sceneStrategy to return a combined SceneStrategy. For the returned SceneStrategy, the calculateScene that takes entries will be use the first non-null result from the calculation, while the calculateScene that takes scenes will be called for every SceneStrategy in the chain.

For SceneStrategys that wish to be calculated with another scene, the calling SceneStrategy is first and the given SceneStrategy receives the result of the calculation. This means that the result is cumulative, with each consecutive SceneStrategy using the result of the previous one.