[Doc] Add an example to demonstrate how to make bottom sheet dialog edge-to-edge

PiperOrigin-RevId: 453451473
This commit is contained in:
conradchen 2022-06-07 09:13:00 -07:00 committed by pekingme
parent 11578b34f3
commit 57a3c989ff

View File

@ -198,6 +198,19 @@ specifying any of these to true on the view:
On API 21 and above the modal bottom sheet will be rendered fullscreen (edge to
edge) if the navigation bar is transparent and `app:enableEdgeToEdge` is true.
To enable edge-to-edge by default for modal bottom sheets, you can override
`?attr/bottomSheetDialogTheme` like the below example:
```
<style name="AppTheme" parent="Theme.Material3.*">
...
<item name="bottomSheetDialogTheme">@style/ThemeOverlay.App.BottomSheetDialog</item>
</style>
<style name="ThemeOverlay.App.BottomSheetDialog" parent="ThemeOverlay.Material3.BottomSheetDialog">
<item name="android:navigationBarColor" tools:ignore="NewApi">@android:color/transparent</item>
</style>
```
Insets can be added automatically if any of the padding attributes above are set
to true in the style, either by updating the style passed to the constructor, or