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

Commit dd97f0cb authored by Derek Sollenberger's avatar Derek Sollenberger Committed by Android (Google) Code Review
Browse files

Merge "Only show double-tap tip if the feature is enabled."

parents 64f11630 515f6d8d
Loading
Loading
Loading
Loading
+9 −7
Original line number Original line Diff line number Diff line
@@ -40,6 +40,7 @@ class ZoomControlEmbedded implements ZoomControlBase {


            mZoomButtonsController.setVisible(true);
            mZoomButtonsController.setVisible(true);


            if (mZoomManager.isDoubleTapEnabled()) {
                WebSettings settings = mWebView.getSettings();
                WebSettings settings = mWebView.getSettings();
                int count = settings.getDoubleTapToastCount();
                int count = settings.getDoubleTapToastCount();
                if (mZoomManager.isInZoomOverview() && count > 0) {
                if (mZoomManager.isInZoomOverview() && count > 0) {
@@ -50,6 +51,7 @@ class ZoomControlEmbedded implements ZoomControlBase {
                }
                }
            }
            }
        }
        }
    }


    public void hide() {
    public void hide() {
        if (mZoomButtonsController != null) {
        if (mZoomButtonsController != null) {
+6 −1
Original line number Original line Diff line number Diff line
@@ -510,6 +510,11 @@ class ZoomManager {
        }
        }
    }
    }


    public boolean isDoubleTapEnabled() {
        WebSettings settings = mWebView.getSettings();
        return settings != null && settings.getUseWideViewPort();
    }

    /**
    /**
     * The double tap gesture can result in different behaviors depending on the
     * The double tap gesture can result in different behaviors depending on the
     * content that is tapped.
     * content that is tapped.
@@ -528,7 +533,7 @@ class ZoomManager {
     */
     */
    public void handleDoubleTap(float lastTouchX, float lastTouchY) {
    public void handleDoubleTap(float lastTouchX, float lastTouchY) {
        WebSettings settings = mWebView.getSettings();
        WebSettings settings = mWebView.getSettings();
        if (settings == null || settings.getUseWideViewPort() == false) {
        if (!isDoubleTapEnabled()) {
            return;
            return;
        }
        }