Merge "Hide keyguard bottom area when SHADE_LOCKED" into qt-dev am: e05421a8f3
am: f535c5cbd5
Change-Id: If26a2da70d853e4892a06a170f8d416ccf8f859e
This commit is contained in:
@@ -304,6 +304,8 @@ public class NotificationPanelView extends PanelView implements
|
||||
private int mCurrentPanelAlpha;
|
||||
private final Paint mAlphaPaint = new Paint();
|
||||
private Runnable mPanelAlphaEndAction;
|
||||
private float mBottomAreaShadeAlpha;
|
||||
private final ValueAnimator mBottomAreaShadeAlphaAnimator;
|
||||
private AnimatorListenerAdapter mAnimatorListenerAdapter = new AnimatorListenerAdapter() {
|
||||
@Override
|
||||
public void onAnimationEnd(Animator animation) {
|
||||
@@ -372,6 +374,14 @@ public class NotificationPanelView extends PanelView implements
|
||||
mThemeResId = context.getThemeResId();
|
||||
mKeyguardBypassController = bypassController;
|
||||
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 */);
|
||||
}
|
||||
|
||||
maybeAnimateBottomAreaAlpha();
|
||||
resetHorizontalPanelPosition();
|
||||
updateQsState();
|
||||
}
|
||||
|
||||
private void maybeAnimateBottomAreaAlpha() {
|
||||
mBottomAreaShadeAlphaAnimator.cancel();
|
||||
if (mBarState == StatusBarState.SHADE_LOCKED) {
|
||||
mBottomAreaShadeAlphaAnimator.start();
|
||||
} else {
|
||||
mBottomAreaShadeAlpha = 1f;
|
||||
}
|
||||
}
|
||||
|
||||
private final Runnable mAnimateKeyguardStatusViewInvisibleEndRunnable = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
@@ -1992,6 +2012,7 @@ public class NotificationPanelView extends PanelView implements
|
||||
? 0 : KeyguardBouncer.ALPHA_EXPANSION_THRESHOLD, 1f,
|
||||
0f, 1f, getExpandedFraction());
|
||||
float alpha = Math.min(expansionAlpha, 1 - getQsExpansionFraction());
|
||||
alpha *= mBottomAreaShadeAlpha;
|
||||
mKeyguardBottomArea.setAffordanceAlpha(alpha);
|
||||
mKeyguardBottomArea.setImportantForAccessibility(alpha == 0f
|
||||
? IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS
|
||||
@@ -2902,6 +2923,10 @@ public class NotificationPanelView extends PanelView implements
|
||||
mNotificationStackScroller.setDozing(mDozing, animate, wakeUpTouchLocation);
|
||||
mKeyguardBottomArea.setDozing(mDozing, animate);
|
||||
|
||||
if (dozing) {
|
||||
mBottomAreaShadeAlphaAnimator.cancel();
|
||||
}
|
||||
|
||||
if (mBarState == StatusBarState.KEYGUARD
|
||||
|| mBarState == StatusBarState.SHADE_LOCKED) {
|
||||
updateDozingVisibilities(animate);
|
||||
|
||||
Reference in New Issue
Block a user