Doze: coordinate keyguard status bar visibility.
Play nice with recent NotificationPanelView changes that also drive its visibility. Bug: 15863249 Change-Id: I60021f415089d5508af7fe9ec792a2871a52910d
This commit is contained in:
@@ -93,6 +93,8 @@ public class NotificationPanelView extends PanelView implements
|
||||
private boolean mQsExpandedWhenExpandingStarted;
|
||||
private boolean mQsFullyExpanded;
|
||||
private boolean mKeyguardShowing;
|
||||
private boolean mDozing;
|
||||
private boolean mKeyguardStatusBarTransparent;
|
||||
private int mStatusBarState;
|
||||
private float mInitialHeightOnTouch;
|
||||
private float mInitialTouchX;
|
||||
@@ -897,10 +899,9 @@ public class NotificationPanelView extends PanelView implements
|
||||
alpha *= 2;
|
||||
alpha = Math.min(1, alpha);
|
||||
alpha = 1 - alpha;
|
||||
if (alpha == 0f) {
|
||||
mKeyguardStatusBar.setVisibility(View.INVISIBLE);
|
||||
} else {
|
||||
mKeyguardStatusBar.setVisibility(View.VISIBLE);
|
||||
mKeyguardStatusBarTransparent = alpha == 0f;
|
||||
updateKeyguardStatusBarVisibility();
|
||||
if (!mKeyguardStatusBarTransparent) {
|
||||
mKeyguardStatusBar.setAlpha(alpha);
|
||||
}
|
||||
}
|
||||
@@ -1598,4 +1599,20 @@ public class NotificationPanelView extends PanelView implements
|
||||
private static float interpolate(float t, float start, float end) {
|
||||
return (1 - t) * start + t * end;
|
||||
}
|
||||
|
||||
private void updateKeyguardStatusBarVisibility() {
|
||||
mKeyguardStatusBar.setVisibility(mKeyguardShowing && !mKeyguardStatusBarTransparent
|
||||
&& !mDozing ? VISIBLE : INVISIBLE);
|
||||
}
|
||||
|
||||
public void setDozing(boolean dozing) {
|
||||
if (dozing == mDozing) return;
|
||||
mDozing = dozing;
|
||||
if (mDozing) {
|
||||
setBackgroundColor(0xff000000);
|
||||
} else {
|
||||
setBackground(null);
|
||||
}
|
||||
updateKeyguardStatusBarVisibility();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3434,15 +3434,12 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
|
||||
if (mState != StatusBarState.KEYGUARD) {
|
||||
return;
|
||||
}
|
||||
mNotificationPanel.setDozing(mDozing);
|
||||
if (mDozing) {
|
||||
mNotificationPanel.setBackgroundColor(0xff000000);
|
||||
mKeyguardStatusBar.setVisibility(View.INVISIBLE);
|
||||
mKeyguardBottomArea.setVisibility(View.INVISIBLE);
|
||||
mStackScroller.setDark(true, false /*animate*/);
|
||||
} else {
|
||||
mNotificationPanel.setBackground(null);
|
||||
mKeyguardStatusBar.setVisibility(View.VISIBLE);
|
||||
mKeyguardBottomArea.setVisibility(View.VISIBLE);
|
||||
mKeyguardBottomArea.setVisibility(View.VISIBLE);
|
||||
mStackScroller.setDark(false, false /*animate*/);
|
||||
}
|
||||
mScrimController.setDozing(mDozing);
|
||||
|
||||
Reference in New Issue
Block a user