Fixed a bug where the wrong number of notifications were visible

Since the calculation of the number of notifications is dynamic now
it strongly depends on the notification min heights which are only
calculated once it is laid out.
This is now properly done.

Bug: 26480961
Change-Id: Ic7b270af826c28b4a9d2c08021605a5c9ae78860
This commit is contained in:
Selim Cinek
2016-01-15 17:17:58 -08:00
parent 7210947e0d
commit 5fbc632fef
2 changed files with 8 additions and 8 deletions

View File

@@ -1265,13 +1265,17 @@ public abstract class BaseStatusBar extends SystemUI implements
}
/**
* Called when the size of the notification panel changes
* Called when the notification panel layouts
*/
public void onPanelHeightChanged() {
public void onPanelLaidOut() {
if (mState == StatusBarState.KEYGUARD) {
// Since the number of notifications is determined based on the height of the view, we
// need to update them.
updateRowStates();
int maxBefore = getMaxKeyguardNotifications(false /* recompute */);
int maxNotifications = getMaxKeyguardNotifications(true /* recompute */);
if (maxBefore != maxNotifications) {
updateRowStates();
}
}
}

View File

@@ -81,7 +81,6 @@ public abstract class PanelView extends FrameLayout {
private boolean mMotionAborted;
private boolean mUpwardsWhenTresholdReached;
private boolean mAnimatingOnDown;
private int mLayoutHeight = 0;
private ValueAnimator mHeightAnimator;
private ObjectAnimator mPeekAnimator;
@@ -715,10 +714,7 @@ public abstract class PanelView extends FrameLayout {
@Override
protected void onLayout (boolean changed, int left, int top, int right, int bottom) {
super.onLayout(changed, left, top, right, bottom);
if (mLayoutHeight != getHeight()) {
mLayoutHeight = getHeight();
mStatusBar.onPanelHeightChanged();
}
mStatusBar.onPanelLaidOut();
requestPanelHeightUpdate();
mHasLayoutedSinceDown = true;
if (mUpdateFlingOnLayout) {