Only use fullscreen mode if the number of inches in height is less than 2.5in

main
Amith Yamasani 2010-04-22 13:25:47 -07:00
parent 60d81e3a80
commit db8dcd8b02
2 changed files with 17 additions and 0 deletions

View File

@ -23,4 +23,7 @@
<dimen name="bubble_pointer_offset">22dip</dimen>
<dimen name="candidate_strip_height">42dip</dimen>
<dimen name="spacebar_vertical_correction">4dip</dimen>
<!-- If the screen height in landscape is larger than the below value, then the keyboard
will not go into extract (fullscreen) mode. -->
<dimen name="max_height_for_fullscreen">2.5in</dimen>
</resources>

View File

@ -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) {