mirror of
https://gitlab.futo.org/keyboard/latinime.git
synced 2024-09-28 14:54:30 +01:00
Only use fullscreen mode if the number of inches in height is less than 2.5in
This commit is contained in:
parent
60d81e3a80
commit
db8dcd8b02
@ -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>
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user