From f192dfcb32fa493b77152dab071daaa4ebdfa735 Mon Sep 17 00:00:00 2001 From: Jules Aguillon Date: Wed, 1 Jul 2026 01:09:36 +0200 Subject: [PATCH] Add landscape variant for the number and pin layouts (#1341) The number pane and the pin entry layouts are split in landscape orientation. Instead of inserting empty space in the middle of the layout, the numpad is duplicated. The other keys are not duplicated. --- res/xml/numeric_landscape.xml | 46 +++++++++++++++++++++++++++++ res/xml/pin_landscape.xml | 38 ++++++++++++++++++++++++ srcs/juloo.keyboard2/Keyboard2.java | 15 ++++++++-- 3 files changed, 96 insertions(+), 3 deletions(-) create mode 100644 res/xml/numeric_landscape.xml create mode 100644 res/xml/pin_landscape.xml diff --git a/res/xml/numeric_landscape.xml b/res/xml/numeric_landscape.xml new file mode 100644 index 0000000..f6b182d --- /dev/null +++ b/res/xml/numeric_landscape.xml @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/res/xml/pin_landscape.xml b/res/xml/pin_landscape.xml new file mode 100644 index 0000000..ea5c275 --- /dev/null +++ b/res/xml/pin_landscape.xml @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/srcs/juloo.keyboard2/Keyboard2.java b/srcs/juloo.keyboard2/Keyboard2.java index d8f8da6..0928468 100644 --- a/srcs/juloo.keyboard2/Keyboard2.java +++ b/srcs/juloo.keyboard2/Keyboard2.java @@ -110,6 +110,12 @@ public class Keyboard2 extends InputMethodService current_layout_unmodified()); } + KeyboardData loadNumericLayout() + { + return loadNumpad(_config.orientation_landscape ? + R.xml.numeric_landscape : R.xml.numeric); + } + KeyboardData loadPinentry(int layout_id) { return LayoutModifier.modify_pinentry(KeyboardData.load(getResources(), layout_id), @@ -231,8 +237,11 @@ public class Keyboard2 extends InputMethodService { switch (_config.selected_number_layout) { - case PIN: return loadPinentry(R.xml.pin); - case NUMBER: return loadNumpad(R.xml.numeric); + case PIN: + return loadPinentry(_config.orientation_landscape ? + R.xml.pin_landscape : R.xml.pin); + case NUMBER: + return loadNumericLayout(); } } return null; @@ -412,7 +421,7 @@ public class Keyboard2 extends InputMethodService break; case SWITCH_NUMERIC: - setSpecialLayout(loadNumpad(R.xml.numeric)); + setSpecialLayout(loadNumericLayout()); break; case SWITCH_EMOJI: