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

Commit 6aa582a7 authored by shawnlin's avatar shawnlin
Browse files

Fixed wrong QS padding

The QuickStatusBarHeader padding should be set to rounded corner padding.

The SystemIconsView padding should be set to (cutout padding - rounded
corner padding) and if the rounded corner padding is greater than the
cutout padding which means we already padding enough, the padding should be 0.

Fixes: 151433097
Test: atest SystemUITests
Test: manual set corner cutout and expand qs panel
Change-Id: I2569d8b84e36db262426df4a3ae0708bb3a0df64
parent 6a10fea4
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -436,6 +436,10 @@ public class QuickStatusBarHeader extends RelativeLayout implements

    @Override
    public WindowInsets onApplyWindowInsets(WindowInsets insets) {
        // Handle padding of QuickStatusBarHeader
        setPadding(mRoundedCornerPadding, getPaddingTop(), mRoundedCornerPadding,
                getPaddingBottom());

        // Handle padding of SystemIconsView
        DisplayCutout cutout = insets.getDisplayCutout();
        Pair<Integer, Integer> cornerCutoutPadding = StatusBarWindowView.cornerCutoutMargins(
@@ -450,8 +454,11 @@ public class QuickStatusBarHeader extends RelativeLayout implements
        int statusBarPaddingRight = isLayoutRtl()
                ? getResources().getDimensionPixelSize(R.dimen.status_bar_padding_start)
                : getResources().getDimensionPixelSize(R.dimen.status_bar_padding_end);
        mSystemIconsView.setPadding(padding.first + statusBarPaddingLeft, waterfallTopInset,
                padding.second + statusBarPaddingRight, 0);
        mSystemIconsView.setPadding(
                Math.max(padding.first + statusBarPaddingLeft - mRoundedCornerPadding, 0),
                waterfallTopInset,
                Math.max(padding.second + statusBarPaddingRight - mRoundedCornerPadding, 0),
                0);

        return super.onApplyWindowInsets(insets);
    }