From e832b63c97c18c8170643c5a1c565e07893c5368 Mon Sep 17 00:00:00 2001 From: Mangesh Ghiware Date: Wed, 16 Nov 2011 11:46:39 -0800 Subject: Revert change to setInitialScale() to take display density into account. Updated WebView documentation to clarify this behavior. Additionally, if target-densityDpi is specified in the meta viewport tag, update the display density in ZoomManager. Bug: 5477652 Bug: 5327492 Change-Id: I176e87489f76a2ee6595d76a006e302b07595de1 --- core/java/android/webkit/WebView.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'core/java/android/webkit/WebView.java') diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java index 7249497120b2..342c6c5835b6 100644 --- a/core/java/android/webkit/WebView.java +++ b/core/java/android/webkit/WebView.java @@ -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. */ -- cgit v1.2.3