Merge "Fling should only be allowed when touched the view from bottom of the list" into qt-dev

This commit is contained in:
TreeHugger Robot
2019-05-20 23:24:45 +00:00
committed by Android (Google) Code Review

View File

@@ -1102,9 +1102,6 @@ public class CarStatusBar extends StatusBar implements
@Override @Override
public boolean onScroll(MotionEvent event1, MotionEvent event2, float distanceX, public boolean onScroll(MotionEvent event1, MotionEvent event2, float distanceX,
float distanceY) { float distanceY) {
if (!mNotificationListAtBottomAtTimeOfTouch && !mNotificationListAtBottom) {
return false;
}
// should not clip while scroll to the bottom of the list. // should not clip while scroll to the bottom of the list.
if (!mNotificationListAtBottomAtTimeOfTouch) { if (!mNotificationListAtBottomAtTimeOfTouch) {
return false; return false;
@@ -1141,7 +1138,8 @@ public class CarStatusBar extends StatusBar implements
@Override @Override
public boolean onFling(MotionEvent event1, MotionEvent event2, public boolean onFling(MotionEvent event1, MotionEvent event2,
float velocityX, float velocityY) { 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; return false;
} }
if (Math.abs(event1.getX() - event2.getX()) > SWIPE_MAX_OFF_PATH if (Math.abs(event1.getX() - event2.getX()) > SWIPE_MAX_OFF_PATH