Common
public class SceneDecoratorStrategyScope<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
*/
onBack: () -> Unit
) : SceneStrategyScope<T>(onBack)
Scope used to create a Scene from another Scene.
This Scope should be provided to the SceneDecoratorStrategy.decorateScene function to create Scenes.
Secondary Constructors
public constructor() : this(onBack = {})
Construct a SceneDecoratorStrategyScope suitable for calling SceneDecoratorStrategy 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.