diff options
author | Cary Clark <cary@android.com> | 2009-09-08 14:15:07 -0400 |
---|---|---|
committer | Cary Clark <cary@android.com> | 2009-09-08 14:15:07 -0400 |
commit | aa7caa60324d69b5cd7bf3cbd8eeac2a63ad7a99 (patch) | |
tree | a7feecfefffa7d30a3885407e346c1b6e02446e1 /core | |
parent | 377c5c15f8fea14b575b6b0f14ac7fd3a4d44b3a (diff) | |
download | frameworks_base-aa7caa60324d69b5cd7bf3cbd8eeac2a63ad7a99.zip frameworks_base-aa7caa60324d69b5cd7bf3cbd8eeac2a63ad7a99.tar.gz frameworks_base-aa7caa60324d69b5cd7bf3cbd8eeac2a63ad7a99.tar.bz2 |
don't fling if there's nowhere to go
Add a test to doFling() to return quickly if the fling has
no effect. For simplicity, only test for horizontal or vertical
flings.
The man purpose is to avoid suspending webkit until the fling
animation is complete when the purpose of the touch drag is
to activate a touch event, like a swipe in superpudu.
fixes http://b/issue?id=2052852
Diffstat (limited to 'core')
-rw-r--r-- | core/java/android/webkit/WebView.java | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java index db6966a..8a986fa 100644 --- a/core/java/android/webkit/WebView.java +++ b/core/java/android/webkit/WebView.java @@ -4605,6 +4605,10 @@ public class WebView extends AbsoluteLayout vx = vx * 3 / 4; vy = vy * 3 / 4; } + if ((maxX == 0 && vy == 0) || (maxY == 0 && vx == 0)) { + WebViewCore.resumeUpdate(mWebViewCore); + return; + } float currentVelocity = mScroller.getCurrVelocity(); if (mLastVelocity > 0 && currentVelocity > 0) { float deltaR = (float) (Math.abs(Math.atan2(mLastVelY, mLastVelX) @@ -4621,7 +4625,10 @@ public class WebView extends AbsoluteLayout } } else if (DebugFlags.WEB_VIEW) { Log.v(LOGTAG, "doFling start last=" + mLastVelocity - + " current=" + currentVelocity); + + " current=" + currentVelocity + + " vx=" + vx + " vy=" + vy + + " maxX=" + maxX + " maxY=" + maxY + + " mScrollX=" + mScrollX + " mScrollY=" + mScrollY); } mLastVelX = vx; mLastVelY = vy; |