am e02e8b9c: Merge change 27315 into eclair

Merge commit 'e02e8b9c11231d99aacd5fda31042168650edd49' into eclair-plus-aosp

* commit 'e02e8b9c11231d99aacd5fda31042168650edd49':
  Reset mPreventDrag at touch_down.
This commit is contained in:
Grace Kloba
2009-09-27 15:09:30 -07:00
committed by Android Git Automerger

View File

@@ -3689,6 +3689,7 @@ public class WebView extends AbsoluteLayout
switch (action) { switch (action) {
case MotionEvent.ACTION_DOWN: { case MotionEvent.ACTION_DOWN: {
mPreventDrag = PREVENT_DRAG_NO;
if (!mScroller.isFinished()) { if (!mScroller.isFinished()) {
// stop the current scroll animation, but if this is // stop the current scroll animation, but if this is
// the start of a fling, allow it to add to the current // the start of a fling, allow it to add to the current
@@ -3896,19 +3897,15 @@ public class WebView extends AbsoluteLayout
mTouchMode = TOUCH_DONE_MODE; mTouchMode = TOUCH_DONE_MODE;
doDoubleTap(); doDoubleTap();
break; break;
case TOUCH_SHORTPRESS_START_MODE:
case TOUCH_SHORTPRESS_MODE:
mPrivateHandler.removeMessages(SWITCH_TO_SHORTPRESS);
mPrivateHandler.removeMessages(SWITCH_TO_LONGPRESS);
mTouchMode = TOUCH_DONE_MODE;
doShortPress();
break;
case TOUCH_SELECT_MODE: case TOUCH_SELECT_MODE:
commitCopy(); commitCopy();
mTouchSelection = false; mTouchSelection = false;
break; break;
case TOUCH_INIT_MODE: // tap case TOUCH_INIT_MODE: // tap
case TOUCH_SHORTPRESS_START_MODE:
case TOUCH_SHORTPRESS_MODE:
mPrivateHandler.removeMessages(SWITCH_TO_SHORTPRESS); mPrivateHandler.removeMessages(SWITCH_TO_SHORTPRESS);
mPrivateHandler.removeMessages(SWITCH_TO_LONGPRESS);
if ((deltaX * deltaX + deltaY * deltaY) > mTouchSlopSquare) { if ((deltaX * deltaX + deltaY * deltaY) > mTouchSlopSquare) {
Log.w(LOGTAG, "Miss a drag as we are waiting for" + Log.w(LOGTAG, "Miss a drag as we are waiting for" +
" WebCore's response for touch down."); " WebCore's response for touch down.");
@@ -3928,10 +3925,15 @@ public class WebView extends AbsoluteLayout
mPreventDrag = PREVENT_DRAG_NO; mPreventDrag = PREVENT_DRAG_NO;
} }
if (mPreventDrag == PREVENT_DRAG_NO) { if (mPreventDrag == PREVENT_DRAG_NO) {
mPrivateHandler.sendMessageDelayed( if (mTouchMode == TOUCH_INIT_MODE) {
mPrivateHandler.obtainMessage( mPrivateHandler.sendMessageDelayed(
RELEASE_SINGLE_TAP), mPrivateHandler.obtainMessage(
ViewConfiguration.getDoubleTapTimeout()); RELEASE_SINGLE_TAP),
ViewConfiguration.getDoubleTapTimeout());
} else {
mTouchMode = TOUCH_DONE_MODE;
doShortPress();
}
} }
break; break;
} }