summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Grace Kloba <klobag@google.com> 2009-08-13 11:01:21 -0700
committer Grace Kloba <klobag@google.com> 2009-08-13 15:27:52 -0700
commit455e3af1f82629d274447cd5d08d3c8dc1c58967 (patch)
tree1fd9feee48907cec9e712a30a4f24710e8427468
parent0749dcd19301fe4093f9cf8677c722d17bceabfb (diff)
Fix #2048199. Enable zoom control in the overview mode. When "+" is pressed,
treat it as double click in the middle of the page.
-rw-r--r--core/java/android/webkit/WebView.java20
1 files changed, 14 insertions, 6 deletions
diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java
index 28e9b6d566b5..be9daa531ebe 100644
--- a/core/java/android/webkit/WebView.java
+++ b/core/java/android/webkit/WebView.java
@@ -743,7 +743,7 @@ public class WebView extends AbsoluteLayout
private void updateZoomButtonsEnabled() {
boolean canZoomIn = mActualScale < mMaxZoomScale;
- boolean canZoomOut = mActualScale > mMinZoomScale;
+ boolean canZoomOut = mActualScale > mMinZoomScale && !mInZoomOverview;
if (!canZoomIn && !canZoomOut) {
// Hide the zoom in and out buttons, as well as the fit to page
// button, if the page cannot zoom
@@ -3890,7 +3890,7 @@ public class WebView extends AbsoluteLayout
nativeHideCursor();
}
WebSettings settings = getSettings();
- if (settings.supportZoom() && !mInZoomOverview
+ if (settings.supportZoom()
&& settings.getBuiltInZoomControls()
&& !mZoomButtonsController.isVisible()
&& (canZoomScrollOut() ||
@@ -3959,7 +3959,7 @@ public class WebView extends AbsoluteLayout
mUserScroll = true;
}
- if (!getSettings().getBuiltInZoomControls() && !mInZoomOverview) {
+ if (!getSettings().getBuiltInZoomControls()) {
boolean showPlusMinus = mMinZoomScale < mMaxZoomScale;
boolean showMagnify = canZoomScrollOut();
if (mZoomControls != null && (showPlusMinus || showMagnify)) {
@@ -4544,9 +4544,17 @@ public class WebView extends AbsoluteLayout
// TODO: alternatively we can disallow this during draw history mode
switchOutDrawHistory();
// Center zooming to the center of the screen.
- mZoomCenterX = getViewWidth() * .5f;
- mZoomCenterY = getViewHeight() * .5f;
- return zoomWithPreview(mActualScale * 1.25f);
+ if (mInZoomOverview) {
+ // if in overview mode, bring it back to normal mode
+ mLastTouchX = getViewWidth() * .5f;
+ mLastTouchY = getViewHeight() * .5f;
+ doDoubleTap();
+ return true;
+ } else {
+ mZoomCenterX = getViewWidth() * .5f;
+ mZoomCenterY = getViewHeight() * .5f;
+ return zoomWithPreview(mActualScale * 1.25f);
+ }
}
/**