diff options
3 files changed, 46 insertions, 3 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardPageSwipeHelper.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardPageSwipeHelper.java index 25bb41a..086a266 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardPageSwipeHelper.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardPageSwipeHelper.java @@ -40,8 +40,8 @@ import java.util.ArrayList; public class KeyguardPageSwipeHelper { private static final float SWIPE_MAX_ICON_SCALE_AMOUNT = 2.0f; - private static final float SWIPE_RESTING_ALPHA_AMOUNT = 0.7f; - private static final long HINT_PHASE1_DURATION = 250; + public static final float SWIPE_RESTING_ALPHA_AMOUNT = 0.5f; + public static final long HINT_PHASE1_DURATION = 250; private static final long HINT_PHASE2_DURATION = 450; private final Context mContext; 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 252f153..14c447c 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java @@ -32,6 +32,7 @@ import android.view.ViewTreeObserver; import android.view.accessibility.AccessibilityEvent; import android.view.animation.AnimationUtils; import android.view.animation.Interpolator; +import android.view.animation.LinearInterpolator; import android.widget.LinearLayout; import com.android.systemui.R; @@ -861,6 +862,7 @@ public class NotificationPanelView extends PanelView implements mStatusBar.onHintFinished(); } }); + startHighlightIconAnimation(right ? getRightIcon() : getLeftIcon()); boolean start = getLayoutDirection() == LAYOUT_DIRECTION_RTL ? right : !right; if (start) { mStatusBar.onPhoneHintStarted(); @@ -870,6 +872,30 @@ public class NotificationPanelView extends PanelView implements } @Override + protected void startUnlockHintAnimation() { + super.startUnlockHintAnimation(); + startHighlightIconAnimation(getCenterIcon()); + } + + /** + * Starts the highlight (making it fully opaque) animation on an icon. + */ + private void startHighlightIconAnimation(final View icon) { + icon.animate() + .alpha(1.0f) + .setDuration(KeyguardPageSwipeHelper.HINT_PHASE1_DURATION) + .setInterpolator(mFastOutSlowInInterpolator) + .withEndAction(new Runnable() { + @Override + public void run() { + icon.animate().alpha(KeyguardPageSwipeHelper.SWIPE_RESTING_ALPHA_AMOUNT) + .setDuration(KeyguardPageSwipeHelper.HINT_PHASE1_DURATION) + .setInterpolator(mFastOutSlowInInterpolator); + } + }); + } + + @Override public float getPageWidth() { return getWidth(); } 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 bb0785c..85fe99b 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java @@ -174,6 +174,11 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, /** The minimum delay in ms between reports of notification visibility. */ private static final int VISIBILITY_REPORT_MIN_DELAY_MS = 500; + /** + * The delay to reset the hint text when the hint animation is finished running. + */ + private static final int HINT_RESET_DELAY_MS = 1200; + // fling gesture tuning parameters, scaled to display density private float mSelfExpandVelocityPx; // classic value: 2000px/s private float mSelfCollapseVelocityPx; // classic value: 2000px/s (will be negated to collapse "up") @@ -491,6 +496,13 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, } }; + private final Runnable mResetIndicationRunnable = new Runnable() { + @Override + public void run() { + mKeyguardIndicationTextView.switchIndication(mKeyguardHotwordPhrase); + } + }; + @Override public void setZenMode(int mode) { super.setZenMode(mode); @@ -2960,18 +2972,23 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, } public void onUnlockHintStarted() { + mStatusBarView.removeCallbacks(mResetIndicationRunnable); mKeyguardIndicationTextView.switchIndication(R.string.keyguard_unlock); } public void onHintFinished() { - mKeyguardIndicationTextView.switchIndication(mKeyguardHotwordPhrase); + + // Delay the reset a bit so the user can read the text. + mStatusBarView.postDelayed(mResetIndicationRunnable, HINT_RESET_DELAY_MS); } public void onCameraHintStarted() { + mStatusBarView.removeCallbacks(mResetIndicationRunnable); mKeyguardIndicationTextView.switchIndication(R.string.camera_hint); } public void onPhoneHintStarted() { + mStatusBarView.removeCallbacks(mResetIndicationRunnable); mKeyguardIndicationTextView.switchIndication(R.string.phone_hint); } |
