Skip to content

Commit 17c43c9

Browse files
committed
Add rounded corners to bottom sheet dialog.
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)
1 parent bec7143 commit 17c43c9

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

library/ui-styles/src/main/res/values/styles_bottom_sheet.xml

+11
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
<!-- Default color for text View -->
1515
<item name="android:textColorTertiary">@color/element_content_primary_light</item>
1616
<item name="android:textColorLink">@color/element_link_light</item>
17+
<item name="bottomSheetStyle">@style/BottomSheetStyle</item>
1718
</style>
1819

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

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

3739
<!-- BottomSheet style -->
40+
<style name="BottomSheetStyle" parent="Widget.MaterialComponents.BottomSheet.Modal">
41+
<item name="shapeAppearance">@style/BottomSheetShapeAppearance</item>
42+
</style>
43+
44+
<style name="BottomSheetShapeAppearance" parent="">
45+
<item name="cornerFamily">rounded</item>
46+
<item name="cornerSize">20dp</item>
47+
</style>
48+
3849
<style name="BottomSheetItemTextMain">
3950
<item name="android:fontFamily">sans-serif-medium</item>
4051
<item name="android:layout_width">0dp</item>

vector/src/main/res/layout/bottom_sheet_attachment_type_selector.xml

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
xmlns:app="http://schemas.android.com/apk/res-auto"
44
android:layout_width="match_parent"
55
android:layout_height="match_parent"
6-
android:background="?colorSurface"
76
android:orientation="vertical">
87

98
<androidx.core.widget.NestedScrollView

vector/src/main/res/layout/view_bottom_sheet_action_button.xml

+1-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
android:id="@+id/bottomSheetActionClickableZone"
1111
android:layout_width="match_parent"
1212
android:layout_height="wrap_content"
13-
android:background="?colorSurface"
1413
android:clickable="true"
1514
android:focusable="true"
1615
android:foreground="?attr/selectableItemBackground"
@@ -93,4 +92,4 @@
9392

9493
</androidx.constraintlayout.widget.ConstraintLayout>
9594

96-
</merge>
95+
</merge>

0 commit comments

Comments
 (0)