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

Commit f7b4accb authored by Romain Guy's avatar Romain Guy
Browse files

Fix scroll jump in ScrollView.

If a touch event was targeted at a ScrollView child, the content would jump after
the user moved her finger by the required threshold. This is inconsistent with
ListView's behavior.

Fixes #2296622.
parent 03828c0e
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -3990,6 +3990,13 @@ public class WebView extends AbsoluteLayout
                    }

                    mTouchMode = TOUCH_DRAG_MODE;
                    mLastTouchX = x;
                    mLastTouchY = y;
                    fDeltaX = 0.0f;
                    fDeltaY = 0.0f;
                    deltaX = 0;
                    deltaY = 0;

                    WebViewCore.pauseUpdate(mWebViewCore);
                    if (!mDragFromTextInput) {
                        nativeHideCursor();
+1 −2
Original line number Diff line number Diff line
@@ -51,8 +51,6 @@ import java.util.List;
 * <p>ScrollView only supports vertical scrolling.
 */
public class ScrollView extends FrameLayout {
    static final String TAG = "ScrollView";
    
    static final int ANIMATED_SCROLL_GAP = 250;

    static final float MAX_SCROLL_FACTOR = 0.5f;
@@ -401,6 +399,7 @@ public class ScrollView extends FrameLayout {
                final int yDiff = (int) Math.abs(y - mLastMotionY);
                if (yDiff > mTouchSlop) {
                    mIsBeingDragged = true;
                    mLastMotionY = y;
                }
                break;