OSDN Git Service

AmbientIndication: Add tap again hint
authorAdrian Roos <roosa@google.com>
Fri, 2 Jun 2017 00:55:05 +0000 (17:55 -0700)
committerAdrian Roos <roosa@google.com>
Wed, 7 Jun 2017 20:20:43 +0000 (20:20 +0000)
Adds a hint for tapping the ambient indication again to open.
Also fixes an issue where the indication bottom padding was not correctly
updated if the indication was shown while the panel is collapsed.

Bug: 38387500
Test: tap indication, verify it shows the tap-again-to-open hint. Also verify that if the indication gets set while the phone is unlocked that sufficient space is reserved after transitioning to the lockscreen.
Change-Id: Ie9a152b0bd86807958376fd278ef9502c03af6b2

packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java

index 3906e40..5597979 100644 (file)
@@ -4647,6 +4647,11 @@ public class StatusBar extends SystemUI implements DemoMode,
 
     @Override
     public void onActivated(ActivatableNotificationView view) {
+        onActivated((View)view);
+        mStackScroller.setActivatedChild(view);
+    }
+
+    public void onActivated(View view) {
         mLockscreenGestureLogger.write(
                 MetricsEvent.ACTION_LS_NOTE,
                 0 /* lengthDp - N/A */, 0 /* velocityDp - N/A */);
@@ -4655,7 +4660,6 @@ public class StatusBar extends SystemUI implements DemoMode,
         if (previousView != null) {
             previousView.makeInactive(true /* animate */);
         }
-        mStackScroller.setActivatedChild(view);
     }
 
     /**
@@ -4689,11 +4693,15 @@ public class StatusBar extends SystemUI implements DemoMode,
     @Override
     public void onActivationReset(ActivatableNotificationView view) {
         if (view == mStackScroller.getActivatedChild()) {
-            mKeyguardIndicationController.hideTransientIndication();
             mStackScroller.setActivatedChild(null);
+            onActivationReset((View)view);
         }
     }
 
+    public void onActivationReset(View view) {
+        mKeyguardIndicationController.hideTransientIndication();
+    }
+
     public void onTrackingStarted() {
         runPostCollapseRunnables();
     }