Merge "Tune the threshold of fullscreen mode from 2.5in to 500dip"
This commit is contained in:
commit
ed3758e33c
2 changed files with 8 additions and 7 deletions
|
@ -95,8 +95,9 @@
|
||||||
<integer name="center_suggestion_percentile">36</integer>
|
<integer name="center_suggestion_percentile">36</integer>
|
||||||
|
|
||||||
<!-- If the screen height in landscape is larger than the below value, then the keyboard
|
<!-- If the screen height in landscape is larger than the below value, then the keyboard
|
||||||
will not go into extract (fullscreen) mode. -->
|
will not go into extract (fullscreen) mode.
|
||||||
<dimen name="max_height_for_fullscreen">2.5in</dimen>
|
Current value is approximate to 7-inch tablet height - system navigation bar height. -->
|
||||||
|
<dimen name="max_height_for_fullscreen">500dip</dimen>
|
||||||
|
|
||||||
<dimen name="key_hysteresis_distance">0.05in</dimen>
|
<dimen name="key_hysteresis_distance">0.05in</dimen>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
@ -1003,12 +1003,12 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
|
||||||
if ((imeOptions & EditorInfo.IME_FLAG_NO_EXTRACT_UI) != 0)
|
if ((imeOptions & EditorInfo.IME_FLAG_NO_EXTRACT_UI) != 0)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
final Resources res = mResources;
|
final Resources res = mResources;
|
||||||
DisplayMetrics dm = res.getDisplayMetrics();
|
final DisplayMetrics dm = res.getDisplayMetrics();
|
||||||
float displayHeight = dm.heightPixels;
|
// If the display is more than X DIP high, don't go to fullscreen mode
|
||||||
// If the display is more than X inches high, don't go to fullscreen mode
|
final int threshold = res.getDimensionPixelSize(R.dimen.max_height_for_fullscreen);
|
||||||
float dimen = res.getDimension(R.dimen.max_height_for_fullscreen);
|
if (dm.heightPixels >= threshold) {
|
||||||
if (displayHeight > dimen) {
|
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
return super.onEvaluateFullscreenMode();
|
return super.onEvaluateFullscreenMode();
|
||||||
|
|
Loading…
Reference in a new issue