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.
This commit is contained in:
Romain Guy
2009-12-01 16:24:45 -08:00
parent 03828c0e67
commit f7b4accbda
2 changed files with 8 additions and 2 deletions

View File

@@ -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();

View File

@@ -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;