Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d9b447ca authored by Michael Kolb's avatar Michael Kolb Committed by Android (Google) Code Review
Browse files

Merge "Add setting for on screen zoom buttons enables to use pinch to zoom...

Merge "Add setting for on screen zoom buttons   enables to use pinch to zoom without   showing the on screen buttons"
parents cbf16ebd 6fe3b421
Loading
Loading
Loading
Loading
+21 −0
Original line number Diff line number Diff line
@@ -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.
+2 −1
Original line number Diff line number Diff line
@@ -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;