Package 

Class DialogNavHostKt

    • Method Detail

      • DialogNavHost

        @Composable() final static <T extends Any> Unit DialogNavHost(NavController<T> controller, Function0<Unit> emptyBackstackPlaceholder, Function2<NavHostScope<T>, T, Unit> contentSelector)

        A navigation host specifically suited for showing dialogs. It is based on AnimatedNavHost and provides smoother transition between dialogs rather than simple NavHost - there will be no visible scrim flickering.

        Same as other NavHosts it also 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.

        Note that DialogNavHost doesn't wrap your composables into a Dialog. You need to use either Dialog or AlertDialog composable inside a contentSelector yourself.

        Parameters:
        controller - the navigation controller that will provide its backstack to this DialogNavHost.
        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.
      • DialogNavHost

        @Composable() final static <T extends Any> Unit DialogNavHost(NavBackstack<T> backstack, Function0<Unit> emptyBackstackPlaceholder, Function2<NavHostScope<T>, T, Unit> contentSelector)

        A navigation host specifically suited for showing dialogs. It is based on AnimatedNavHost and provides smoother transition between dialogs rather than simple NavHost - there will be no visible scrim flickering.

        Same as other NavHosts it also 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.

        Note that DialogNavHost doesn't wrap your composables into a Dialog. You need to use either Dialog or AlertDialog composable inside a contentSelector yourself.

        Parameters:
        backstack - the backstack from a NavController that will be used to observe navigation changes.
        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.
      • ScopingDialogNavHost

        @Composable() final static <T extends Any, S extends Any> Unit ScopingDialogNavHost(NavController<T> controller, NavScopeSpec<T, S> scopeSpec, Function0<Unit> emptyBackstackPlaceholder, Function2<ScopingNavHostScope<T, S>, T, Unit> contentSelector)

        A navigation host specifically suited for showing dialogs. It is based on AnimatedNavHost and provides smoother transition between dialogs rather than simple NavHost - there will be no visible scrim flickering.

        Same as other NavHosts it also 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.

        Note that DialogNavHost doesn't wrap your composables into a Dialog. You need to use either Dialog or AlertDialog composable inside a contentSelector yourself.

        Scoping: This version of DialogNavHost 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 DialogNavHost.
        scopeSpec - specifies scopes for every destination.
        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.
      • ScopingDialogNavHost

        @Composable() final static <T extends Any, S extends Any> Unit ScopingDialogNavHost(NavBackstack<T> backstack, NavScopeSpec<T, S> scopeSpec, Function0<Unit> emptyBackstackPlaceholder, Function2<ScopingNavHostScope<T, S>, T, Unit> contentSelector)

        A navigation host specifically suited for showing dialogs. It is based on AnimatedNavHost and provides smoother transition between dialogs rather than simple NavHost - there will be no visible scrim flickering.

        Same as other NavHosts it also 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.

        Note that DialogNavHost doesn't wrap your composables into a Dialog. You need to use either Dialog or AlertDialog composable inside a contentSelector yourself.

        Scoping: This version of DialogNavHost 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.
        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.