From db8dcd8b024202a131f5ebbf2b685972b044dda1 Mon Sep 17 00:00:00 2001 From: Amith Yamasani Date: Thu, 22 Apr 2010 13:25:47 -0700 Subject: Only use fullscreen mode if the number of inches in height is less than 2.5in --- java/src/com/android/inputmethod/latin/LatinIME.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'java/src/com/android/inputmethod') 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) { -- cgit v1.2.3-83-g751a