diff options
author | Jorim Jaggi <jjaggi@google.com> | 2014-07-31 21:46:39 +0200 |
---|---|---|
committer | Jorim Jaggi <jjaggi@google.com> | 2014-08-01 13:14:58 +0000 |
commit | 6ff837a95b864cebb80626f33bd17151f58043e1 (patch) | |
tree | 9d46ada6d9cd63d3c31e3a0ff48cce8df2e2c421 /packages | |
parent | 60d07c597c3f996deb3f2743466fe5279ca15e8d (diff) | |
download | frameworks_base-6ff837a95b864cebb80626f33bd17151f58043e1.zip frameworks_base-6ff837a95b864cebb80626f33bd17151f58043e1.tar.gz frameworks_base-6ff837a95b864cebb80626f33bd17151f58043e1.tar.bz2 |
Animate clock when going to SHADE_LOCKED or SHADE
Bug: 16291973
Change-Id: Idf2fa7bd26800be4df38d99993533069120e7075
Diffstat (limited to 'packages')
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java | 58 | ||||
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java | 4 |
2 files changed, 55 insertions, 7 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java index 602b914..c46f77a 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java @@ -139,7 +139,7 @@ public class NotificationPanelView extends PanelView implements private boolean mIsLaunchTransitionRunning; private Runnable mLaunchAnimationEndRunnable; private boolean mOnlyAffordanceInThisMotion; - private boolean mKeyguardStatusBarAnimatingIn; + private boolean mKeyguardStatusViewAnimating; public NotificationPanelView(Context context, AttributeSet attrs) { super(context, attrs); @@ -285,7 +285,9 @@ public class NotificationPanelView extends PanelView implements } private void updateClock(float alpha, float scale) { - mKeyguardStatusView.setAlpha(alpha); + if (!mKeyguardStatusViewAnimating) { + mKeyguardStatusView.setAlpha(alpha); + } mKeyguardStatusView.setScaleX(scale); mKeyguardStatusView.setScaleY(scale); } @@ -671,7 +673,7 @@ public class NotificationPanelView extends PanelView implements } } - public void setBarState(int statusBarState) { + public void setBarState(int statusBarState, boolean keyguardFadingAway) { boolean keyguardShowing = statusBarState == StatusBarState.KEYGUARD || statusBarState == StatusBarState.SHADE_LOCKED; mKeyguardStatusBar.setAlpha(1f); @@ -680,11 +682,59 @@ public class NotificationPanelView extends PanelView implements setQsTranslation(mQsExpansionHeight); mHeader.setTranslationY(0f); } + setKeyguardStatusViewVisibility(statusBarState, keyguardFadingAway); mStatusBarState = statusBarState; mKeyguardShowing = keyguardShowing; updateQsState(); } + private final Runnable mAnimateKeyguardStatusViewInvisibleEndRunnable = new Runnable() { + @Override + public void run() { + mKeyguardStatusViewAnimating = false; + mKeyguardStatusView.setVisibility(View.GONE); + } + }; + + private final Runnable mAnimateKeyguardStatusViewVisibleEndRunnable = new Runnable() { + @Override + public void run() { + mKeyguardStatusViewAnimating = false; + } + }; + + private void setKeyguardStatusViewVisibility(int statusBarState, boolean keyguardFadingAway) { + if (!keyguardFadingAway && mStatusBarState == StatusBarState.KEYGUARD + && statusBarState != StatusBarState.KEYGUARD) { + mKeyguardStatusView.animate().cancel(); + mKeyguardStatusViewAnimating = true; + mKeyguardStatusView.animate() + .alpha(0f) + .setDuration(160) + .setInterpolator(PhoneStatusBar.ALPHA_OUT) + .withEndAction(mAnimateKeyguardStatusViewInvisibleEndRunnable); + } else if (mStatusBarState == StatusBarState.SHADE_LOCKED + && statusBarState == StatusBarState.KEYGUARD) { + mKeyguardStatusView.animate().cancel(); + mKeyguardStatusView.setVisibility(View.VISIBLE); + mKeyguardStatusViewAnimating = true; + mKeyguardStatusView.setAlpha(0f); + mKeyguardStatusView.animate() + .alpha(1f) + .setDuration(320) + .setInterpolator(PhoneStatusBar.ALPHA_IN) + .withEndAction(mAnimateKeyguardStatusViewVisibleEndRunnable); + } else if (statusBarState == StatusBarState.KEYGUARD) { + mKeyguardStatusView.animate().cancel(); + mKeyguardStatusView.setVisibility(View.VISIBLE); + mKeyguardStatusView.setAlpha(1f); + } else { + mKeyguardStatusView.animate().cancel(); + mKeyguardStatusView.setVisibility(View.GONE); + mKeyguardStatusView.setAlpha(1f); + } + } + private void updateQsState() { boolean expandVisually = mQsExpanded || mStackScrollerOverscrolling; mHeader.setVisibility((mQsExpanded || !mKeyguardShowing) ? View.VISIBLE : View.INVISIBLE); @@ -1076,7 +1126,7 @@ public class NotificationPanelView extends PanelView implements } alpha = Math.max(0, Math.min(alpha, 1)); alpha = (float) Math.pow(alpha, 0.75); - if (!mQsExpanded && !mKeyguardStatusBarAnimatingIn) { + if (!mQsExpanded) { mKeyguardStatusBar.setAlpha(alpha); } mKeyguardBottomArea.setAlpha(alpha); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java index 1661af4..ee29ad4 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java @@ -3382,12 +3382,10 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, private void updateKeyguardState() { if (mState == StatusBarState.KEYGUARD) { - mKeyguardStatusView.setVisibility(View.VISIBLE); mKeyguardIndicationController.setVisible(true); mNotificationPanel.resetViews(); mKeyguardUserSwitcher.setKeyguard(true); } else { - mKeyguardStatusView.setVisibility(View.GONE); mKeyguardIndicationController.setVisible(false); mKeyguardUserSwitcher.setKeyguard(false); } @@ -3398,7 +3396,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, mKeyguardBottomArea.setVisibility(View.GONE); mScrimController.setKeyguardShowing(false); } - mNotificationPanel.setBarState(mState); + mNotificationPanel.setBarState(mState, mKeyguardFadingAway); updateDozingState(); updateStackScrollerState(); updatePublicMode(); |