diff options
author | Jorim Jaggi <jjaggi@google.com> | 2014-05-30 23:17:03 +0200 |
---|---|---|
committer | Jorim Jaggi <jjaggi@google.com> | 2014-05-31 02:48:06 +0200 |
commit | e29b2dbc762bfa66093d76f5a65f55328d8753c9 (patch) | |
tree | 715078ec5618bb210f671a9a8679289a301ffb95 /packages/SystemUI/src/com/android/systemui/keyguard | |
parent | 283c907a6a84c5d9ffe38d3468e76131e6917105 (diff) | |
download | frameworks_base-e29b2dbc762bfa66093d76f5a65f55328d8753c9.zip frameworks_base-e29b2dbc762bfa66093d76f5a65f55328d8753c9.tar.gz frameworks_base-e29b2dbc762bfa66093d76f5a65f55328d8753c9.tar.bz2 |
Fade scrim in unlock animation.
This also introduces a startTime which gets sent from window manager
to SystemUI, which tells when the animation should start, to allow
for a more synchronized animation with fading out the scrim and
fading in the activity behind.
Bug: 15163546
Change-Id: I16212b1ef9eb76f1f98734da1d14fc5b7e626937
Diffstat (limited to 'packages/SystemUI/src/com/android/systemui/keyguard')
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/keyguard/KeyguardService.java | 4 | ||||
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java | 23 |
2 files changed, 20 insertions, 7 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardService.java b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardService.java index 4c7f3df..b280ab7 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardService.java +++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardService.java @@ -204,9 +204,9 @@ public class KeyguardService extends Service { } @Override - public void startKeyguardExitAnimation(long fadeoutDuration) { + public void startKeyguardExitAnimation(long startTime, long fadeoutDuration) { checkPermission(); - mKeyguardViewMediator.startKeyguardExitAnimation(fadeoutDuration); + mKeyguardViewMediator.startKeyguardExitAnimation(startTime, fadeoutDuration); } }; } diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java index 7110d8d..f7b4994 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java +++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java @@ -1083,7 +1083,8 @@ public class KeyguardViewMediator extends SystemUI { handleDismiss(); break; case START_KEYGUARD_EXIT_ANIM: - handleStartKeyguardExitAnimation((Long) msg.obj); + StartKeyguardExitAnimParams params = (StartKeyguardExitAnimParams) msg.obj; + handleStartKeyguardExitAnimation(params.startTime, params.fadeoutDuration); break; } } @@ -1227,7 +1228,7 @@ public class KeyguardViewMediator extends SystemUI { } } - private void handleStartKeyguardExitAnimation(long fadeoutDuration) { + private void handleStartKeyguardExitAnimation(long startTime, long fadeoutDuration) { synchronized (KeyguardViewMediator.this) { // only play "unlock" noises if not on a call (since the incall UI @@ -1236,7 +1237,7 @@ public class KeyguardViewMediator extends SystemUI { playSounds(false); } - mStatusBarKeyguardViewManager.hide(); + mStatusBarKeyguardViewManager.hide(startTime, fadeoutDuration); mShowing = false; mKeyguardDonePending = false; updateActivityLockScreenState(); @@ -1346,12 +1347,24 @@ public class KeyguardViewMediator extends SystemUI { return mStatusBarKeyguardViewManager; } - public void startKeyguardExitAnimation(long fadeoutDuration) { - Message msg = mHandler.obtainMessage(START_KEYGUARD_EXIT_ANIM, fadeoutDuration); + public void startKeyguardExitAnimation(long startTime, long fadeoutDuration) { + Message msg = mHandler.obtainMessage(START_KEYGUARD_EXIT_ANIM, + new StartKeyguardExitAnimParams(startTime, fadeoutDuration)); mHandler.sendMessage(msg); } public ViewMediatorCallback getViewMediatorCallback() { return mViewMediatorCallback; } + + private static class StartKeyguardExitAnimParams { + + long startTime; + long fadeoutDuration; + + private StartKeyguardExitAnimParams(long startTime, long fadeoutDuration) { + this.startTime = startTime; + this.fadeoutDuration = fadeoutDuration; + } + } } |