diff options
| author | Jules Aguillon | 2022-06-06 15:40:32 +0200 |
|---|---|---|
| committer | Jules Aguillon | 2022-06-06 16:15:35 +0200 |
| commit | b236a74b648399c92675558e2674478fc24c3be5 (patch) | |
| tree | 864bd8f7eebb2d5b5fd501f661cd556e224ba56e /srcs | |
| parent | f6338a652b29767405894ae8f5ea41517767c557 (diff) | |
| download | unexpected-keyboard-b236a74b648399c92675558e2674478fc24c3be5.tar.gz unexpected-keyboard-b236a74b648399c92675558e2674478fc24c3be5.zip | |
Increase horizontal spacing in landscape mode
Space between the keys and margin on the left and right edges of the
screen.
Diffstat (limited to 'srcs')
| -rw-r--r-- | srcs/juloo.keyboard2/Config.java | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/srcs/juloo.keyboard2/Config.java b/srcs/juloo.keyboard2/Config.java index 552aadf..43c11a6 100644 --- a/srcs/juloo.keyboard2/Config.java +++ b/srcs/juloo.keyboard2/Config.java @@ -97,9 +97,12 @@ final class Config // 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; + // Increase the horizontal space between the keys + float horizontalIntervalScale = 1.f; if (res.getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) // Landscape mode { keyboardHeightPercent = prefs.getInt("keyboard_height_landscape", 50); + horizontalIntervalScale = 2.f; } else { @@ -120,11 +123,15 @@ final class Config longPressInterval = prefs.getInt("longpress_interval", (int)longPressInterval); marginBottom = getDipPref(dm, prefs, "margin_bottom", marginBottom); keyVerticalInterval = getDipPref(dm, prefs, "key_vertical_space", keyVerticalInterval); - keyHorizontalInterval = getDipPref(dm, prefs, "key_horizontal_space", keyHorizontalInterval); + keyHorizontalInterval = + getDipPref(dm, prefs, "key_horizontal_space", keyHorizontalInterval) + * horizontalIntervalScale; // Do not substract keyVerticalInterval from keyHeight because this is done // during rendered. keyHeight = dm.heightPixels * keyboardHeightPercent / 100 / 4; - horizontalMargin = getDipPref(dm, prefs, "horizontal_margin", horizontalMargin) + res.getDimension(R.dimen.extra_horizontal_margin); + horizontalMargin = + getDipPref(dm, prefs, "horizontal_margin", horizontalMargin) + + res.getDimension(R.dimen.extra_horizontal_margin); preciseRepeat = prefs.getBoolean("precise_repeat", preciseRepeat); lockable_modifiers.clear(); if (prefs.getBoolean("lockable_shift", true)) lockable_modifiers.add(KeyValue.Modifier.SHIFT); |
