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

Commit e9a16a5a authored by Adam Powell's avatar Adam Powell
Browse files

Fix ScrollView nested scrolling with touch down on buttons

Start ScrollView's nested scroll in onIntercept to signal nested
scrolling parents not to intercept along the vertical axis.

Change-Id: Ieb343ff6b8216b113d3876bf93a804e609257f2a
parent d80cb24a
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -18004,7 +18004,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
     *
     * <p>If <code>startNestedScroll</code> returns true, a cooperative parent was found.
     * If it returns false the caller may ignore the rest of this contract until the next scroll.
     * </p>
     * Calling startNestedScroll while a nested scroll is already in progress will return true.</p>
     *
     * <p>At each incremental step of the scroll the caller should invoke
     * {@link #dispatchNestedPreScroll(int, int, int[], int[]) dispatchNestedPreScroll}
@@ -18028,6 +18028,10 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
     * @see #dispatchNestedScroll(int, int, int, int, int[])
     */
    public boolean startNestedScroll(int axes) {
        if (hasNestedScrollingParent()) {
            // Already in progress
            return true;
        }
        if (isNestedScrollingEnabled()) {
            ViewParent p = getParent();
            View child = this;
+1 −0
Original line number Diff line number Diff line
@@ -2342,6 +2342,7 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager

        if (disallowIntercept) {
            mGroupFlags |= FLAG_DISALLOW_INTERCEPT;
            stopNestedScroll();
        } else {
            mGroupFlags &= ~FLAG_DISALLOW_INTERCEPT;
        }
+2 −0
Original line number Diff line number Diff line
@@ -553,6 +553,7 @@ public class ScrollView extends FrameLayout {
                if (mIsBeingDragged && mScrollStrictSpan == null) {
                    mScrollStrictSpan = StrictMode.enterCriticalSpan("ScrollView-scroll");
                }
                startNestedScroll(SCROLL_AXIS_VERTICAL);
                break;
            }

@@ -565,6 +566,7 @@ public class ScrollView extends FrameLayout {
                if (mScroller.springBack(mScrollX, mScrollY, 0, 0, 0, getScrollRange())) {
                    postInvalidateOnAnimation();
                }
                stopNestedScroll();
                break;
            case MotionEvent.ACTION_POINTER_UP:
                onSecondaryPointerUp(ev);