From 2a50a4a129f96784af15f82c0a5d9b09d780dd61 Mon Sep 17 00:00:00 2001 From: Jules Aguillon Date: Fri, 30 May 2025 00:08:59 +0200 Subject: 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. --- srcs/juloo.keyboard2/Config.java | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'srcs/juloo.keyboard2/Config.java') 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); -- cgit v1.2.3