diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java index 62a217254c407..2592486cde7cf 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java @@ -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(); + } } } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java index aa01bf2488538..f0b78944c1fbc 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java @@ -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) {