Common
public open class SceneStrategyScope<T : Any>
internal constructor(
/**
* A callback that should be connected to any internal handling of system back done by the
* returned [Scene].
*
* For example, if your [Scene] uses a separate window that handles system back itself or if the
* UI present in your [Scene] allows users to go back via a custom gesture or affordance, this
* callback allows you to bubble up that event to the [SceneState] /
* [androidx.navigation3.ui.NavDisplay] that interfaces with the developer owned back stack.
*
* @sample androidx.navigation3.scene.samples.SceneStrategyOnBackSample
*/
public val onBack: () -> Unit
)
Scope used to create a Scene from a list of NavEntrys.
This Scope should be provided to the SceneStrategy.calculateScene function to create Scenes.
Secondary Constructors
public constructor() : this(onBack = {})
Construct a SceneStrategyScope suitable for calling SceneStrategy functions in isolation.
For more complicated cases, such as ones where you want to test if onBack is called correctly, use rememberSceneState, which will construct its own internal SceneStrategyScope suitable for a Scene that closely mirror real scenarios and be passed to androidx.navigation3.ui.NavDisplay.