Skip to content

Commit 3b278d7

Browse files
dsn5ftraajkumars
authored andcommittedDec 14, 2023
[Side Sheet] Move modal side sheet default width/height into style so they can be customized
Resolves #3492 PiperOrigin-RevId: 590915421
1 parent e88a1b9 commit 3b278d7

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed
 

‎lib/java/com/google/android/material/sidesheet/res/layout/m3_side_sheet_dialog.xml

-2
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@
4141
<FrameLayout
4242
android:id="@+id/m3_side_sheet"
4343
style="?attr/sideSheetModalStyle"
44-
android:layout_width="@dimen/m3_side_sheet_width"
45-
android:layout_height="match_parent"
4644
app:layout_behavior="@string/side_sheet_behavior"/>
4745

4846
</androidx.coordinatorlayout.widget.CoordinatorLayout>

‎lib/java/com/google/android/material/sidesheet/res/values/styles.xml

+5
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@
4040

4141
<!-- Style for the M3 Modal Side Sheet. -->
4242
<style name="Widget.Material3.SideSheet.Modal">
43+
<!-- Layout_* attributes break when set via a default style, but it's ok to
44+
set layout_* attributes from this style, because this style is set
45+
explicitly on the modal side sheet View. -->
46+
<item name="android:layout_width">@dimen/m3_side_sheet_width</item>
47+
<item name="android:layout_height">match_parent</item>
4348
<item name="android:elevation" tools:ignore="NewApi">@dimen/m3_side_sheet_modal_elevation</item>
4449
<item name="backgroundTint">@macro/m3_comp_sheet_side_docked_modal_container_color</item>
4550
<item name="shapeAppearance">@macro/m3_comp_sheet_side_docked_modal_container_shape</item>

1 commit comments

Comments
 (1)

akeeaggarwal commented on Jan 30, 2024

@akeeaggarwal

App is crashing after updating to "1.12.0-alpha03" with below logs

FATAL EXCEPTION: main
Process: com.example.debug, PID: 24717
android.view.InflateException: Binary XML file line #44 in com.example.debug:layout/m3_side_sheet_dialog: Could not inflate Behavior subclass com.google.android.material.sidesheet.SideSheetBehavior
Caused by: java.lang.RuntimeException: Could not inflate Behavior subclass com.google.android.material.sidesheet.SideSheetBehavior

Please sign in to comment.