Merge change I86773fbb into eclair-mr2
* changes:
If overview width is the same as the current width, don't change the mode when double tap or zoom out.
diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java
index 5f7fdda..1899a6e 100644
--- a/core/java/android/webkit/WebView.java
+++ b/core/java/android/webkit/WebView.java
@@ -4682,7 +4682,9 @@
switchOutDrawHistory();
float scale = mActualScale * 0.8f;
if (scale < (mMinZoomScale + 0.1f)
- && mWebViewCore.getSettings().getUseWideViewPort()) {
+ && mWebViewCore.getSettings().getUseWideViewPort()
+ && mZoomOverviewWidth > Math.ceil(getViewWidth()
+ * mInvActualScale)) {
// when zoom out to min scale, switch to overview mode
doDoubleTap();
return true;
@@ -4829,9 +4831,15 @@
}
settings.setDoubleTapToastCount(0);
if (mInZoomOverview) {
- // Force the titlebar fully reveal in overview mode
- if (mScrollY < getTitleHeight()) mScrollY = 0;
- zoomWithPreview((float) getViewWidth() / mZoomOverviewWidth);
+ float newScale = (float) getViewWidth() / mZoomOverviewWidth;
+ if (Math.abs(mActualScale - newScale) < 0.01f) {
+ // reset mInZoomOverview to false if scale doesn't change
+ mInZoomOverview = false;
+ } else {
+ // Force the titlebar fully reveal in overview mode
+ if (mScrollY < getTitleHeight()) mScrollY = 0;
+ zoomWithPreview(newScale);
+ }
} else {
// mLastTouchX and mLastTouchY are the point in the current viewport
int contentX = viewToContentX((int) mLastTouchX + mScrollX);