Fixed a bug with the animation of the notification background

The position of the background could be 0 and therefore the
background could fly over the whole screen.
We're now positioning the top section at the start
of the first visible section.

Fixes: 137885070
Test: atest SystemUiTests
Change-Id: I6720b570f5cd209249b90681cdf6c6a56cf0194e
This commit is contained in:
Selim Cinek
2019-07-19 17:30:16 -07:00
parent 4bdeefacba
commit 893a9dfa10

View File

@@ -2516,12 +2516,20 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd
}
return;
}
int minTopPosition = 0;
int minTopPosition;
NotificationSection lastSection = getLastVisibleSection();
if (mStatusBarState != StatusBarState.KEYGUARD) {
minTopPosition = (int) (mTopPadding + mStackTranslation);
} else if (lastSection == null) {
minTopPosition = mTopPadding;
} else {
// The first sections could be empty while there could still be elements in later
// sections. The position of these first few sections is determined by the position of
// the first visible section.
NotificationSection firstVisibleSection = getFirstVisibleSection();
firstVisibleSection.updateBounds(0 /* minTopPosition*/, 0 /* minBottomPosition */,
false /* shiftPulsingWithFirst */);
minTopPosition = firstVisibleSection.getBounds().top;
}
boolean shiftPulsingWithFirst = mAmbientPulseManager.getAllEntries().count() <= 1;
for (NotificationSection section : mSections) {