Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5fbc632f authored by Selim Cinek's avatar Selim Cinek
Browse files

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
parent 7210947e
Loading
Loading
Loading
Loading
+7 −3
Original line number Original line Diff line number Diff line
@@ -1265,15 +1265,19 @@ 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) {
        if (mState == StatusBarState.KEYGUARD) {
            // Since the number of notifications is determined based on the height of the view, we
            // Since the number of notifications is determined based on the height of the view, we
            // need to update them.
            // need to update them.
            int maxBefore = getMaxKeyguardNotifications(false /* recompute */);
            int maxNotifications = getMaxKeyguardNotifications(true /* recompute */);
            if (maxBefore != maxNotifications) {
                updateRowStates();
                updateRowStates();
            }
            }
        }
        }
    }


    @Override
    @Override
    public void onExpandClicked(Entry clickedEntry, boolean nowExpanded) {
    public void onExpandClicked(Entry clickedEntry, boolean nowExpanded) {
+1 −5
Original line number Original line Diff line number Diff line
@@ -81,7 +81,6 @@ public abstract class PanelView extends FrameLayout {
    private boolean mMotionAborted;
    private boolean mMotionAborted;
    private boolean mUpwardsWhenTresholdReached;
    private boolean mUpwardsWhenTresholdReached;
    private boolean mAnimatingOnDown;
    private boolean mAnimatingOnDown;
    private int mLayoutHeight = 0;


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