Merge "Add setting for on screen zoom buttons enables to use pinch to zoom without showing the on screen buttons"

This commit is contained in:
Michael Kolb
2010-09-07 11:50:54 -07:00
committed by Android (Google) Code Review
2 changed files with 23 additions and 1 deletions

View File

@@ -211,6 +211,7 @@ public class WebSettings {
private boolean mNavDump = false;
private boolean mSupportZoom = true;
private boolean mBuiltInZoomControls = false;
private boolean mDisplayZoomControls = true;
private boolean mAllowFileAccess = true;
private boolean mLoadWithOverviewMode = false;
private boolean mEnableSmoothTransition = false;
@@ -507,6 +508,26 @@ public class WebSettings {
return mBuiltInZoomControls;
}
/**
* Sets whether the on screen zoom buttons are used.
* A combination of built in zoom controls enabled
* and on screen zoom controls disabled allows for pinch to zoom
* to work without the on screen controls
* @hide
*/
public void setDisplayZoomControls(boolean enabled) {
mDisplayZoomControls = enabled;
mWebView.updateMultiTouchSupport(mContext);
}
/**
* Returns true if the on screen zoom buttons are being used.
* @hide
*/
public boolean getDisplayZoomControls() {
return mDisplayZoomControls;
}
/**
* Enable or disable file access within WebView. File access is enabled by
* default.

View File

@@ -856,7 +856,8 @@ class ZoomManager {
private ZoomControlBase getCurrentZoomControl() {
if (mWebView.getSettings() != null && mWebView.getSettings().supportZoom()) {
if (mWebView.getSettings().getBuiltInZoomControls()) {
if (mEmbeddedZoomControl == null) {
if ((mEmbeddedZoomControl == null)
&& mWebView.getSettings().getDisplayZoomControls()) {
mEmbeddedZoomControl = new ZoomControlEmbedded(this, mWebView);
}
return mEmbeddedZoomControl;