Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0e4e9c6f authored by burakov's avatar burakov Committed by Danny Burakov
Browse files

[Dual Shade] Fix missing padding above the shade on some wide screens.

For some unknown reason, on certain devices the top padding returned by
`WindowInsets.systemBarsIgnoringVisibility` is 0, even though the status
bar height is a positive value. This CL adds a separate check for status
bar height to compensate for this.

Fix: 391380435
Bug: 412969642
Test: Tested manually by opening the shade on an unfolded device where
 padding top was previously not applied.
Test: Unit tests still pass.
Flag: com.android.systemui.scene_container
Change-Id: I201742af36fb4af1c8db5737df0c5e7fae07f256
parent a509af7b
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -150,12 +150,17 @@ private fun Modifier.panelContainerPadding(isFullWidthPanel: Boolean): Modifier
        return this
    }
    val systemBars = WindowInsets.systemBarsIgnoringVisibility
    // TODO(b/412969642): The systemBars check above reports a top padding of 0 on some devices,
    //  for an unknown reason. This additional check for status bar height specifically is added
    //  here to work around that issue.
    val statusBarHeight = PaddingValues(top = dimensionResource(R.dimen.status_bar_height))
    val displayCutout = WindowInsets.displayCutout
    val waterfall = WindowInsets.waterfall
    val horizontalPadding =
        PaddingValues(horizontal = dimensionResource(id = R.dimen.shade_panel_margin_horizontal))
        PaddingValues(horizontal = dimensionResource(R.dimen.shade_panel_margin_horizontal))
    return padding(
        combinePaddings(
            statusBarHeight,
            systemBars.asPaddingValues(),
            displayCutout.asPaddingValues(),
            waterfall.asPaddingValues(),