OSDN Git Service

Notify native that scrolling has stopped correctly
authorChris Craik <ccraik@google.com>
Sat, 3 Sep 2011 01:30:12 +0000 (18:30 -0700)
committerChris Craik <ccraik@google.com>
Sat, 3 Sep 2011 01:47:19 +0000 (18:47 -0700)
bug:5255022
bug:5218838

When the view starts scrolling, we tell native so it can block updates until the
view stops scrolling. This change fixes an issue where wouldn't tell native that
we stopped scrolling because the view didn't have room to move.

Change-Id: I5f2eec31493570937f7b8b2992a85283de06fb60

core/java/android/webkit/WebView.java

index 64fbae6..5bb0ef2 100644 (file)
@@ -6546,6 +6546,13 @@ public class WebView extends AbsoluteLayout
     }
 
     private void stopTouch() {
+        if (mScroller.isFinished() && !mSelectingText
+                && (mTouchMode == TOUCH_DRAG_MODE || mTouchMode == TOUCH_DRAG_LAYER_MODE)) {
+            WebViewCore.resumePriority();
+            WebViewCore.resumeUpdatePicture(mWebViewCore);
+            nativeSetIsScrolling(false);
+        }
+
         // we also use mVelocityTracker == null to tell us that we are
         // not "moving around", so we can take the slower/prettier
         // mode in the drawing code