https://kotlinlang.org logo
#compose
Title
# compose
v

Vivek Sharma

11/08/2020, 10:35 AM
Anyone tried BottomDrawerLayout with fab? I cant fix its height and the fab appears when bottomdrawerlayout opens , any project on github to show this usecase?
s

Se7eN

11/08/2020, 3:16 PM
You mean the fab appears over the drawer? If that's the case, I guess your fab isn't inside your
BottomDrawerLayout
. Here's a sample: https://gist.github.com/ashar-7/a0127714d9f94112426474b4b0cb808b
v

Vivek Sharma

11/08/2020, 6:09 PM
I was using Scaffold which have predefined param for fab and inside that scaffold I was using some list stuff and bottom drawer layout too, maybe thats why, I will try this solution
s

Se7eN

11/09/2020, 7:16 AM
Also check out
BottomSheetScaffold
v

Vivek Sharma

11/09/2020, 10:19 AM
BottomSheetScaffold
is like simple bottom sheet, it doesnt overshadow or come above (like bottom drawer layout) the content behind it
I am trying to make like google tasks app, when you click on add button, you get a fixed bottom drawer layout
s

Se7eN

11/09/2020, 10:27 AM
Oh okay
m

matvei

11/09/2020, 1:07 PM
BottomSheetScaffold
 is like simple bottom sheet, it doesnt overshadow or come above (like bottom drawer layout) the content behind it
This is true for
ModalBottomSheet
, but
BottomSheetScaffold
allows you to specify the sheet that slides on top of the content (without scrim though, but you could easily make a scrim on the content by observing state). BottomSheetScaffold even has a slot for FAB which allows it to float half on the sheet (see demos or material specs). Also you could try to use BackdropScaffold, there are plenty of scaffolds in Compose as you can see 🙂