Merge "Hide status bar in bouncer"
This commit is contained in:
@@ -18,7 +18,7 @@
|
||||
-->
|
||||
|
||||
<set xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:detachWallpaper="true" android:shareInterpolator="false" android:startOffset="60">
|
||||
android:detachWallpaper="true" android:shareInterpolator="false" android:startOffset="100">
|
||||
<alpha
|
||||
android:fromAlpha="0.0" android:toAlpha="1.0"
|
||||
android:fillEnabled="true" android:fillBefore="true"
|
||||
|
||||
@@ -82,7 +82,6 @@ import android.view.ViewGroup;
|
||||
import android.view.ViewGroup.LayoutParams;
|
||||
import android.view.ViewPropertyAnimator;
|
||||
import android.view.ViewStub;
|
||||
import android.view.ViewTreeObserver;
|
||||
import android.view.WindowManager;
|
||||
import android.view.animation.AccelerateInterpolator;
|
||||
import android.view.animation.Animation;
|
||||
@@ -262,6 +261,10 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
|
||||
boolean mLeaveOpenOnKeyguardHide;
|
||||
KeyguardIndicationController mKeyguardIndicationController;
|
||||
|
||||
private boolean mKeyguardFadingAway;
|
||||
private long mKeyguardFadingAwayDelay;
|
||||
private long mKeyguardFadingAwayDuration;
|
||||
|
||||
int mKeyguardMaxNotificationCount;
|
||||
View mDateTimeView;
|
||||
|
||||
@@ -401,7 +404,9 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
|
||||
private boolean mSettingsCancelled;
|
||||
private boolean mSettingsClosing;
|
||||
private boolean mVisible;
|
||||
private boolean mWaitingForKeyguardExit;
|
||||
|
||||
private Interpolator mLinearOutSlowIn;
|
||||
private Interpolator mAlphaOut = new PathInterpolator(0f, 0.4f, 1f, 1f);
|
||||
private Interpolator mAlphaIn = new PathInterpolator(0f, 0f, 0.8f, 1f);
|
||||
|
||||
@@ -1457,7 +1462,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
|
||||
}
|
||||
|
||||
private int adjustDisableFlags(int state) {
|
||||
if (mExpandedVisible) {
|
||||
if (mExpandedVisible || mBouncerShowing || mWaitingForKeyguardExit) {
|
||||
state |= StatusBarManager.DISABLE_NOTIFICATION_ICONS;
|
||||
state |= StatusBarManager.DISABLE_SYSTEM_INFO;
|
||||
}
|
||||
@@ -1505,19 +1510,9 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
|
||||
if ((diff & StatusBarManager.DISABLE_SYSTEM_INFO) != 0) {
|
||||
mSystemIconArea.animate().cancel();
|
||||
if ((state & StatusBarManager.DISABLE_SYSTEM_INFO) != 0) {
|
||||
mSystemIconArea.animate()
|
||||
.alpha(0f)
|
||||
.withLayer()
|
||||
.setDuration(160)
|
||||
.setInterpolator(mAlphaIn)
|
||||
.setListener(mMakeIconsInvisible);
|
||||
animateStatusBarHide(mSystemIconArea);
|
||||
} else {
|
||||
mSystemIconArea.setVisibility(View.VISIBLE);
|
||||
mSystemIconArea.animate()
|
||||
.alpha(1f)
|
||||
.withLayer()
|
||||
.setInterpolator(mAlphaOut)
|
||||
.setDuration(320);
|
||||
animateStatusBarShow(mSystemIconArea);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1550,25 +1545,48 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
|
||||
if (mTicking) {
|
||||
haltTicker();
|
||||
}
|
||||
|
||||
mNotificationIcons.animate()
|
||||
.alpha(0f)
|
||||
.withLayer()
|
||||
.setDuration(160)
|
||||
.setInterpolator(mAlphaIn)
|
||||
.setListener(mMakeIconsInvisible)
|
||||
.start();
|
||||
animateStatusBarHide(mNotificationIcons);
|
||||
} else {
|
||||
mNotificationIcons.setVisibility(View.VISIBLE);
|
||||
mNotificationIcons.animate()
|
||||
.alpha(1f)
|
||||
.withLayer()
|
||||
.setInterpolator(mAlphaOut)
|
||||
.setDuration(320);
|
||||
animateStatusBarShow(mNotificationIcons);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Animates {@code v}, a view that is part of the status bar, out.
|
||||
*/
|
||||
private void animateStatusBarHide(View v) {
|
||||
v.animate()
|
||||
.alpha(0f)
|
||||
.withLayer()
|
||||
.setDuration(160)
|
||||
.setInterpolator(mAlphaIn)
|
||||
.setStartDelay(0)
|
||||
.setListener(mMakeIconsInvisible)
|
||||
.start();
|
||||
}
|
||||
|
||||
/**
|
||||
* Animates {@code v}, a view that is part of the status bar, in.
|
||||
*/
|
||||
private void animateStatusBarShow(View v) {
|
||||
v.setVisibility(View.VISIBLE);
|
||||
v.animate()
|
||||
.alpha(1f)
|
||||
.withLayer()
|
||||
.setInterpolator(mAlphaOut)
|
||||
.setDuration(320)
|
||||
.setStartDelay(0);
|
||||
|
||||
// Synchronize the motion with the Keyguard fading if necessary.
|
||||
if (mKeyguardFadingAway) {
|
||||
v.animate()
|
||||
.setDuration(mKeyguardFadingAwayDuration)
|
||||
.setInterpolator(mLinearOutSlowIn)
|
||||
.setStartDelay(mKeyguardFadingAwayDelay);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BaseStatusBar.H createHandler() {
|
||||
return new PhoneStatusBar.H();
|
||||
@@ -1670,6 +1688,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
|
||||
mStatusBarWindowManager.setStatusBarExpanded(true);
|
||||
|
||||
visibilityChanged(true);
|
||||
mWaitingForKeyguardExit = false;
|
||||
disable(mDisabledUnmodified);
|
||||
setInteracting(StatusBarManager.WINDOW_STATUS_BAR, true);
|
||||
}
|
||||
@@ -1863,8 +1882,8 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
|
||||
}
|
||||
|
||||
setInteracting(StatusBarManager.WINDOW_STATUS_BAR, false);
|
||||
disable(mDisabledUnmodified);
|
||||
showBouncer();
|
||||
disable(mDisabledUnmodified);
|
||||
}
|
||||
|
||||
public boolean interceptTouchEvent(MotionEvent event) {
|
||||
@@ -2578,6 +2597,8 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
|
||||
if (mQSPanel != null) mQSPanel.updateResources();
|
||||
|
||||
loadDimens();
|
||||
mLinearOutSlowIn = AnimationUtils.loadInterpolator(
|
||||
mContext, android.R.interpolator.linear_out_slow_in);
|
||||
}
|
||||
|
||||
protected void loadDimens() {
|
||||
@@ -2905,6 +2926,27 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
|
||||
updateKeyguardState();
|
||||
}
|
||||
|
||||
/**
|
||||
* Notifies the status bar the Keyguard is fading away with the specified timings.
|
||||
*
|
||||
* @param delay the animation delay in miliseconds
|
||||
* @param fadeoutDuration the duration of the exit animation, in milliseconds
|
||||
*/
|
||||
public void setKeyguardFadingAway(long delay, long fadeoutDuration) {
|
||||
mKeyguardFadingAway = true;
|
||||
mKeyguardFadingAwayDelay = delay;
|
||||
mKeyguardFadingAwayDuration = fadeoutDuration;
|
||||
mWaitingForKeyguardExit = false;
|
||||
disable(mDisabledUnmodified);
|
||||
}
|
||||
|
||||
/**
|
||||
* Notifies that the Keyguard fading away animation is done.
|
||||
*/
|
||||
public void finishKeyguardFadingAway() {
|
||||
mKeyguardFadingAway = false;
|
||||
}
|
||||
|
||||
private void updatePublicMode() {
|
||||
setLockscreenPublicMode(
|
||||
(mStatusBarKeyguardViewManager.isShowing() ||
|
||||
@@ -2981,6 +3023,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
|
||||
|
||||
private void showBouncer() {
|
||||
if (mState == StatusBarState.KEYGUARD || mState == StatusBarState.SHADE_LOCKED) {
|
||||
mWaitingForKeyguardExit = true;
|
||||
mStatusBarKeyguardViewManager.dismiss();
|
||||
}
|
||||
}
|
||||
@@ -3131,6 +3174,12 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
|
||||
mSystemIconArea.addView(mSystemIcons, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBouncerShowing(boolean bouncerShowing) {
|
||||
super.setBouncerShowing(bouncerShowing);
|
||||
disable(mDisabledUnmodified);
|
||||
}
|
||||
|
||||
public void onScreenTurnedOff() {
|
||||
mStackScroller.setAnimationsEnabled(false);
|
||||
}
|
||||
|
||||
@@ -190,19 +190,23 @@ public class StatusBarKeyguardViewManager {
|
||||
*/
|
||||
public void hide(long startTime, long fadeoutDuration) {
|
||||
mShowing = false;
|
||||
mPhoneStatusBar.hideKeyguard();
|
||||
mStatusBarWindowManager.setKeyguardFadingAway(true);
|
||||
mStatusBarWindowManager.setKeyguardShowing(false);
|
||||
|
||||
long uptimeMillis = SystemClock.uptimeMillis();
|
||||
long delay = startTime - uptimeMillis;
|
||||
if (delay < 0) {
|
||||
delay = 0;
|
||||
}
|
||||
|
||||
mPhoneStatusBar.setKeyguardFadingAway(delay, fadeoutDuration);
|
||||
mPhoneStatusBar.hideKeyguard();
|
||||
mStatusBarWindowManager.setKeyguardFadingAway(true);
|
||||
mStatusBarWindowManager.setKeyguardShowing(false);
|
||||
mBouncer.animateHide(delay, fadeoutDuration);
|
||||
mScrimController.animateKeyguardFadingOut(delay, fadeoutDuration, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
mStatusBarWindowManager.setKeyguardFadingAway(false);
|
||||
mPhoneStatusBar.finishKeyguardFadingAway();
|
||||
}
|
||||
});
|
||||
mViewMediatorCallback.keyguardGone();
|
||||
|
||||
Reference in New Issue
Block a user