Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 489c5072 authored by Amin Shaikh's avatar Amin Shaikh
Browse files

Ignore QS touches if scrolling is not possible.

Bug: 70799330
Test: manually scrolling up and down on QS
Change-Id: I932386898ab6259c7f726fcbb5935e8e3b1e1d0a
parent 64b7ccee
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -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())) {