Package 

Class NavHostKt

    • Method Summary

      Modifier and Type Method Description
      final static <T extends Any> Unit NavHost(NavController<T> controller, Modifier modifier, Function0<Unit> emptyBackstackPlaceholder, Alignment contentAlignment, Function2<NavHostScope<T>, T, Unit> contentSelector) A basic navigation host that selects UI for every destination and provides saved state and Android architecture components (Lifecycle, ViewModelStore, SavedStateRegistry) through CompositionLocalProvider for every unique NavEntry in the controller's backstack.
      final static <T extends Any> Unit NavHost(NavBackstack<T> backstack, Modifier modifier, Alignment contentAlignment, Function0<Unit> emptyBackstackPlaceholder, Function2<NavHostScope<T>, T, Unit> contentSelector) A basic navigation host that selects UI for every destination and provides saved state and Android architecture components (Lifecycle, ViewModelStore, SavedStateRegistry) through CompositionLocalProvider for every unique NavEntry in the backstack.
      final static <T extends Any> Unit NavHost(NavHostState<T> state, Modifier modifier, Alignment contentAlignment, Function0<Unit> emptyBackstackPlaceholder, Function2<NavHostScope<T>, T, Unit> contentSelector) A basic navigation host that selects UI for every destination and provides saved state and Android architecture components (Lifecycle, ViewModelStore, SavedStateRegistry) through CompositionLocalProvider for every unique NavEntry in the backstack.
      final static <T extends Any, S extends Any> Unit ScopingNavHost(NavController<T> controller, NavScopeSpec<T, S> scopeSpec, Modifier modifier, Alignment contentAlignment, Function0<Unit> emptyBackstackPlaceholder, Function2<ScopingNavHostScope<T, S>, T, Unit> contentSelector) A basic navigation host that selects UI for every destination and provides saved state and Android architecture components (Lifecycle, ViewModelStore, SavedStateRegistry) through CompositionLocalProvider for every unique NavEntry in the controller's backstack.
      final static <T extends Any, S extends Any> Unit ScopingNavHost(NavBackstack<T> backstack, NavScopeSpec<T, S> scopeSpec, Modifier modifier, Alignment contentAlignment, Function0<Unit> emptyBackstackPlaceholder, Function2<ScopingNavHostScope<T, S>, T, Unit> contentSelector) A basic navigation host that selects UI for every destination and provides saved state and Android architecture components (Lifecycle, ViewModelStore, SavedStateRegistry) through CompositionLocalProvider for every unique NavEntry in the backstack.
      final static <T extends Any, S extends Any> Unit ScopingNavHost(ScopingNavHostState<T, S> state, Modifier modifier, Alignment contentAlignment, Function0<Unit> emptyBackstackPlaceholder, Function2<ScopingNavHostScope<T, S>, T, Unit> contentSelector) A basic navigation host that selects UI for every destination and provides saved state and Android architecture components (Lifecycle, ViewModelStore, SavedStateRegistry) through CompositionLocalProvider for every unique NavEntry in the backstack.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • NavHost

        @Composable() final static <T extends Any> Unit NavHost(NavController<T> controller, Modifier modifier, Function0<Unit> emptyBackstackPlaceholder, Alignment contentAlignment, Function2<NavHostScope<T>, T, Unit> contentSelector)

        A basic navigation host that selects UI for every destination and provides saved state and Android architecture components (Lifecycle, ViewModelStore, SavedStateRegistry) through CompositionLocalProvider for every unique NavEntry in the controller's backstack.

        This composable doesn't provide animated transitions between destinations - it will simply jump-cut to the next destination.

        If you need animated transitions use AnimatedNavHost instead. For smoother transitions between dialogs use DialogNavHost.

        Parameters:
        controller - the navigation controller that will provide its backstack to this NavHost.
        modifier - the modifier to be applied to NavHost
        emptyBackstackPlaceholder - an optional placeholder composable that will be displayed when the backstack is empty.
        contentAlignment - the alignment inside NavHost
        contentSelector - provides a composable that corresponds to the current last destination in the backstack.
      • NavHost

        @Composable() final static <T extends Any> Unit NavHost(NavBackstack<T> backstack, Modifier modifier, Alignment contentAlignment, Function0<Unit> emptyBackstackPlaceholder, Function2<NavHostScope<T>, T, Unit> contentSelector)

        A basic navigation host that selects UI for every destination and provides saved state and Android architecture components (Lifecycle, ViewModelStore, SavedStateRegistry) through CompositionLocalProvider for every unique NavEntry in the backstack.

        This composable doesn't provide animated transitions between destinations - it will simply jump-cut to the next destination.

        If you need animated transitions use AnimatedNavHost instead. For smoother transitions between dialogs use DialogNavHost.

        Parameters:
        backstack - the backstack from a NavController that will be used to observe navigation changes.
        modifier - the modifier to be applied to NavHost
        contentAlignment - the alignment inside NavHost
        emptyBackstackPlaceholder - an optional placeholder composable that will be displayed when the backstack is empty.
        contentSelector - provides a composable that corresponds to the current last destination in the backstack.
      • NavHost

        @Composable() final static <T extends Any> Unit NavHost(NavHostState<T> state, Modifier modifier, Alignment contentAlignment, Function0<Unit> emptyBackstackPlaceholder, Function2<NavHostScope<T>, T, Unit> contentSelector)

        A basic navigation host that selects UI for every destination and provides saved state and Android architecture components (Lifecycle, ViewModelStore, SavedStateRegistry) through CompositionLocalProvider for every unique NavEntry in the backstack.

        This composable doesn't provide animated transitions between destinations - it will simply jump-cut to the next destination.

        If you need animated transitions use AnimatedNavHost instead. For smoother transitions between dialogs use DialogNavHost.

        Parameters:
        state - the holder of all internal NavHost state.
        modifier - the modifier to be applied to NavHost
        contentAlignment - the alignment inside NavHost
        emptyBackstackPlaceholder - an optional placeholder composable that will be displayed when the backstack is empty.
        contentSelector - provides a composable that corresponds to the current last destination in the backstack.
      • ScopingNavHost

        @Composable() final static <T extends Any, S extends Any> Unit ScopingNavHost(NavController<T> controller, NavScopeSpec<T, S> scopeSpec, Modifier modifier, Alignment contentAlignment, Function0<Unit> emptyBackstackPlaceholder, Function2<ScopingNavHostScope<T, S>, T, Unit> contentSelector)

        A basic navigation host that selects UI for every destination and provides saved state and Android architecture components (Lifecycle, ViewModelStore, SavedStateRegistry) through CompositionLocalProvider for every unique NavEntry in the controller's backstack.

        This composable doesn't provide animated transitions between destinations - it will simply jump-cut to the next destination.

        If you need animated transitions use AnimatedNavHost instead. For smoother transitions between dialogs use DialogNavHost.

        Scoping: This version of NavHost gives you the ability to define scopes. Read more about it in NavScopeSpec.

        Parameters:
        controller - the navigation controller that will provide its backstack to this NavHost.
        scopeSpec - specifies scopes for every destination.
        modifier - the modifier to be applied to NavHost
        contentAlignment - the alignment inside NavHost
        emptyBackstackPlaceholder - an optional placeholder composable that will be displayed when the backstack is empty.
        contentSelector - provides a composable that corresponds to the current last destination in the backstack.
      • ScopingNavHost

        @Composable() final static <T extends Any, S extends Any> Unit ScopingNavHost(NavBackstack<T> backstack, NavScopeSpec<T, S> scopeSpec, Modifier modifier, Alignment contentAlignment, Function0<Unit> emptyBackstackPlaceholder, Function2<ScopingNavHostScope<T, S>, T, Unit> contentSelector)

        A basic navigation host that selects UI for every destination and provides saved state and Android architecture components (Lifecycle, ViewModelStore, SavedStateRegistry) through CompositionLocalProvider for every unique NavEntry in the backstack.

        This composable doesn't provide animated transitions between destinations - it will simply jump-cut to the next destination.

        If you need animated transitions use AnimatedNavHost instead. For smoother transitions between dialogs use DialogNavHost.

        Scoping: This version of NavHost gives you the ability to define scopes. Read more about it in NavScopeSpec.

        Parameters:
        backstack - the backstack from a NavController that will be used to observe navigation changes.
        scopeSpec - specifies scopes for every destination.
        modifier - the modifier to be applied to NavHost
        contentAlignment - the alignment inside NavHost
        emptyBackstackPlaceholder - an optional placeholder composable that will be displayed when the backstack is empty.
        contentSelector - provides a composable that corresponds to the current last destination in the backstack.
      • ScopingNavHost

        @Composable() final static <T extends Any, S extends Any> Unit ScopingNavHost(ScopingNavHostState<T, S> state, Modifier modifier, Alignment contentAlignment, Function0<Unit> emptyBackstackPlaceholder, Function2<ScopingNavHostScope<T, S>, T, Unit> contentSelector)

        A basic navigation host that selects UI for every destination and provides saved state and Android architecture components (Lifecycle, ViewModelStore, SavedStateRegistry) through CompositionLocalProvider for every unique NavEntry in the backstack.

        This composable doesn't provide animated transitions between destinations - it will simply jump-cut to the next destination.

        If you need animated transitions use AnimatedNavHost instead. For smoother transitions between dialogs use DialogNavHost.

        Scoping: This version of NavHost gives you the ability to define scopes. Read more about it in NavScopeSpec.

        Parameters:
        state - the holder of all internal ScopingNavHost state.
        modifier - the modifier to be applied to NavHost
        contentAlignment - the alignment inside NavHost
        emptyBackstackPlaceholder - an optional placeholder composable that will be displayed when the backstack is empty.
        contentSelector - provides a composable that corresponds to the current last destination in the backstack.