DialogSceneStrategy


public final class DialogSceneStrategy<T extends Object> implements SceneStrategy


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

Nested types

public static class DialogSceneStrategy.Companion

Public constructors

<T extends Object> DialogSceneStrategy()

Public methods

Scene<@NonNull T>
calculateScene(
    @NonNull SceneStrategyScope<@NonNull T> receiver,
    @NonNull List<@NonNull NavEntry<@NonNull T>> entries
)

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

Inherited methods

From androidx.navigation3.scene.SceneStrategy
@NonNull SceneStrategy<@NonNull T>
then(@NonNull SceneStrategy<@NonNull T> sceneStrategy)

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

Public constructors

DialogSceneStrategy

public <T extends Object> DialogSceneStrategy()

Public methods

calculateScene

public Scene<@NonNull T> calculateScene(
    @NonNull SceneStrategyScope<@NonNull T> receiver,
    @NonNull List<@NonNull NavEntry<@NonNull T>> entries
)

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
@NonNull List<@NonNull NavEntry<@NonNull T>> entries

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