Merge "Hide keyguard bottom area when SHADE_LOCKED" into qt-dev
This commit is contained in:
@@ -303,6 +303,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) {
|
||||||
@@ -366,6 +368,14 @@ public class NotificationPanelView extends PanelView implements
|
|||||||
mPulseExpansionHandler = pulseExpansionHandler;
|
mPulseExpansionHandler = pulseExpansionHandler;
|
||||||
mThemeResId = context.getThemeResId();
|
mThemeResId = context.getThemeResId();
|
||||||
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1368,10 +1378,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() {
|
||||||
@@ -1980,6 +2000,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
|
||||||
@@ -2890,6 +2911,10 @@ public class NotificationPanelView extends PanelView implements
|
|||||||
mNotificationStackScroller.setDark(mDozing, animate, wakeUpTouchLocation);
|
mNotificationStackScroller.setDark(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);
|
||||||
|
|||||||
Reference in New Issue
Block a user