diff options
| author | Shimeng (Simon) Wang <swang@google.com> | 2011-06-09 13:51:55 -0700 |
|---|---|---|
| committer | Shimeng (Simon) Wang <swang@google.com> | 2011-06-09 13:51:55 -0700 |
| commit | 136c20b88e14fffe570cdbd67fa7d227ab34bf1f (patch) | |
| tree | 6fd4f08aa244c46108de3d881467b64bc64ccc5e /core/java/android/webkit/ZoomManager.java | |
| parent | 0df77e6d4283ee0ab2e636419b7e8c1a191371da (diff) | |
Better handle double tap for smooth reflow and zoom.
In case it's the first time to reflow or the page is in zoom overview
mode, let the reflow and zoom happen at the same time to avoid the
need of double tapping twice.
Also fix the viewport width to webview's original width for mobile
site.
issue: 4482888
Change-Id: Ic7c73a9eb3f75fd68322f7f4da14141126e75ad8
Diffstat (limited to 'core/java/android/webkit/ZoomManager.java')
| -rw-r--r-- | core/java/android/webkit/ZoomManager.java | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/core/java/android/webkit/ZoomManager.java b/core/java/android/webkit/ZoomManager.java index 780339143620..fe6fb2f33f39 100644 --- a/core/java/android/webkit/ZoomManager.java +++ b/core/java/android/webkit/ZoomManager.java @@ -634,8 +634,17 @@ class ZoomManager { } else { newTextWrapScale = mActualScale; } + final boolean firstTimeReflow = !exceedsMinScaleIncrement(mActualScale, mTextWrapScale); + if (firstTimeReflow || mInZoomOverview) { + // In case first time reflow or in zoom overview mode, let reflow and zoom + // happen at the same time. + mTextWrapScale = newTextWrapScale; + } if (settings.isNarrowColumnLayout() - && exceedsMinScaleIncrement(mTextWrapScale, newTextWrapScale)) { + && exceedsMinScaleIncrement(mTextWrapScale, newTextWrapScale) + && !firstTimeReflow + && !mInZoomOverview) { + // Reflow only. mTextWrapScale = newTextWrapScale; refreshZoomScale(true); } else if (!mInZoomOverview && willScaleTriggerZoom(getZoomOverviewScale())) { |
