Merge "Hide keyguard bottom area when SHADE_LOCKED" into qt-dev

am: e05421a8f3

Change-Id: I7918a0a3d462012d3c7d5d7469061de15733d128
This commit is contained in:
Lucas Dupin
2019-06-06 15:04:17 -07:00
committed by android-build-merger

View File

@@ -304,6 +304,8 @@ public class NotificationPanelView extends PanelView implements
private int mCurrentPanelAlpha; private int mCurrentPanelAlpha;
private final Paint mAlphaPaint = new Paint(); private final Paint mAlphaPaint = new Paint();
private Runnable mPanelAlphaEndAction; private Runnable mPanelAlphaEndAction;
private float mBottomAreaShadeAlpha;
private final ValueAnimator mBottomAreaShadeAlphaAnimator;
private AnimatorListenerAdapter mAnimatorListenerAdapter = new AnimatorListenerAdapter() { private AnimatorListenerAdapter mAnimatorListenerAdapter = new AnimatorListenerAdapter() {
@Override @Override
public void onAnimationEnd(Animator animation) { public void onAnimationEnd(Animator animation) {
@@ -372,6 +374,14 @@ public class NotificationPanelView extends PanelView implements
mThemeResId = context.getThemeResId(); mThemeResId = context.getThemeResId();
mKeyguardBypassController = bypassController; mKeyguardBypassController = bypassController;
dynamicPrivacyController.addListener(this); dynamicPrivacyController.addListener(this);
mBottomAreaShadeAlphaAnimator = ValueAnimator.ofFloat(1f, 0);
mBottomAreaShadeAlphaAnimator.addUpdateListener(animation -> {
mBottomAreaShadeAlpha = (float) animation.getAnimatedValue();
updateKeyguardBottomAreaAlpha();
});
mBottomAreaShadeAlphaAnimator.setDuration(160);
mBottomAreaShadeAlphaAnimator.setInterpolator(Interpolators.ALPHA_OUT);
} }
/** /**
@@ -1382,10 +1392,20 @@ public class NotificationPanelView extends PanelView implements
updateDozingVisibilities(false /* animate */); updateDozingVisibilities(false /* animate */);
} }
maybeAnimateBottomAreaAlpha();
resetHorizontalPanelPosition(); resetHorizontalPanelPosition();
updateQsState(); updateQsState();
} }
private void maybeAnimateBottomAreaAlpha() {
mBottomAreaShadeAlphaAnimator.cancel();
if (mBarState == StatusBarState.SHADE_LOCKED) {
mBottomAreaShadeAlphaAnimator.start();
} else {
mBottomAreaShadeAlpha = 1f;
}
}
private final Runnable mAnimateKeyguardStatusViewInvisibleEndRunnable = new Runnable() { private final Runnable mAnimateKeyguardStatusViewInvisibleEndRunnable = new Runnable() {
@Override @Override
public void run() { public void run() {
@@ -1992,6 +2012,7 @@ public class NotificationPanelView extends PanelView implements
? 0 : KeyguardBouncer.ALPHA_EXPANSION_THRESHOLD, 1f, ? 0 : KeyguardBouncer.ALPHA_EXPANSION_THRESHOLD, 1f,
0f, 1f, getExpandedFraction()); 0f, 1f, getExpandedFraction());
float alpha = Math.min(expansionAlpha, 1 - getQsExpansionFraction()); float alpha = Math.min(expansionAlpha, 1 - getQsExpansionFraction());
alpha *= mBottomAreaShadeAlpha;
mKeyguardBottomArea.setAffordanceAlpha(alpha); mKeyguardBottomArea.setAffordanceAlpha(alpha);
mKeyguardBottomArea.setImportantForAccessibility(alpha == 0f mKeyguardBottomArea.setImportantForAccessibility(alpha == 0f
? IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS ? IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS
@@ -2902,6 +2923,10 @@ public class NotificationPanelView extends PanelView implements
mNotificationStackScroller.setDozing(mDozing, animate, wakeUpTouchLocation); mNotificationStackScroller.setDozing(mDozing, animate, wakeUpTouchLocation);
mKeyguardBottomArea.setDozing(mDozing, animate); mKeyguardBottomArea.setDozing(mDozing, animate);
if (dozing) {
mBottomAreaShadeAlphaAnimator.cancel();
}
if (mBarState == StatusBarState.KEYGUARD if (mBarState == StatusBarState.KEYGUARD
|| mBarState == StatusBarState.SHADE_LOCKED) { || mBarState == StatusBarState.SHADE_LOCKED) {
updateDozingVisibilities(animate); updateDozingVisibilities(animate);