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

Commit ad46ffef authored by Jorim Jaggi's avatar Jorim Jaggi
Browse files

Fix blinking bug when no notifications on lockscreen.

Bug: 16044775
Change-Id: Ia8b23e8ce93194d86eb4cb809f44f8caa277550e
parent 4ab7606f
Loading
Loading
Loading
Loading
+11 −6
Original line number Diff line number Diff line
@@ -903,10 +903,8 @@ public class NotificationPanelView extends PanelView implements
        }
    }
    private void updateNotificationTranslucency() {
        float alpha = (mNotificationStackScroller.getNotificationsTopY()
                + mNotificationStackScroller.getItemHeight())
                / (mQsMinExpansionHeight
                        + mNotificationStackScroller.getItemHeight() / 2);
        float alpha = (getNotificationsTopY() + mNotificationStackScroller.getItemHeight())
                / (mQsMinExpansionHeight + mNotificationStackScroller.getItemHeight() / 2);
        alpha = Math.max(0, Math.min(alpha, 1));
        alpha = (float) Math.pow(alpha, 0.75);

@@ -989,7 +987,7 @@ public class NotificationPanelView extends PanelView implements

            // When on Keyguard, we hide the header as soon as the top card of the notification
            // stack scroller is close enough (collision distance) to the bottom of the header.
            alpha = mNotificationStackScroller.getNotificationsTopY()
            alpha = getNotificationsTopY()
                    /
                    (mQsMinExpansionHeight + mNotificationsHeaderCollideDistance);

@@ -997,7 +995,7 @@ public class NotificationPanelView extends PanelView implements

            // In SHADE_LOCKED, the top card is already really close to the header. Hide it as
            // soon as we start translating the stack.
            alpha = mNotificationStackScroller.getNotificationsTopY() / mQsMinExpansionHeight;
            alpha = getNotificationsTopY() / mQsMinExpansionHeight;
        }
        alpha = Math.max(0, Math.min(alpha, 1));
        alpha = (float) Math.pow(alpha, 0.75);
@@ -1006,6 +1004,13 @@ public class NotificationPanelView extends PanelView implements
        setQsTranslation(mQsExpansionHeight);
    }

    private float getNotificationsTopY() {
        if (mNotificationStackScroller.getNotGoneChildCount() == 0) {
            return getExpandedHeight();
        }
        return mNotificationStackScroller.getNotificationsTopY();
    }

    @Override
    protected void onExpandingStarted() {
        super.onExpandingStarted();