Start native apps faster with the Composables CLI ->
Compose Component

SwipeDismissableNavHost

Provides a place in the Compose hierarchy for self-contained navigation to occur, with backwards navigation provided by a swipe gesture.

SwipeDismissableNavHost

Source set: Android
@Composable
public fun SwipeDismissableNavHost(
    navController: NavHostController,
    startDestination: String,
    modifier: Modifier = Modifier,
    userSwipeEnabled: Boolean = true,
    state: SwipeDismissableNavHostState = rememberSwipeDismissableNavHostState(),
    route: String? = null,
    builder: NavGraphBuilder.() -> Unit,
): Unit

Parameters

navController The navController for this host
startDestination The route for the start destination
modifier The modifier to be applied to the layout
userSwipeEnabled Boolean Whether swipe-to-dismiss gesture is enabled.
state State containing information about ongoing swipe and animation. This parameter is unused API level 36 onwards, because the platform supports predictive back and SwipeDismissableNavHost uses platform gestures to detect the back gestures.
route The route for the graph
builder The builder used to construct the graph

SwipeDismissableNavHost

Source set: Android
@Composable
public fun SwipeDismissableNavHost(
    navController: NavHostController,
    graph: NavGraph,
    modifier: Modifier = Modifier,
    userSwipeEnabled: Boolean = true,
    state: SwipeDismissableNavHostState = rememberSwipeDismissableNavHostState(),
)

Parameters

navController NavHostController for this host
graph Graph for this host
modifier Modifier to be applied to the layout
userSwipeEnabled Boolean Whether swipe-to-dismiss gesture is enabled.
state State containing information about ongoing swipe and animation. This parameter is unused API level 36 onwards, because the platform supports predictive back and SwipeDismissableNavHost uses platform gestures to detect the back gestures.

Throws: IllegalArgumentException

if no WearNavigation.Destination is on the navigation backstack.

SwipeDismissableNavHost

Source set: Android
@Deprecated(
    "This overload is provided for backwards compatibility. " +
        "A newer overload is available with an additional userSwipeEnabled param.",
    level = DeprecationLevel.HIDDEN,
)
@Composable
public fun SwipeDismissableNavHost(
    navController: NavHostController,
    startDestination: String,
    modifier: Modifier = Modifier,
    state: SwipeDismissableNavHostState = rememberSwipeDismissableNavHostState(),
    route: String? = null,
    builder: NavGraphBuilder.() -> Unit,
): Unit

Parameters

navController The navController for this host
startDestination The route for the start destination
modifier The modifier to be applied to the layout
state State containing information about ongoing swipe and animation.
route The route for the graph
builder The builder used to construct the graph

SwipeDismissableNavHost

Source set: Android
@Deprecated(
    "This overload is provided for backwards compatibility. " +
        "A newer overload is available with an additional userSwipeEnabled param.",
    level = DeprecationLevel.HIDDEN,
)
@Composable
public fun SwipeDismissableNavHost(
    navController: NavHostController,
    graph: NavGraph,
    modifier: Modifier = Modifier,
    state: SwipeDismissableNavHostState = rememberSwipeDismissableNavHostState(),
): Unit

Parameters

navController NavHostController for this host
graph Graph for this host
modifier Modifier to be applied to the layout
state State containing information about ongoing swipe and animation.

Throws: IllegalArgumentException

if no WearNavigation.Destination is on the navigation backstack.