Ignore QS touches if scrolling is not possible.

Bug: 70799330
Test: manually scrolling up and down on QS
Change-Id: I932386898ab6259c7f726fcbb5935e8e3b1e1d0a
This commit is contained in:
Amin Shaikh
2018-02-02 13:38:03 -05:00
parent 64b7ccee7f
commit 489c50726a

View File

@@ -49,6 +49,23 @@ public class QSScrollLayout extends NestedScrollView {
addView(linearLayout);
}
@Override
public boolean onInterceptTouchEvent(MotionEvent ev) {
if (canScrollVertically(1) || canScrollVertically(-1)) {
return super.onInterceptTouchEvent(ev);
}
return false;
}
@Override
public boolean onTouchEvent(MotionEvent ev) {
if (canScrollVertically(1) || canScrollVertically(-1)) {
return super.onTouchEvent(ev);
}
return false;
}
public boolean shouldIntercept(MotionEvent ev) {
getHitRect(mHitRect);
if (!mHitRect.contains((int) ev.getX(), (int) ev.getY())) {