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

Commit 760bf7de authored by Mangesh Ghiware's avatar Mangesh Ghiware Committed by Android (Google) Code Review
Browse files

Merge "Fix issue# 5492404: Reading level check thread error."

parents 2b41c2f3 bb99e28c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -777,7 +777,7 @@ public class WebSettings {
    public void setDoubleTapZoom(int doubleTapZoom) {
        if (mDoubleTapZoom != doubleTapZoom) {
            mDoubleTapZoom = doubleTapZoom;
            mWebView.updateDoubleTapZoom();
            mWebView.updateDoubleTapZoom(doubleTapZoom);
        }
    }

+2 −2
Original line number Diff line number Diff line
@@ -2995,8 +2995,8 @@ public class WebView extends AbsoluteLayout
    /**
     * Update the double-tap zoom.
     */
    /* package */ void updateDoubleTapZoom() {
        mZoomManager.updateDoubleTapZoom();
    /* package */ void updateDoubleTapZoom(int doubleTapZoom) {
        mZoomManager.updateDoubleTapZoom(doubleTapZoom);
    }

    private int computeRealHorizontalScrollRange() {
+9 −5
Original line number Diff line number Diff line
@@ -151,6 +151,12 @@ class ZoomManager {
     */
    private float mDisplayDensity;

    /*
     * The factor that is used to tweak the zoom scale on a double-tap,
     * and can be changed via WebSettings. Range is from 0.75f to 1.25f.
     */
    private float mDoubleTapZoomFactor = 1.0f;

    /*
     * The scale factor that is used as the minimum increment when going from
     * overview to reading level on a double tap.
@@ -314,10 +320,7 @@ class ZoomManager {
     * Returns the zoom scale used for reading text on a double-tap.
     */
    public final float getReadingLevelScale() {
        WebSettings settings = mWebView.getSettings();
        final float doubleTapZoomFactor = settings != null
            ? settings.getDoubleTapZoom() / 100.f : 1.0f;
        return mDisplayDensity * doubleTapZoomFactor;
        return mDisplayDensity * mDoubleTapZoomFactor;
    }

    public final float getInvDefaultScale() {
@@ -516,8 +519,9 @@ class ZoomManager {
        return mZoomScale != 0 || mInHWAcceleratedZoom;
    }

    public void updateDoubleTapZoom() {
    public void updateDoubleTapZoom(int doubleTapZoom) {
        if (mInZoomOverview) {
            mDoubleTapZoomFactor = doubleTapZoom / 100.0f;
            mTextWrapScale = getReadingLevelScale();
            refreshZoomScale(true);
        }