abouttreesummaryrefslogcommitdiff
path: root/srcs
diff options
context:
space:
mode:
authorJules Aguillon2022-03-16 13:09:10 +0100
committerJules Aguillon2022-03-16 13:09:10 +0100
commit2eb615dbf6b8326c99db175bf7eec2eb13168546 (patch)
treeec12ce9b32f122582d0cae6c4e0b5b83c8b99056 /srcs
parent2dae2105b2690fffb862ac16d843331d2f752926 (diff)
downloadunexpected-keyboard-2eb615dbf6b8326c99db175bf7eec2eb13168546.tar.gz
unexpected-keyboard-2eb615dbf6b8326c99db175bf7eec2eb13168546.zip
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.
Diffstat (limited to 'srcs')
-rw-r--r--srcs/juloo.keyboard2/Keyboard2.java5
1 files changed, 4 insertions, 1 deletions
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<String> extra_keys = new HashSet<String>();
+ List<InputMethodSubtype> 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()