diff options
| author | Jorim Jaggi <jjaggi@google.com> | 2014-07-04 18:05:06 +0200 |
|---|---|---|
| committer | Jorim Jaggi <jjaggi@google.com> | 2014-07-05 02:37:40 +0000 |
| commit | ad46ffef4b88e533cc2e67f132b74d1b90df72df (patch) | |
| tree | f1a4629620644a1b96f8df9c56d5fd1281f1ed12 | |
| parent | 4ab7606f325dd5150a635b536b78028b77b2c2da (diff) | |
| download | frameworks_base-ad46ffef4b88e533cc2e67f132b74d1b90df72df.zip frameworks_base-ad46ffef4b88e533cc2e67f132b74d1b90df72df.tar.gz frameworks_base-ad46ffef4b88e533cc2e67f132b74d1b90df72df.tar.bz2 | |
Fix blinking bug when no notifications on lockscreen.
Bug: 16044775
Change-Id: Ia8b23e8ce93194d86eb4cb809f44f8caa277550e
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java index 4e2cb00..c9606ca 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java @@ -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(); |
