Fix fake status bar not visible in SHADE_LOCKED state.
Bug: 15393127
Change-Id: I535b275acd3070121c03425bd8d7c768f0a995f2
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 7fc7cdb..31bc130 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
@@ -242,8 +242,8 @@
mClockAnimator.removeAllListeners();
mClockAnimator.cancel();
}
- mClockAnimator =
- ObjectAnimator.ofFloat(mKeyguardStatusView, View.Y, mClockAnimationTarget);
+ mClockAnimator = ObjectAnimator
+ .ofFloat(mKeyguardStatusView, View.Y, mClockAnimationTarget);
mClockAnimator.setInterpolator(mFastOutSlowInInterpolator);
mClockAnimator.setDuration(StackStateAnimator.ANIMATION_DURATION_STANDARD);
mClockAnimator.addListener(new AnimatorListenerAdapter() {
@@ -548,9 +548,7 @@
mHeader.setExpanded(expandVisually, mStackScrollerOverscrolling);
mNotificationStackScroller.setEnabled(!mQsExpanded);
mQsPanel.setVisibility(expandVisually ? View.VISIBLE : View.INVISIBLE);
- mQsContainer.setVisibility(mKeyguardShowing && !mQsExpanded
- ? View.INVISIBLE
- : View.VISIBLE);
+ mQsContainer.setVisibility(mKeyguardShowing && !mQsExpanded ? View.INVISIBLE : View.VISIBLE);
mScrollView.setTouchEnabled(mQsExpanded);
}
@@ -728,8 +726,20 @@
private void updateKeyguardHeaderVisibility() {
if (mStatusBar.getBarState() == StatusBarState.KEYGUARD
|| mStatusBar.getBarState() == StatusBarState.SHADE_LOCKED) {
- boolean hidden = mNotificationStackScroller.getNotificationsTopY()
- <= mHeader.getBottom() + mNotificationsHeaderCollideDistance;
+ boolean hidden;
+ if (mStatusBar.getBarState() == StatusBarState.KEYGUARD) {
+
+ // 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.
+ hidden = mNotificationStackScroller.getNotificationsTopY()
+ <= mHeader.getBottom() + mNotificationsHeaderCollideDistance;
+ } else {
+
+ // In SHADE_LOCKED, the top card is already really close to the header. Hide it as
+ // soon as we start translating the stack.
+ hidden = mNotificationStackScroller.getTranslationY() < 0;
+ }
+
if (hidden && !mHeaderHidden) {
mHeader.animate()
.alpha(0f)