From 43c09a9e92e6a751b52b1091e60c32b986f9d8b5 Mon Sep 17 00:00:00 2001 From: Evan Laird Date: Tue, 6 Mar 2018 09:46:49 -0500 Subject: [PATCH] Fix extra padding when there are no static notification dots The logic now mimics the visual overflow logic such that when the non-static notification icon container gets a virtual end-of-layout, but that layout has no dots, then it adds the correct amount of padding to handle the max number of BTW notifications Test: add 3 min priority notifications when there is one regular notification. Pulling the shade shouldn't collapse the regular notification icon Bug: 73487572 Change-Id: I77cc3821f7c93a5ba88d1419fb5594ccd9e1616d --- .../systemui/statusbar/phone/NotificationIconContainer.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationIconContainer.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationIconContainer.java index 5479dd80fded2..b29ac9067556a 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationIconContainer.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationIconContainer.java @@ -525,7 +525,7 @@ public class NotificationIconContainer extends AlphaOptimizedFrameLayout { return 0; } - int partialOverflowAmount = (MAX_DOTS - mNumDots) * (mStaticDotRadius * 2 + mDotPadding); + int partialOverflowAmount = (MAX_DOTS - mNumDots) * (mStaticDotDiameter + mDotPadding); int adjustedWidth = getFinalTranslationX() + partialOverflowAmount; // In case we actually give too much padding... @@ -542,7 +542,7 @@ public class NotificationIconContainer extends AlphaOptimizedFrameLayout { return 0; } - int collapsedPadding = (int) ((1.0f + OVERFLOW_EARLY_AMOUNT) * getIconSize()); + int collapsedPadding = mIconSize + 2 * (mStaticDotDiameter + mDotPadding); if (collapsedPadding + getFinalTranslationX() > getWidth()) { collapsedPadding = getWidth() - getFinalTranslationX();