SwipeDismissableSceneStrategy

class SwipeDismissableSceneStrategy<T : Any> : SceneStrategy


A SceneStrategy that displays entries within a Wear Material component.

Below API level 36, content of the current entry (the last entry on the backstack) is displayed within a BasicSwipeToDismissBox to detect swipe back gestures.

API level 36 onwards, SwipeDismissableSceneStrategy listens to platform predictive back events for navigation, and BasicSwipeToDismissBox is not used for swipe gesture detection.

Parameters
<T : Any>

the KType of the backstack key

Summary

Public constructors

<T : Any> SwipeDismissableSceneStrategy(
    state: SwipeDismissableSceneStrategyState,
    modifier: Modifier,
    isUserSwipeEnabled: Boolean
)

Public functions

open Scene<T>?

Public properties

Boolean

Boolean Whether swipe-to-dismiss gesture is enabled.

Modifier

The modifier to be applied to the layout

SwipeDismissableSceneStrategyState

State containing information about ongoing swipe and animation.

Inherited functions

From androidx.navigation3.scene.SceneStrategy
open infix SceneStrategy<T>
then(sceneStrategy: SceneStrategy<T>)

Public constructors

SwipeDismissableSceneStrategy

<T : Any> SwipeDismissableSceneStrategy(
    state: SwipeDismissableSceneStrategyState,
    modifier: Modifier = Modifier,
    isUserSwipeEnabled: Boolean = true
)
Parameters
<T : Any>

the KType of the backstack key

state: SwipeDismissableSceneStrategyState

State containing information about ongoing swipe and animation. This parameter is unused API level 36 onwards, because the platform supports predictive back and SwipeDismissableSceneStrategy uses platform gestures to detect the back gestures.

modifier: Modifier = Modifier

The modifier to be applied to the layout

isUserSwipeEnabled: Boolean = true

Boolean Whether swipe-to-dismiss gesture is enabled.

Public functions

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

Public properties

isUserSwipeEnabled

Added in 1.6.0-alpha07
val isUserSwipeEnabledBoolean

Boolean Whether swipe-to-dismiss gesture is enabled.

modifier

Added in 1.6.0-alpha07
val modifierModifier

The modifier to be applied to the layout

state

Added in 1.6.0-alpha07
val stateSwipeDismissableSceneStrategyState

State containing information about ongoing swipe and animation. This parameter is unused API level 36 onwards, because the platform supports predictive back and SwipeDismissableSceneStrategy uses platform gestures to detect the back gestures.