Skip to content

Commit

Permalink
[Side Sheet] Move modal side sheet default width/height into style so…
Browse files Browse the repository at this point in the history
… they can be customized

Resolves #3492

PiperOrigin-RevId: 590915421
  • Loading branch information
dsn5ft authored and raajkumars committed Dec 14, 2023
1 parent e88a1b9 commit 3b278d7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Expand Up @@ -41,8 +41,6 @@
<FrameLayout
android:id="@+id/m3_side_sheet"
style="?attr/sideSheetModalStyle"
android:layout_width="@dimen/m3_side_sheet_width"
android:layout_height="match_parent"
app:layout_behavior="@string/side_sheet_behavior"/>

</androidx.coordinatorlayout.widget.CoordinatorLayout>
Expand Down
Expand Up @@ -40,6 +40,11 @@

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

1 comment on commit 3b278d7

@akeeaggarwal
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.