From f80b6a06992ae08ca3601f4fbc6da550fd9ac730 Mon Sep 17 00:00:00 2001 From: "Tadashi G. Takaoka" Date: Wed, 7 Sep 2011 12:50:48 +0900 Subject: [PATCH] Tune the threshold of fullscreen mode from 2.5in to 500dip Bug: 5262767 Change-Id: Ie418ab766951a568d0f40822d8e8d719582749ba --- java/res/values/dimens.xml | 5 +++-- java/src/com/android/inputmethod/latin/LatinIME.java | 10 +++++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/java/res/values/dimens.xml b/java/res/values/dimens.xml index feb119db2..04deb4eee 100644 --- a/java/res/values/dimens.xml +++ b/java/res/values/dimens.xml @@ -95,8 +95,9 @@ 36 - 2.5in + will not go into extract (fullscreen) mode. + Current value is approximate to 7-inch tablet height - system navigation bar height. --> + 500dip 0.05in diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index 191ae5811..68d93295c 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -1003,12 +1003,12 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar if ((imeOptions & EditorInfo.IME_FLAG_NO_EXTRACT_UI) != 0) return false; } + final Resources res = mResources; - DisplayMetrics dm = res.getDisplayMetrics(); - float displayHeight = dm.heightPixels; - // If the display is more than X inches high, don't go to fullscreen mode - float dimen = res.getDimension(R.dimen.max_height_for_fullscreen); - if (displayHeight > dimen) { + final DisplayMetrics dm = res.getDisplayMetrics(); + // If the display is more than X DIP high, don't go to fullscreen mode + final int threshold = res.getDimensionPixelSize(R.dimen.max_height_for_fullscreen); + if (dm.heightPixels >= threshold) { return false; } else { return super.onEvaluateFullscreenMode();