Michał Diner

    Michał Diner

    1 year ago
    Hi everyone, did anyone came up with proper way of combining bottomSheet with bottomNavBar? My current scenario requires opening BottomSheet in several places with different content, so the solution has to be somewhat generic. Implementation I did looks like this:
    BottomSheet(navController) {
        BottomNavigationBar(
            navController,
            navHost)
    }
    ModalBottomSheetLayout(
        sheetState = bottomSheetScaffoldState,
        sheetContent = {...}
        content = {
            bottomNavigationBar()
    Unaccaptable alternatives:1. BottomSheet opened up by navigation -> replaces current screen and is above the BottomNavBar 2. BottomSheet initialised on currently displayed screen -> shows up above the BottomNavBar. Any ideas how to improve this or is this it?
    n

    nitrog42

    1 year ago
    so... If I understand correctly what you want, what I would suggest is just use a BottomSheetDialogFragment 😄
    Michał Diner

    Michał Diner

    1 year ago
    Thanks @nitrog42, but I'm only interested in Compose UI components.
    n

    nitrog42

    1 year ago
    you can still provide the content of the fragment through a ComposeView, but if you want your current screen to provide the content of the dialog (not defined by an enum passed to the dialog, and the enum define the content) well It won't work 😞
    i

    Ian Lake

    1 year ago
    You might be interested to see the WIP integration between bottom sheets and NavController: https://github.com/androidx/androidx/pull/173