diff options
| author | Grace Kloba <klobag@google.com> | 2010-03-09 10:55:04 -0800 |
|---|---|---|
| committer | Grace Kloba <klobag@google.com> | 2010-03-09 13:14:04 -0800 |
| commit | 2d17e1d212ed88fdeca4b27bf04c17c56bd5dee1 (patch) | |
| tree | a5eb58b8ce407755fbce942390ee53737d29088f /core/java/android/webkit/WebView.java | |
| parent | 1c6743c40fcafdc77ad22557bb7a4b761029d13f (diff) | |
Add an api to set WebView over scroll background.
If the WebView doesn't support zoom, or WebView does
not use wide viewport and horizontal is just fit,
don't do over scroll.
Fix http://b/issue?id=2498403
Fix http://b/issue?id=2497901
Diffstat (limited to 'core/java/android/webkit/WebView.java')
| -rw-r--r-- | core/java/android/webkit/WebView.java | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java index 655c4c5bb3ce..6f6ee1d11c0b 100644 --- a/core/java/android/webkit/WebView.java +++ b/core/java/android/webkit/WebView.java @@ -2305,9 +2305,11 @@ public class WebView extends AbsoluteLayout boolean clampedY) { mInOverScrollMode = false; int maxX = computeMaxScrollX(); - if (Math.abs(mMinZoomScale - mMaxZoomScale) < 0.01f && maxX == 0) { - // do not over scroll x if the page can't be zoomed and it just fits - // the screen + if (maxX == 0 && (Math.abs(mMinZoomScale - mMaxZoomScale) < 0.01f) + || !getSettings().supportZoom() + || !getSettings().getUseWideViewPort()) { + // do not over scroll x if the page just fits the screen and it + // can't zoom or the view doesn't use wide viewport scrollX = pinLocX(scrollX); } else if (scrollX < 0 || scrollX > maxX) { mInOverScrollMode = true; @@ -3112,7 +3114,8 @@ public class WebView extends AbsoluteLayout } int saveCount = canvas.save(); - if (mInOverScrollMode) { + if (mInOverScrollMode + && getSettings().getUseSystemOverscrollBackground()) { if (mOverScrollBackground == null) { mOverScrollBackground = new Paint(); Bitmap bm = BitmapFactory.decodeResource( |
