diff options
| author | 2020-03-17 14:02:57 +0800 | |
|---|---|---|
| committer | 2020-03-17 14:47:25 +0800 | |
| commit | 6aa582a731a1afa37454f6d914f174b4fd9bce4c (patch) | |
| tree | b940e6364f95babc978f927a22c21c81e1896eab | |
| parent | 6a10fea45771f5f563eed7f9713c89b9defb60b3 (diff) | |
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
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java b/packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java index d422dd7f4175..11b625f41737 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java +++ b/packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java @@ -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); } |