From 3a2a2e2da08b0f9b0d6682f9997a8ea33384d469 Mon Sep 17 00:00:00 2001 From: shawnlin Date: Fri, 4 May 2018 17:09:50 +0800 Subject: [PATCH] Fix incorrect background bounds set by stackscroll view Even if the stackscroll view is the same width as notification panel view, it doesn't guarantee the left position is 0 in window(when nav bar is on the left side). Always use location in window to set the left position instead. Test: runtest systemui Test: manual 1) change display size to largest 2) rotate to landscape 3) expand notification panel and check Fixes: 74988082 Change-Id: I06641c145365e315192e0b2b6c44d075a3016733 --- .../stack/NotificationStackScrollLayout.java | 14 ++++---------- 1 file changed, 4 insertions(+), 10 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 5275e27a2c5ae..7370c4c1c0d1f 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java @@ -2415,16 +2415,10 @@ public class NotificationStackScrollLayout extends ViewGroup * Update the background bounds to the new desired bounds */ private void updateBackgroundBounds() { - if (mAmbientState.isPanelFullWidth()) { - mBackgroundBounds.left = 0; - mBackgroundBounds.right = getWidth(); - } else { - getLocationInWindow(mTempInt2); - mBackgroundBounds.left = mTempInt2[0]; - mBackgroundBounds.right = mTempInt2[0] + getWidth(); - } - mBackgroundBounds.left += mSidePaddings; - mBackgroundBounds.right -= mSidePaddings; + getLocationInWindow(mTempInt2); + mBackgroundBounds.left = mTempInt2[0] + mSidePaddings; + mBackgroundBounds.right = mTempInt2[0] + getWidth() - mSidePaddings; + if (!mIsExpanded) { mBackgroundBounds.top = 0; mBackgroundBounds.bottom = 0;