Skip to content

Commit

Permalink
Add rounded corners to bottom sheet dialog.
Browse files Browse the repository at this point in the history
Note these are currently only visible in the collapsed state.
- [Google issue](https://issuetracker.google.com/issues/144859239)
- [Rejected PR](material-components/material-components-android#437)
- [Github issue](material-components/material-components-android#1278)
  • Loading branch information
jonnyandrew committed Oct 26, 2022
1 parent cfbcdcc commit 6d8b8cf
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
11 changes: 11 additions & 0 deletions library/ui-styles/src/main/res/values/styles_bottom_sheet.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<!-- Default color for text View -->
<item name="android:textColorTertiary">@color/element_content_primary_light</item>
<item name="android:textColorLink">@color/element_link_light</item>
<item name="bottomSheetStyle">@style/BottomSheetStyle</item>
</style>

<style name="Theme.Vector.BottomSheetDialog.Dark" parent="Theme.MaterialComponents.BottomSheetDialog">
Expand All @@ -28,13 +29,23 @@
<!-- Default color for text View -->
<item name="android:textColorTertiary">@color/element_content_primary_dark</item>
<item name="android:textColorLink">@color/element_link_dark</item>
<item name="bottomSheetStyle">@style/BottomSheetStyle</item>
</style>

<style name="Theme.Vector.BottomSheetDialog.Black" parent="Theme.Vector.BottomSheetDialog.Dark">
<item name="colorSurface">@color/element_background_black</item>
</style>

<!-- BottomSheet style -->
<style name="BottomSheetStyle" parent="Widget.MaterialComponents.BottomSheet.Modal">
<item name="shapeAppearance">@style/BottomSheetShapeAppearance</item>
</style>

<style name="BottomSheetShapeAppearance" parent="">
<item name="cornerFamily">rounded</item>
<item name="cornerSize">20dp</item>
</style>

<style name="BottomSheetItemTextMain">
<item name="android:fontFamily">sans-serif-medium</item>
<item name="android:layout_width">0dp</item>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?colorSurface"
android:orientation="vertical">

<androidx.core.widget.NestedScrollView
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
android:id="@+id/bottomSheetActionClickableZone"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?colorSurface"
android:clickable="true"
android:focusable="true"
android:foreground="?attr/selectableItemBackground"
Expand Down Expand Up @@ -93,4 +92,4 @@

</androidx.constraintlayout.widget.ConstraintLayout>

</merge>
</merge>

0 comments on commit 6d8b8cf

Please sign in to comment.