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

Commit a2ded6ca authored by Shimeng (Simon) Wang's avatar Shimeng (Simon) Wang
Browse files

Use dimension value instead of fixed constant in code.

issue: 3003933
Change-Id: Iab802ccfb9a3d8c16f8884c433987c4a730f713c
parent 14bcc0e7
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -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) {
+2 −0
Original line number Diff line number Diff line
@@ -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 -->