I have a compose app with edge to edge content tha...
# compose
k
I have a compose app with edge to edge content that also uses
ModalBottomSheetLayout
. The problem I am facing is that the BottomSheets also draw under the statusbar. It looks weird when the sheet is not fully expanded since the sheet has a lot of padding visible at the top. How can I prevent this?
t
It seems compose ModalBottomSheetLayout does not come with a way to change the status bar scrim so looking at possible solutions ended up adding https://google.github.io/accompanist/systemuicontroller/ to solve this in our app and just observing like this:
Copy code
LaunchedEffect(modalBottomSheetState.targetValue) {
      if (modalBottomSheetState.targetValue == ModalBottomSheetValue.Hidden) {
        systemUiController.setStatusBarColor(defaultStatusBarColor)
      } else {
        systemUiController.setStatusBarColor(scrimColor)
      }
    }