diff options
| author | Jules Aguillon | 2025-05-30 00:08:59 +0200 |
|---|---|---|
| committer | Jules Aguillon | 2025-05-30 20:07:26 +0200 |
| commit | 2a50a4a129f96784af15f82c0a5d9b09d780dd61 (patch) | |
| tree | 04b849b0ce6321d31b471cade70e8fde1f9d591a /srcs/juloo.keyboard2/Config.java | |
| parent | 9ab099175d8b0548eeeb77cc963dd1c13b9cbaf7 (diff) | |
| download | unexpected-keyboard-2a50a4a129f96784af15f82c0a5d9b09d780dd61.tar.gz unexpected-keyboard-2a50a4a129f96784af15f82c0a5d9b09d780dd61.zip | |
Fix high keyboard height making it overflows
The calculation for the size of each rows now avoid making the keyboard
bigger than the screen if the Keyboard Height option is unusually high.
The height calculation with the default settings is changed slightly, it
is now assuming that a layout is 3.95 rows high instead of 4. This is
because the bottom row is usually 0.95% the size of other rows.
Diffstat (limited to 'srcs/juloo.keyboard2/Config.java')
| -rw-r--r-- | srcs/juloo.keyboard2/Config.java | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/srcs/juloo.keyboard2/Config.java b/srcs/juloo.keyboard2/Config.java index 9f27e7e..d746ccb 100644 --- a/srcs/juloo.keyboard2/Config.java +++ b/srcs/juloo.keyboard2/Config.java @@ -42,7 +42,8 @@ public final class Config public long longPressInterval; public boolean keyrepeat_enabled; public float margin_bottom; - public float keyHeight; + public int keyboardHeightPercent; + public int screenHeightPixels; public float horizontal_margin; public float key_vertical_margin; public float key_horizontal_margin; @@ -110,9 +111,6 @@ public final class Config orientation_landscape = res.getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE; foldable_unfolded = foldableUnfolded; - // The height of the keyboard is relative to the height of the screen. - // This is the height of the keyboard if it have 4 rows. - int keyboardHeightPercent; float characterSizeScale = 1.f; String show_numpad_s = _prefs.getString("show_numpad", "never"); show_numpad = "always".equals(show_numpad_s); @@ -159,9 +157,7 @@ public final class Config borderConfig = _prefs.getBoolean("border_config", false); customBorderRadius = _prefs.getInt("custom_border_radius", 0) / 100.f; customBorderLineWidth = get_dip_pref(dm, "custom_border_line_width", 0); - // Do not substract key_vertical_margin from keyHeight because this is done - // during rendering. - keyHeight = dm.heightPixels * keyboardHeightPercent / 100 / 4; + screenHeightPixels = dm.heightPixels; horizontal_margin = get_dip_pref_oriented(dm, "horizontal_margin", 3, 28); double_tap_lock_shift = _prefs.getBoolean("lock_double_tap", false); |
