Fade clock away when transitioning to bouncer.
Bug: 123532425
Test: NotificationPanelViewTest passes
Change-Id: I4fba78362cedf44a596da35107899ba33cf1b361
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 069703e..f4fa1e8 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
@@ -590,11 +590,6 @@
mClockPositionResult.clockX, CLOCK_ANIMATION_PROPERTIES, animateClock);
PropertyAnimator.setProperty(mKeyguardStatusView, AnimatableProperty.Y,
mClockPositionResult.clockY, CLOCK_ANIMATION_PROPERTIES, animateClock);
- // Move big clock up while pulling up the bouncer
- PropertyAnimator.setProperty(mBigClockContainer, AnimatableProperty.Y,
- MathUtils.lerp(-mBigClockContainer.getHeight(), 0,
- Interpolators.FAST_OUT_LINEAR_IN.getInterpolation(getExpandedFraction())),
- CLOCK_ANIMATION_PROPERTIES, animateClock);
updateClock();
stackScrollerPadding = mClockPositionResult.stackScrollerPadding;
}
@@ -1334,8 +1329,7 @@
}
};
- private void setKeyguardBottomAreaVisibility(int statusBarState,
- boolean goingToFullShade) {
+ private void setKeyguardBottomAreaVisibility(int statusBarState, boolean goingToFullShade) {
mKeyguardBottomArea.animate().cancel();
if (goingToFullShade) {
mKeyguardBottomArea.animate()
@@ -1438,6 +1432,7 @@
if (mBarState == StatusBarState.SHADE_LOCKED
|| mBarState == StatusBarState.KEYGUARD) {
updateKeyguardBottomAreaAlpha();
+ updateBigClockAlpha();
}
if (mBarState == StatusBarState.SHADE && mQsExpanded
&& !mStackScrollerOverscrolling && mQsScrimEnabled) {
@@ -1883,6 +1878,19 @@
}
}
+ /**
+ * Custom clock fades away when user drags up to unlock or pulls down quick settings.
+ *
+ * Updates alpha of custom clock to match the alpha of the KeyguardBottomArea. See
+ * {@link updateKeyguardBottomAreaAlpha}.
+ */
+ private void updateBigClockAlpha() {
+ float expansionAlpha = MathUtils.map(isUnlockHintRunning()
+ ? 0 : KeyguardBouncer.ALPHA_EXPANSION_THRESHOLD, 1f, 0f, 1f, getExpandedFraction());
+ float alpha = Math.min(expansionAlpha, 1 - getQsExpansionFraction());
+ mBigClockContainer.setAlpha(alpha);
+ }
+
private float getNotificationsTopY() {
if (mNotificationStackScroller.getNotGoneChildCount() == 0) {
return getExpandedHeight();
@@ -2597,6 +2605,7 @@
}
mNotificationStackScroller.setExpandedHeight(expandedHeight);
updateKeyguardBottomAreaAlpha();
+ updateBigClockAlpha();
updateStatusBarIcons();
}