From db8dcd8b024202a131f5ebbf2b685972b044dda1 Mon Sep 17 00:00:00 2001 From: Amith Yamasani Date: Thu, 22 Apr 2010 13:25:47 -0700 Subject: [PATCH] Only use fullscreen mode if the number of inches in height is less than 2.5in --- java/res/values/dimens.xml | 3 +++ .../com/android/inputmethod/latin/LatinIME.java | 14 ++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/java/res/values/dimens.xml b/java/res/values/dimens.xml index 5b2095c0e..f057c16a7 100644 --- a/java/res/values/dimens.xml +++ b/java/res/values/dimens.xml @@ -23,4 +23,7 @@ 22dip 42dip 4dip + + 2.5in \ No newline at end of file diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index 38313c05c..db0a822ed 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -42,6 +42,7 @@ import android.preference.PreferenceManager; import android.speech.SpeechRecognizer; import android.text.ClipboardManager; import android.text.TextUtils; +import android.util.DisplayMetrics; import android.util.Log; import android.util.PrintWriterPrinter; import android.util.Printer; @@ -718,6 +719,19 @@ public class LatinIME extends InputMethodService } } + @Override + public boolean onEvaluateFullscreenMode() { + DisplayMetrics dm = getResources().getDisplayMetrics(); + float displayHeight = dm.heightPixels; + // If the display is more than X inches high, don't go to fullscreen mode + float dimen = getResources().getDimension(R.dimen.max_height_for_fullscreen); + if (displayHeight > dimen) { + return false; + } else { + return super.onEvaluateFullscreenMode(); + } + } + @Override public boolean onKeyDown(int keyCode, KeyEvent event) { switch (keyCode) {