question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BottomSheetDialog] Broken after last commit for edge to edge

See original GitHub issue

Description: Edge to edge is broken with last commit

image

I’ve checked drawEdgeToEdge is properly set to true and WindowCompat.setDecorFitsSystemWindows(window, !drawEdgeToEdge) is properly called with false but this triggers the state shown above. The call should have made the window edgetoedge and the statusbar should have been taken in account via padding in the rest of the code.

Reverting that commit fix the issue

image

Expected behavior: The container should be edge to edge it is not.

Source code: Bug introduced by https://github.com/material-components/material-components-android/commit/2d3024ea1092b55d46e7785527853186e124d5aa

Minimal sample app repro:

Android API version: Android 12L + Androidx core 1.8.0

Material Library version: Snapshot

Device: P6 Pro last patches

Ping @drchen

To help us triage faster, please check to make sure you are using the latest version of the library.

We also happily accept pull requests.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:17 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
Tolriqcommented, Jun 4, 2022

Welcome to the joys of edge to edge 😃 Even more fun when dealing with samsung.

Anyway sorry for the delay, different time zone.

Nothing special as I’m starting fresh on the new M3 themes

parent="Theme.Material3.Light.NoActionBar" and

        <!-- Material mandatory -->
        <item name="emojiCompatEnabled">false</item>
        <item name="enableEdgeToEdge">true</item>

        <!-- Android mandatory -->
        <item name="layout_keyline">-1</item>
        <item name="windowActionBar">false</item>
        <item name="windowActionModeOverlay">true</item>
        <item name="windowNoTitle">true</item>
        <item name="android:windowSoftInputMode">adjustPan|stateAlwaysHidden</item>
        <item name="android:soundEffectsEnabled">false</item>

I’ll try to find some times next week to repro both things

0reactions
drchencommented, Jun 7, 2022

I agree the whole theming structure of bottom sheet dialogs is kind of confusing. (And I agree we may need to improve our dev doc description.) And yes, paddingBottomSystemWindowInsets needs to be set inside your ?attr/bottomSheetStyle instead of the app theme. (It probably also works if you set it in ?attr/bottomSheetDialogTheme but I’m not 100% sure.

Regarding the edge-to-edge mode, I confirmed that it’s documented that bottom sheet dialog will only make it edge-to-edge when enableEdgeToEdge=true and the navigation bar is translucent: https://github.com/material-components/material-components-android/blob/master/docs/components/BottomSheet.md#handling-insets-and-fullscreen

In other words, clients need to “trigger” edge-to-edge mode by setting navigation bar color to a translucent color. It can be a bit confusing but I think it’s more or less a standard practice.

I’m going to close the issue for now. Let me know if you have more questions. : )

Read more comments on GitHub >

github_iconTop Results From Across the Web

[BottomSheetDialog] Rounded corners in expanded state #1278
Description: BottomSheetDialog has rounded corers only if it's not expanded. Corners are rounded as it's specified in the ShapeAppearance ...
Read more >
Advanced Android Edge-to-Edge (Part 2) - Medium
The solution to this is to modify the layout that BottomSheetDialog wraps around our layout, and also set decorFitsSystemWindows to false on the...
Read more >
BottomSheetDialog remains hidden after dismiss by dragging ...
The problem occurs when the state HIDDEN is reached which happens when the dialog is dismissed by being dragged down. After that the...
Read more >
BottomSheetDialog - Android Developers
BottomSheetDialog (Context context, boolean cancelable, DialogInterface. ... Returns if edge to edge behavior is enabled for this dialog.
Read more >
After last Edge update from past days, wont start anymore
I did do a system restore back a day earlier with Edge v104 which was fine. I was able to reproduce the issue....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found