Merge "Do not animate scrims when launching camera" into pi-dev
This commit is contained in:
@@ -221,6 +221,7 @@ public class NotificationPanelView extends PanelView implements
|
||||
private boolean mClosingWithAlphaFadeOut;
|
||||
private boolean mHeadsUpAnimatingAway;
|
||||
private boolean mLaunchingAffordance;
|
||||
private boolean mAffordanceHasPreview;
|
||||
private FalsingManager mFalsingManager;
|
||||
private String mLastCameraLaunchSource = KeyguardBottomAreaView.CAMERA_LAUNCH_SOURCE_AFFORDANCE;
|
||||
|
||||
@@ -2569,6 +2570,7 @@ public class NotificationPanelView extends PanelView implements
|
||||
} else {
|
||||
animate = false;
|
||||
}
|
||||
mAffordanceHasPreview = mKeyguardBottomArea.getRightPreview() != null;
|
||||
mAffordanceHelper.launchAffordance(animate, getLayoutDirection() == LAYOUT_DIRECTION_RTL);
|
||||
}
|
||||
|
||||
@@ -2613,6 +2615,13 @@ public class NotificationPanelView extends PanelView implements
|
||||
getCenterIcon().setLaunchingAffordance(launchingAffordance);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return true when a bottom affordance is launching an occluded activity with a splash screen.
|
||||
*/
|
||||
public boolean isLaunchingAffordanceWithPreview() {
|
||||
return mLaunchingAffordance && mAffordanceHasPreview;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the camera application can be launched for the camera launch gesture.
|
||||
*
|
||||
|
||||
@@ -889,9 +889,14 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, OnCo
|
||||
}
|
||||
|
||||
public void setHasBackdrop(boolean hasBackdrop) {
|
||||
ScrimState[] states = ScrimState.values();
|
||||
for (int i = 0; i < states.length; i++) {
|
||||
states[i].setHasBackdrop(hasBackdrop);
|
||||
for (ScrimState state : ScrimState.values()) {
|
||||
state.setHasBackdrop(hasBackdrop);
|
||||
}
|
||||
}
|
||||
|
||||
public void setLaunchingAffordanceWithPreview(boolean launchingAffordanceWithPreview) {
|
||||
for (ScrimState state : ScrimState.values()) {
|
||||
state.setLaunchingAffordanceWithPreview(launchingAffordanceWithPreview);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -144,6 +144,7 @@ public enum ScrimState {
|
||||
mCurrentBehindAlpha = 0;
|
||||
mCurrentInFrontAlpha = 0;
|
||||
mAnimationDuration = StatusBar.FADE_KEYGUARD_DURATION;
|
||||
mAnimateChange = !mLaunchingAffordanceWithPreview;
|
||||
|
||||
if (previousState == ScrimState.AOD || previousState == ScrimState.PULSING) {
|
||||
// Fade from black to transparent when coming directly from AOD
|
||||
@@ -177,6 +178,7 @@ public enum ScrimState {
|
||||
boolean mWallpaperSupportsAmbientMode;
|
||||
int mIndex;
|
||||
boolean mHasBackdrop;
|
||||
boolean mLaunchingAffordanceWithPreview;
|
||||
|
||||
ScrimState(int index) {
|
||||
mIndex = index;
|
||||
@@ -249,6 +251,10 @@ public enum ScrimState {
|
||||
mWallpaperSupportsAmbientMode = wallpaperSupportsAmbientMode;
|
||||
}
|
||||
|
||||
public void setLaunchingAffordanceWithPreview(boolean launchingAffordanceWithPreview) {
|
||||
mLaunchingAffordanceWithPreview = launchingAffordanceWithPreview;
|
||||
}
|
||||
|
||||
public boolean isLowPowerState() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -4736,6 +4736,10 @@ public class StatusBar extends SystemUI implements DemoMode,
|
||||
mScrimController.setExpansionAffectsAlpha(
|
||||
!mFingerprintUnlockController.isFingerprintUnlock());
|
||||
|
||||
boolean launchingAffordanceWithPreview =
|
||||
mNotificationPanel.isLaunchingAffordanceWithPreview();
|
||||
mScrimController.setLaunchingAffordanceWithPreview(launchingAffordanceWithPreview);
|
||||
|
||||
if (mBouncerShowing) {
|
||||
// Bouncer needs the front scrim when it's on top of an activity,
|
||||
// tapping on a notification, editing QS or being dismissed by
|
||||
@@ -4745,7 +4749,8 @@ public class StatusBar extends SystemUI implements DemoMode,
|
||||
|| mStatusBarKeyguardViewManager.isFullscreenBouncer() ?
|
||||
ScrimState.BOUNCER_SCRIMMED : ScrimState.BOUNCER;
|
||||
mScrimController.transitionTo(state);
|
||||
} else if (mLaunchCameraOnScreenTurningOn || isInLaunchTransition()) {
|
||||
} else if (isInLaunchTransition() || mLaunchCameraOnScreenTurningOn
|
||||
|| launchingAffordanceWithPreview) {
|
||||
mScrimController.transitionTo(ScrimState.UNLOCKED, mUnlockScrimCallback);
|
||||
} else if (mBrightnessMirrorVisible) {
|
||||
mScrimController.transitionTo(ScrimState.BRIGHTNESS_MIRROR);
|
||||
|
||||
Reference in New Issue
Block a user