From 2eb615dbf6b8326c99db175bf7eec2eb13168546 Mon Sep 17 00:00:00 2001 From: Jules Aguillon Date: Wed, 16 Mar 2022 13:09:10 +0100 Subject: [PATCH] Show the switching key if there's several languages Ensure the switching key is shown when there's several subtypes enabled, even if Android says not to show it. --- srcs/juloo.keyboard2/Keyboard2.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/srcs/juloo.keyboard2/Keyboard2.java b/srcs/juloo.keyboard2/Keyboard2.java index 83edb21..70c0892 100644 --- a/srcs/juloo.keyboard2/Keyboard2.java +++ b/srcs/juloo.keyboard2/Keyboard2.java @@ -92,11 +92,12 @@ public class Keyboard2 extends InputMethodService private void refreshAccentsOption(InputMethodManager imm, InputMethodSubtype subtype) { HashSet extra_keys = new HashSet(); + List enabled_subtypes = getEnabledSubtypes(imm); switch (_config.accents) { case 1: extra_keys_of_subtype(extra_keys, subtype); - for (InputMethodSubtype s : getEnabledSubtypes(imm)) + for (InputMethodSubtype s : enabled_subtypes) extra_keys_of_subtype(extra_keys, s); break; case 2: @@ -107,6 +108,8 @@ public class Keyboard2 extends InputMethodService default: throw new IllegalArgumentException(); } _config.extra_keys = extra_keys; + if (enabled_subtypes.size() > 1) + _config.shouldOfferSwitchingToNextInputMethod = true; } private void refreshSubtypeLegacyFallback()