summaryrefslogtreecommitdiff
path: root/packages/SystemUI/src/com/android/keyguard/KeyguardStatusViewController.java
diff options
context:
space:
mode:
Diffstat (limited to 'packages/SystemUI/src/com/android/keyguard/KeyguardStatusViewController.java')
-rw-r--r--packages/SystemUI/src/com/android/keyguard/KeyguardStatusViewController.java47
1 files changed, 44 insertions, 3 deletions
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardStatusViewController.java b/packages/SystemUI/src/com/android/keyguard/KeyguardStatusViewController.java
index 3a3f2fc40b25..e8cc5c8a49f3 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardStatusViewController.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardStatusViewController.java
@@ -20,11 +20,14 @@ import android.graphics.Rect;
import android.os.UserHandle;
import android.util.Slog;
+import com.android.systemui.keyguard.KeyguardUnlockAnimationController;
+import com.android.systemui.shared.system.smartspace.SmartspaceTransitionController;
import com.android.systemui.statusbar.notification.AnimatableProperty;
import com.android.systemui.statusbar.notification.PropertyAnimator;
import com.android.systemui.statusbar.notification.stack.AnimationProperties;
import com.android.systemui.statusbar.notification.stack.StackStateAnimator;
import com.android.systemui.statusbar.phone.DozeParameters;
+import com.android.systemui.statusbar.phone.UnlockedScreenOffAnimationController;
import com.android.systemui.statusbar.policy.ConfigurationController;
import com.android.systemui.statusbar.policy.KeyguardStateController;
import com.android.systemui.util.ViewController;
@@ -49,6 +52,9 @@ public class KeyguardStatusViewController extends ViewController<KeyguardStatusV
private final ConfigurationController mConfigurationController;
private final DozeParameters mDozeParameters;
private final KeyguardVisibilityHelper mKeyguardVisibilityHelper;
+ private final KeyguardUnlockAnimationController mKeyguardUnlockAnimationController;
+ private final KeyguardStateController mKeyguardStateController;
+ private SmartspaceTransitionController mSmartspaceTransitionController;
private final Rect mClipBounds = new Rect();
@Inject
@@ -59,15 +65,33 @@ public class KeyguardStatusViewController extends ViewController<KeyguardStatusV
KeyguardStateController keyguardStateController,
KeyguardUpdateMonitor keyguardUpdateMonitor,
ConfigurationController configurationController,
- DozeParameters dozeParameters) {
+ DozeParameters dozeParameters,
+ KeyguardUnlockAnimationController keyguardUnlockAnimationController,
+ SmartspaceTransitionController smartspaceTransitionController,
+ UnlockedScreenOffAnimationController unlockedScreenOffAnimationController) {
super(keyguardStatusView);
mKeyguardSliceViewController = keyguardSliceViewController;
mKeyguardClockSwitchController = keyguardClockSwitchController;
mKeyguardUpdateMonitor = keyguardUpdateMonitor;
mConfigurationController = configurationController;
mDozeParameters = dozeParameters;
+ mKeyguardStateController = keyguardStateController;
mKeyguardVisibilityHelper = new KeyguardVisibilityHelper(mView, keyguardStateController,
- dozeParameters);
+ dozeParameters, unlockedScreenOffAnimationController);
+ mKeyguardUnlockAnimationController = keyguardUnlockAnimationController;
+ mSmartspaceTransitionController = smartspaceTransitionController;
+
+ mKeyguardStateController.addCallback(new KeyguardStateController.Callback() {
+ @Override
+ public void onKeyguardShowingChanged() {
+ // If we explicitly re-show the keyguard, make sure that all the child views are
+ // visible. They might have been animating out as part of the SmartSpace shared
+ // element transition.
+ if (keyguardStateController.isShowing()) {
+ mView.setChildrenAlphaExcludingClockView(1f);
+ }
+ }
+ });
}
@Override
@@ -137,7 +161,24 @@ public class KeyguardStatusViewController extends ViewController<KeyguardStatusV
*/
public void setAlpha(float alpha) {
if (!mKeyguardVisibilityHelper.isVisibilityAnimating()) {
- mView.setAlpha(alpha);
+ // If we're capable of performing the SmartSpace shared element transition, and we are
+ // going to (we're swiping to dismiss vs. bringing up the PIN screen), then fade out
+ // everything except for the SmartSpace.
+ if (mKeyguardUnlockAnimationController.isUnlockingWithSmartSpaceTransition()) {
+ mView.setChildrenAlphaExcludingClockView(alpha);
+ mKeyguardClockSwitchController.setChildrenAlphaExcludingSmartspace(alpha);
+ } else if (!mKeyguardVisibilityHelper.isVisibilityAnimating()) {
+ // Otherwise, we can just set the alpha for the entire container.
+ mView.setAlpha(alpha);
+
+ // If we previously unlocked with the shared element transition, some child views
+ // might still have alpha = 0f. Set them back to 1f since we're just using the
+ // parent container's alpha.
+ if (mView.getChildrenAlphaExcludingSmartSpace() < 1f) {
+ mView.setChildrenAlphaExcludingClockView(1f);
+ mKeyguardClockSwitchController.setChildrenAlphaExcludingSmartspace(1f);
+ }
+ }
}
}