From edb528ef52fd9b0148d559c5e596cf9bb9a6d2f9 Mon Sep 17 00:00:00 2001 From: Mangesh Ghiware Date: Wed, 12 Oct 2011 14:25:41 -0700 Subject: Add setting for configuring zoom level on double-tap. In overview mode, text wrap is done at reading level scale. If user changes double-tap zoom in overview mode, reflow text at the new scale. In any other mode, a double-tap will take user to overview mode, at which point, the text will be reflowed at the updated reading level scale. Bug: 5312461 Change-Id: I29be34a32246019101a9a875e1758e22b5af2bd3 --- core/java/android/webkit/WebSettings.java | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'core/java/android/webkit/WebSettings.java') diff --git a/core/java/android/webkit/WebSettings.java b/core/java/android/webkit/WebSettings.java index 9c44138f03e5..f1c2bdead14d 100644 --- a/core/java/android/webkit/WebSettings.java +++ b/core/java/android/webkit/WebSettings.java @@ -211,6 +211,7 @@ public class WebSettings { private ZoomDensity mDefaultZoom = ZoomDensity.MEDIUM; private RenderPriority mRenderPriority = RenderPriority.NORMAL; private int mOverrideCacheMode = LOAD_DEFAULT; + private int mDoubleTapZoom = 100; private boolean mSaveFormData = true; private boolean mAutoFillEnabled = false; private boolean mSavePassword = true; @@ -768,6 +769,27 @@ public class WebSettings { return closestSize != null ? closestSize : TextSize.NORMAL; } + /** + * Set the double-tap zoom of the page in percent. Default is 100. + * @param doubleTapZoom A percent value for increasing or decreasing the double-tap zoom. + * @hide + */ + public void setDoubleTapZoom(int doubleTapZoom) { + if (mDoubleTapZoom != doubleTapZoom) { + mDoubleTapZoom = doubleTapZoom; + mWebView.updateDoubleTapZoom(); + } + } + + /** + * Get the double-tap zoom of the page in percent. + * @return A percent value describing the double-tap zoom. + * @hide + */ + public int getDoubleTapZoom() { + return mDoubleTapZoom; + } + /** * Set the default zoom density of the page. This should be called from UI * thread. -- cgit v1.2.3