Improve hint animations.

Show the hint text longer so that users have enough time to read it,
also "highlight" the corresponding icon by making it fully opaque
during the gesture.

Bug: 15189049
Change-Id: Ie0429752b63bae41bb6992778ebb3bd5678f9676
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.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 @@
                 mStatusBar.onHintFinished();
             }
         });
+        startHighlightIconAnimation(right ? getRightIcon() : getLeftIcon());
         boolean start = getLayoutDirection() == LAYOUT_DIRECTION_RTL ? right : !right;
         if (start) {
             mStatusBar.onPhoneHintStarted();
@@ -870,6 +872,30 @@
     }
 
     @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();
     }