Merge "Ignore QS touches if scrolling is not possible."

This commit is contained in:
TreeHugger Robot
2018-02-06 18:03:41 +00:00
committed by Android (Google) Code Review

View File

@@ -51,6 +51,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) {
if (ev.getY() > (getBottom() - mFooterHeight)) {
// Do not intercept touches that are below the divider between QS and the footer.