Merge "Use dimension value instead of fixed constant in code."

This commit is contained in:
Shimeng (Simon) Wang
2010-09-21 09:36:35 -07:00
committed by Android (Google) Code Review
2 changed files with 6 additions and 1 deletions

View File

@@ -19,6 +19,7 @@ package android.webkit;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.content.res.Resources;
import android.os.Build;
import android.os.Handler;
import android.os.Message;
@@ -326,7 +327,9 @@ public class WebSettings {
// Detect tablet device for fixed viewport mode.
final DisplayMetrics metrics = context.getResources().getDisplayMetrics();
final int landscapeWidth = Math.max(metrics.widthPixels, metrics.heightPixels);
mUseFixedViewport = (metrics.density == 1.0f && landscapeWidth >= 800);
final int minTabletWidth = context.getResources().getDimensionPixelSize(
com.android.internal.R.dimen.min_xlarge_screen_width);
mUseFixedViewport = (metrics.density == 1.0f && landscapeWidth >= minTabletWidth);
mMaxFixedViewportWidth = (int) (landscapeWidth * 1.25);
if (sLockForLocaleSettings == null) {

View File

@@ -43,6 +43,8 @@
<dimen name="fastscroll_thumb_width">64dp</dimen>
<!-- Height of the fastscroll thumb -->
<dimen name="fastscroll_thumb_height">52dp</dimen>
<!-- Min width for a tablet device -->
<dimen name="min_xlarge_screen_width">800dp</dimen>
<!-- Default height of a key in the password keyboard for alpha -->
<dimen name="password_keyboard_key_height_alpha">56dip</dimen>
<!-- Default height of a key in the password keyboard for numeric -->