-
public final class BottomSheetNavigator extends Navigator<BottomSheetNavigator.Destination>
Navigator that drives a ModalBottomSheetState for use of ModalBottomSheetLayouts with the navigation library. Every destination using this Navigator must set a valid Composable by setting it directly on an instantiated Destination or calling androidx.navigation.compose.material.bottomSheet.
<b>The sheetContent will always host the latest entry of the back stack. When navigating from a BottomSheetNavigator.Destination to another BottomSheetNavigator.Destination, the content of the sheet will be replaced instead of a new bottom sheet being shown.</b>
When the sheet is dismissed by the user, the state's NavigatorState.backStack will be popped.
The primary constructor is not intended for public use. Please refer to rememberBottomSheetNavigator instead.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final classBottomSheetNavigator.DestinationNavDestination specific to BottomSheetNavigator
-
Field Summary
Fields Modifier and Type Field Description private final BottomSheetNavigatorSheetStatenavigatorSheetStateprivate final Function1<ColumnScope, Unit>sheetContentprivate BooleanisAttached
-
Constructor Summary
Constructors Constructor Description BottomSheetNavigator(ModalBottomSheetState sheetState)
-
Method Summary
Modifier and Type Method Description final BottomSheetNavigatorSheetStategetNavigatorSheetState()Access properties of the ModalBottomSheetLayout's ModalBottomSheetState final Function1<ColumnScope, Unit>getSheetContent()A Composable function that hosts the current sheet content. final BooleangetIsAttached()final UnitsetIsAttached(Boolean isAttached)UnitonAttach(NavigatorState state)BottomSheetNavigator.DestinationcreateDestination()Unitnavigate(List<NavBackStackEntry> entries, NavOptions navOptions, Navigator.Extras navigatorExtras)UnitpopBackStack(NavBackStackEntry popUpTo, Boolean savedState)-
Methods inherited from class com.google.accompanist.navigation.material.BottomSheetNavigator
navigate, onLaunchSingleTop, onRestoreState, onSaveState, popBackStack -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
BottomSheetNavigator
BottomSheetNavigator(ModalBottomSheetState sheetState)
- Parameters:
sheetState- The ModalBottomSheetState that the BottomSheetNavigator will use to drive the sheet state
-
-
Method Detail
-
getNavigatorSheetState
final BottomSheetNavigatorSheetState getNavigatorSheetState()
Access properties of the ModalBottomSheetLayout's ModalBottomSheetState
-
getSheetContent
final Function1<ColumnScope, Unit> getSheetContent()
A Composable function that hosts the current sheet content. This should be set as sheetContent of your ModalBottomSheetLayout.
-
getIsAttached
final Boolean getIsAttached()
-
setIsAttached
final Unit setIsAttached(Boolean isAttached)
-
onAttach
Unit onAttach(NavigatorState state)
-
createDestination
BottomSheetNavigator.Destination createDestination()
-
navigate
Unit navigate(List<NavBackStackEntry> entries, NavOptions navOptions, Navigator.Extras navigatorExtras)
-
popBackStack
Unit popBackStack(NavBackStackEntry popUpTo, Boolean savedState)
-
-
-
-