Added better one-handed width for large screen devices

This commit is contained in:
pdroidandroid@gmail.com 2022-03-01 12:13:03 +01:00
parent 2030d82854
commit 53a904af1e
3 changed files with 5 additions and 2 deletions

View file

@ -185,7 +185,7 @@ public final class ResourceUtils {
public static int getKeyboardWidth(final Resources res, final SettingsValues settingsValues) {
final int defaultKeyboardWidth = getDefaultKeyboardWidth(res);
if (settingsValues.mOneHandedModeEnabled) {
return (int) res.getFraction(R.fraction.config_one_handed_mode_width_ratio,
return (int) res.getFraction(R.fraction.config_one_handed_mode_width,
defaultKeyboardWidth, defaultKeyboardWidth);
}
return defaultKeyboardWidth;

View file

@ -22,6 +22,9 @@
<resources>
<dimen name="config_key_hysteresis_distance">40.0dp</dimen>
<!-- Amount of width reduction in one-handed mode -->
<fraction name="config_one_handed_mode_width">76%</fraction>
<!-- Preferable keyboard height in absolute scale: 48.0mm -->
<!-- This config_default_keyboard_height value should match with keyboard-heights.xml -->
<dimen name="config_default_keyboard_height">302.4dp</dimen>

View file

@ -25,7 +25,7 @@
<dimen name="config_key_hysteresis_distance">8.0dp</dimen>
<!-- Amount of width reduction in one-handed mode -->
<fraction name="config_one_handed_mode_width_ratio">86%</fraction>
<fraction name="config_one_handed_mode_width">86%</fraction>
<!-- Preferable keyboard height in absolute scale: 1.285in -->
<!-- This config_default_keyboard_height value should match with keyboard-heights.xml -->