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:
@@ -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.
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user