Skip to content

Commit

Permalink
[Doc] Add an example to demonstrate how to make bottom sheet dialog e…
Browse files Browse the repository at this point in the history
…dge-to-edge

PiperOrigin-RevId: 453451473
  • Loading branch information
drchen authored and pekingme committed Jun 8, 2022
1 parent 11578b3 commit 57a3c98
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions docs/components/BottomSheet.md
Expand Up @@ -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
Expand Down

0 comments on commit 57a3c98

Please sign in to comment.