@@ -562,26 +562,31 @@ bottomSheetBehavior.removeBottomSheetCallback(bottomSheetCallback)
562
562
<details >
563
563
<summary ><h3 >Handling insets and fullscreen</h3 ></summary >
564
564
565
- ` BottomSheetBehavior ` automatically handles window insets by applying padding to
566
- the top and bottom of the view and margins to the left and right. These
567
- paddings and margins can be customized by specifying any of the following
568
- attributes on the view:
565
+ ` BottomSheetBehavior ` can automatically handle insets (such as for
566
+ [ edge to edge] ( https://developer.android.com/training/gestures/edge-to-edge ) ) by
567
+ specifying any of these to true on the view:
569
568
570
569
* ` app:paddingBottomSystemWindowInsets `
571
570
* ` app:paddingLeftSystemWindowInsets `
572
571
* ` app:paddingRightSystemWindowInsets `
573
572
* ` app:paddingTopSystemWindowInsets `
574
573
575
- * ` app:marginLeftSystemWindowInsets `
576
- * ` app:marginRightSystemWindowInsets `
577
- * ` app:marginTopSystemWindowInsets `
574
+ On API 21 and above the modal bottom sheet will be rendered fullscreen (edge to
575
+ edge) if the navigation bar is transparent and ` enableEdgeToEdge ` is true.
576
+ To enable edge-to-edge by default for modal bottom sheets, you can override
577
+ ` ?attr/bottomSheetDialogTheme ` like the below example (` enableEdgeToEdge ` is
578
+ already true in ` ThemeOverlay.Material3.BottomSheetDialog ` ):
578
579
579
- Modal bottom sheets are rendered fullscreen by default. On API 21-34, this can
580
- be overriden by setting ` enableEdgeToEdge ` to ` false ` in your
581
- ` ?attr/bottomSheetDialogTheme ` ThemeOverlay. On API 35 and above,
582
- ` enableEdgeToEdge ` has been deprecated and will no longer take effect. To
583
- learn more, read about [ edge-to-edge enforcement on Android 15 ] ( https://developer.android.com/about/versions/15/behavior-changes-15#edge-to-edge ) .
580
+ ``` xml
581
+ < style name = " AppTheme " parent = " Theme.Material3.* " >
582
+ ...
583
+ < item name = " bottomSheetDialogTheme " >@style/ThemeOverlay.App.BottomSheetDialog</ item >
584
+ </ style >
584
585
586
+ <style name =" ThemeOverlay.App.BottomSheetDialog" parent =" ThemeOverlay.Material3.BottomSheetDialog" >
587
+ <item name =" android:navigationBarColor" >@android:color/transparent<item >
588
+ </style >
589
+ ```
585
590
Insets can be added automatically if any of the padding attributes above are set
586
591
to true in the style, either by updating the style passed to the constructor, or
587
592
by updating the default style specified by the ` ?attr/bottomSheetDialogTheme `
0 commit comments