OSDN Git Service

Fling should only be allowed when touched the view from bottom of the list
authorPriyank Singh <priyanksingh@google.com>
Fri, 17 May 2019 23:33:57 +0000 (16:33 -0700)
committerPriyank Singh <priyanksingh@google.com>
Mon, 20 May 2019 20:02:42 +0000 (20:02 +0000)
Bug:133168136
Test: Manual
Change-Id: I5ccb58b1c8f9b04bb9bead25b12373ce33b6ffdc
(cherry picked from commit 61bf685b7a1fa41944cd92e68a4b03af79ad86a8)

packages/CarSystemUI/src/com/android/systemui/statusbar/car/CarStatusBar.java

index 9b6ab06..a07b92a 100644 (file)
@@ -1095,9 +1095,6 @@ public class CarStatusBar extends StatusBar implements
         @Override
         public boolean onScroll(MotionEvent event1, MotionEvent event2, float distanceX,
                 float distanceY) {
-            if (!mNotificationListAtBottomAtTimeOfTouch && !mNotificationListAtBottom) {
-                return false;
-            }
             // should not clip while scroll to the bottom of the list.
             if (!mNotificationListAtBottomAtTimeOfTouch) {
                 return false;
@@ -1134,7 +1131,8 @@ public class CarStatusBar extends StatusBar implements
         @Override
         public boolean onFling(MotionEvent event1, MotionEvent event2,
                 float velocityX, float velocityY) {
-            if (!mNotificationListAtBottomAtTimeOfTouch && !mNotificationListAtBottom) {
+            // should not fling if the touch does not start when view is at the bottom of the list.
+            if (!mNotificationListAtBottomAtTimeOfTouch) {
                 return false;
             }
             if (Math.abs(event1.getX() - event2.getX()) > SWIPE_MAX_OFF_PATH