Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BottomSheet Expanded #130

Open
captainhaddockfr35 opened this issue May 13, 2022 · 5 comments
Open

BottomSheet Expanded #130

captainhaddockfr35 opened this issue May 13, 2022 · 5 comments
Labels
dependency There is an issue that is caused by a dependency we use internally.

Comments

@captainhaddockfr35
Copy link

Hi,

I would like to use the BottomSheet Style. It works but I would like the sheet to open in expanded state, as is possible with androidx.compose.material.ModalBottomSheetLayout but not with accompanist. If I use com.google.accompanist.navigation.material.ModalBottomSheetLayout, the BottomSheet opens fine, but I can't open it in full screen (Expanded). If I use androidx.compose.material.ModalBottomSheetLayout I can tell it to open as Expanded but the bottomSheet does not open.

Did you have an idea ?

@raamcosta
Copy link
Owner

Hey 👋

yeah this is a known issue with accompanist bottom sheet.
There is not much to be done I believe other than opening an issue on accompanist to pressure them to implement the functionality.

@raamcosta raamcosta added the dependency There is an issue that is caused by a dependency we use internally. label May 13, 2022
@raamcosta
Copy link
Owner

You can always just use the bottom sheet from material of course. The difference is that it won’t be registered as a destination in the navigation host, but as long as you have a state saved like on SavedStateHandle, you should be fine, to resume the bottom sheet for a given screen. Of course it won’t be as standalone thing, but you can make it work for sure 🙂

@rudradave1
Copy link

rudradave1 commented May 23, 2022

Here is a workaround if you are using ModalBottomSheet.

        val sheetState = rememberModalBottomSheetState(
                    initialValue = ModalBottomSheetValue.Hidden,
                    skipHalfExpanded = true,
                    confirmStateChange = { false }
                )
        val bottomSheetNavigator = remember { BottomSheetNavigator(sheetState) }
        navController.navigatorProvider += bottomSheetNavigator

@livotov
Copy link

livotov commented Aug 31, 2022

Just a note - for "confirmStateChange = { false }" it is better to return "true" as otherwise you'll be unable to close the bottom sheet by swiping it down

@AttilaAKINCI
Copy link

Here is a workaround if you are using ModalBottomSheet.

        val sheetState = rememberModalBottomSheetState(
                    initialValue = ModalBottomSheetValue.Hidden,
                    skipHalfExpanded = true,
                    confirmStateChange = { false }
                )
        val bottomSheetNavigator = remember { BottomSheetNavigator(sheetState) }
        navController.navigatorProvider += bottomSheetNavigator

I believe, not possible for MT3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependency There is an issue that is caused by a dependency we use internally.
Projects
None yet
Development

No branches or pull requests

5 participants