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

Commit c9c17740 authored by Wysie's avatar Wysie Committed by Steve Kondik
Browse files

Made some changes to core/java/android/webkit/WebSettings.java and...

Made some changes to core/java/android/webkit/WebSettings.java and WebView.java to allow hiding of zoom controls. Added methods instead of modifying existing ones, so it should not break any 3rd party apps.

Change-Id: I7042daffa8fc6441c6a374f6a050acbb27ae663a
parent 38a876f0
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -425,6 +425,11 @@ public class WebSettings {
        return mNavDump;
    }
    
    //Wysie    
    public void showZoomControls(boolean value) {
        mWebView.showZoomControls(value);
    }

    /**
     * Set whether the WebView supports zoom
     */
+21 −9
Original line number Diff line number Diff line
@@ -775,6 +775,9 @@ public class WebView extends AbsoluteLayout

    private int mBackgroundColor = Color.WHITE;
    
    //Wysie
    private boolean showZoomControls = true;

    // Used to notify listeners of a new picture.
    private PictureListener mPictureListener;
    /**
@@ -946,6 +949,11 @@ public class WebView extends AbsoluteLayout
        updateMultiTouchSupport(context);
    }
    
    //Wysie
    void showZoomControls(boolean value) {
        showZoomControls = value;
    }

    void updateMultiTouchSupport(Context context) {
        WebSettings settings = getSettings();
        mSupportMultiTouch = context.getPackageManager().hasSystemFeature(
@@ -961,6 +969,9 @@ public class WebView extends AbsoluteLayout

    private void updateZoomButtonsEnabled() {
        if (mZoomButtonsController == null) return;
        if (!showZoomControls) {
            mZoomButtonsController.getZoomControls().setVisibility(View.GONE);
        } else {
            boolean canZoomIn = mActualScale < mMaxZoomScale;
            boolean canZoomOut = mActualScale > mMinZoomScale && !mInZoomOverview;
                if (!canZoomIn && !canZoomOut) {
@@ -974,6 +985,7 @@ public class WebView extends AbsoluteLayout
                mZoomButtonsController.setZoomOutEnabled(canZoomOut);
            }
        }
    }

    private void init() {
        setWillNotDraw(false);