summaryrefslogtreecommitdiffstats
path: root/core/java/android/webkit
diff options
context:
space:
mode:
authorGrace Kloba <klobag@google.com>2010-04-08 13:46:23 -0700
committerGrace Kloba <klobag@google.com>2010-04-09 08:51:47 -0700
commit9b6578071fbe042b5a77f621d1bdc76e92720e48 (patch)
tree1739e3516002bfd29b345124c93422665861b4c8 /core/java/android/webkit
parent9da7730d5f97270c356ee86298c5d6d45f39b264 (diff)
downloadframeworks_base-9b6578071fbe042b5a77f621d1bdc76e92720e48.zip
frameworks_base-9b6578071fbe042b5a77f621d1bdc76e92720e48.tar.gz
frameworks_base-9b6578071fbe042b5a77f621d1bdc76e92720e48.tar.bz2
Set mHeldMotionless to a new MOTIONLESS_IGNORE state
for fling, this way we will trigger animateScroll during fling for the faster performance. We also avoid keep removing/sending DRAG_HELD_MOTIONLESS message during fling. Fix http://b/issue?id=2574172
Diffstat (limited to 'core/java/android/webkit')
-rw-r--r--core/java/android/webkit/WebView.java11
1 files changed, 8 insertions, 3 deletions
diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java
index 61ff86c..bbe52a3 100644
--- a/core/java/android/webkit/WebView.java
+++ b/core/java/android/webkit/WebView.java
@@ -475,6 +475,7 @@ public class WebView extends AbsoluteLayout
private static final int MOTIONLESS_FALSE = 0;
private static final int MOTIONLESS_PENDING = 1;
private static final int MOTIONLESS_TRUE = 2;
+ private static final int MOTIONLESS_IGNORE = 3;
private int mHeldMotionless;
// whether support multi-touch
@@ -4923,9 +4924,6 @@ public class WebView extends AbsoluteLayout
case TOUCH_DRAG_MODE:
mPrivateHandler.removeMessages(DRAG_HELD_MOTIONLESS);
mPrivateHandler.removeMessages(AWAKEN_SCROLL_BARS);
- mHeldMotionless = MOTIONLESS_TRUE;
- // redraw in high-quality, as we're done dragging
- invalidate();
// if the user waits a while w/o moving before the
// up, we don't want to do a fling
if (eventTime - mLastTouchTime <= MIN_FLING_TIME) {
@@ -4937,9 +4935,16 @@ public class WebView extends AbsoluteLayout
+ mDeferTouchProcess);
}
mVelocityTracker.addMovement(ev);
+ // set to MOTIONLESS_IGNORE so that it won't keep
+ // removing and sending message in
+ // drawCoreAndCursorRing()
+ mHeldMotionless = MOTIONLESS_IGNORE;
doFling();
break;
}
+ // redraw in high-quality, as we're done dragging
+ mHeldMotionless = MOTIONLESS_TRUE;
+ invalidate();
// fall through
case TOUCH_DRAG_START_MODE:
// TOUCH_DRAG_START_MODE should not happen for the real