From e103e90fa1fe7c440a99d3f5484adc45097f3caa Mon Sep 17 00:00:00 2001 From: Mindy Pereira Date: Mon, 14 Nov 2011 11:16:35 -0800 Subject: [PATCH] Dont take density into account when setting initial zoom values. WebView takes screen density into account when setting the initial webview zoom value as of cl: https://android-git.corp.google.com/g/#/c/146916/ Fixes b/5593688 Message text size is set to Large in Email Change-Id: I442eb91c825a7ad7a42d3d2772b625c662df6ec1 --- .../android/email/activity/MessageViewFragmentBase.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/com/android/email/activity/MessageViewFragmentBase.java b/src/com/android/email/activity/MessageViewFragmentBase.java index 1bfbd46e1..7b4ea8479 100644 --- a/src/com/android/email/activity/MessageViewFragmentBase.java +++ b/src/com/android/email/activity/MessageViewFragmentBase.java @@ -515,14 +515,14 @@ public abstract class MessageViewFragmentBase extends Fragment implements View.O /** * Returns the zoom scale (in percent) which is a combination of the user setting - * (tiny, small, normal, large, huge) and the device density. The intention + * (tiny, small, normal, large, huge). The intention * is for the text to be physically equal in size over different density - * screens. + * screens. We do not need to multiply by the density as webview already takes this + * into account when setting the initial scale. */ private int getWebViewZoom() { - float density = mContext.getResources().getDisplayMetrics().density; int zoom = Preferences.getPreferences(mContext).getTextZoom(); - return (int) (ZOOM_SCALE_ARRAY[zoom] * density * 100); + return (int) (ZOOM_SCALE_ARRAY[zoom] * 100); } private void initContactStatusViews() {