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

Commit 163994c1 authored by Mangesh Ghiware's avatar Mangesh Ghiware Committed by Android Git Automerger
Browse files

am 55116350: am 4fdfdeed: Merge "Revert change to setInitialScale() to take...

am 55116350: am 4fdfdeed: Merge "Revert change to setInitialScale() to take display density into account." into ics-mr1

* commit '55116350':
  Revert change to setInitialScale() to take display density into account.
parents 8bc972a5 55116350
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -799,7 +799,7 @@ public class WebSettings {
    public void setDefaultZoom(ZoomDensity zoom) {
        if (mDefaultZoom != zoom) {
            mDefaultZoom = zoom;
            mWebView.updateDefaultZoomDensity(zoom.value);
            mWebView.adjustDefaultZoomDensity(zoom.value);
        }
    }

+8 −2
Original line number Diff line number Diff line
@@ -1341,9 +1341,13 @@ public class WebView extends AbsoluteLayout
        }
    }

    /* package */void updateDefaultZoomDensity(int zoomDensity) {
    /* package */ void adjustDefaultZoomDensity(int zoomDensity) {
        final float density = mContext.getResources().getDisplayMetrics().density
                * 100 / zoomDensity;
        updateDefaultZoomDensity(density);
    }

    /* package */ void updateDefaultZoomDensity(float density) {
        mNavSlop = (int) (16 * density);
        mZoomManager.updateDefaultZoomDensity(density);
    }
@@ -2469,7 +2473,9 @@ public class WebView extends AbsoluteLayout
     * Set the initial scale for the WebView. 0 means default. If
     * {@link WebSettings#getUseWideViewPort()} is true, it zooms out all the
     * way. Otherwise it starts with 100%. If initial scale is greater than 0,
     * WebView starts will this value as initial scale.
     * WebView starts with this value as initial scale.
     * Please note that unlike the scale properties in the viewport meta tag,
     * this method doesn't take the screen density into account.
     *
     * @param scaleInPercent The initial scale in percent.
     */
+4 −1
Original line number Diff line number Diff line
@@ -2329,6 +2329,9 @@ public final class WebViewCore {
            adjust = (float) mContext.getResources().getDisplayMetrics().densityDpi
                    / mViewportDensityDpi;
        }
        if (adjust != mWebView.getDefaultZoomScale()) {
            mWebView.updateDefaultZoomDensity(adjust);
        }
        int defaultScale = (int) (adjust * 100);

        if (mViewportInitialScale > 0) {
@@ -2539,7 +2542,7 @@ public final class WebViewCore {
    // called by JNI
    private void restoreScale(float scale, float textWrapScale) {
        if (mBrowserFrame.firstLayoutDone() == false) {
            mIsRestored = scale > 0;
            mIsRestored = true;
            mRestoredScale = scale;
            if (mSettings.getUseWideViewPort()) {
                mRestoredTextWrapScale = textWrapScale;
+1 −1
Original line number Diff line number Diff line
@@ -349,7 +349,7 @@ class ZoomManager {
    }

    public final void setInitialScaleInPercent(int scaleInPercent) {
        mInitialScale = scaleInPercent * mDisplayDensity * 0.01f;
        mInitialScale = scaleInPercent * 0.01f;
    }

    public final float computeScaleWithLimits(float scale) {