From d381bc31336dbd0ac12152d76275688dea157e79 Mon Sep 17 00:00:00 2001 From: Selim Cinek Date: Mon, 15 Aug 2016 12:40:57 -0700 Subject: Fixed an issue where the background could show in a wrong way Change-Id: Icefeb2275d6cbabc576c35990ce4441b3a41ebd9 Fixes: 30855224 --- .../statusbar/stack/NotificationStackScrollLayout.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java b/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java index f72e50beec10..119d855c8eaa 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java @@ -412,7 +412,10 @@ public class NotificationStackScrollLayout extends ViewGroup @Override protected void onDraw(Canvas canvas) { - canvas.drawRect(0, mCurrentBounds.top, getWidth(), mCurrentBounds.bottom, mBackgroundPaint); + if (mCurrentBounds.top < mCurrentBounds.bottom) { + canvas.drawRect(0, mCurrentBounds.top, getWidth(), mCurrentBounds.bottom, + mBackgroundPaint); + } if (DEBUG) { int y = mTopPadding; canvas.drawLine(0, y, getWidth(), y, mDebugPaint); @@ -2013,11 +2016,12 @@ public class NotificationStackScrollLayout extends ViewGroup bottom = top; } if (mPhoneStatusBar.getBarState() != StatusBarState.KEYGUARD) { - mBackgroundBounds.top = (int) Math.max(mTopPadding + mStackTranslation, top); + top = (int) Math.max(mTopPadding + mStackTranslation, top); } else { // otherwise the animation from the shade to the keyguard will jump as it's maxed - mBackgroundBounds.top = Math.max(0, top); + top = Math.max(0, top); } + mBackgroundBounds.top = top; mBackgroundBounds.bottom = Math.min(getHeight(), Math.max(bottom, top)); } -- cgit v1.2.3-59-g8ed1b