Will there be any BottomSheet composable from Mate...
# compose
w
Will there be any BottomSheet composable from Material which allows applying custom scrim colors & draggable to full screen even with content which occupies only half the height of the bottomsheet.
Already checked
Bottomsheetscaffold
, It doesn't allow to apply scrim. With
ModalBottomSheetLayout
it expands only based on wrap content!
c
If you want it to expand to full screen, add a
Spacer(Modifier.weight(1f))
to the end of the sheet content
w
Hi Chris , This solution works when I did some workaround, I made the host Composable content weight based on sheetstate,
Copy code
ModalBottomSheetLayout(
  sheetContent = {
    LazyColumn(modifier = if(bottomsheetState.currentValue == ModalBottomSheetValue.Expanded) Modifier.weight(1f) else Modifier){
      item {
        repeat(100) {
          Text(
            text = "Content",
            modifier = Modifier
              .padding(all = 16.dp)
              .fillMaxWidth()
              .clickable {
              },
          )
        }
      }
    }
  },
  sheetState = bottomsheetState,
) {
}
j
M3's
ModalBottomSheet
has a
scrimColor
parameter. Changing the touch input area to diverge from the visual boundaries is not something we recommend and do not support.