From 6aa582a731a1afa37454f6d914f174b4fd9bce4c Mon Sep 17 00:00:00 2001 From: shawnlin Date: Tue, 17 Mar 2020 14:02:57 +0800 Subject: 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 --- .../src/com/android/systemui/qs/QuickStatusBarHeader.java | 11 +++++++++-- 1 file 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 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); } -- cgit v1.2.3-59-g8ed1b