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

Commit 6be38548 authored by Wysie's avatar Wysie
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.
parent 3a5f2e4b
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -406,6 +406,11 @@ public class WebSettings {
        return mNavDump;
    }
    
    //Wysie    
    public void showZoomControls(boolean value) {
        mWebView.showZoomControls(value);
    }

    /**
     * Set whether the WebView supports zoom
     */
+13 −0
Original line number Diff line number Diff line
@@ -588,6 +588,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;
    /**
@@ -767,6 +770,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(
@@ -781,6 +789,10 @@ public class WebView extends AbsoluteLayout
    }

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

    private void init() {
        setWillNotDraw(false);