From 31d6a70dfb9c7ad3a72302bca2339f926e4593ee Mon Sep 17 00:00:00 2001 From: Jules Aguillon Date: Mon, 6 Jun 2022 00:23:45 +0200 Subject: Refactor: Remove KeyValue.name This makes KeyValue objects smaller. 'equals' and 'hashCode' are now implemented too. Key names are still used to recognise keys with special meaning, but not for comparing keys anymore. --- srcs/juloo.keyboard2/Keyboard2.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'srcs/juloo.keyboard2/Keyboard2.java') diff --git a/srcs/juloo.keyboard2/Keyboard2.java b/srcs/juloo.keyboard2/Keyboard2.java index 32a27a8..77fc0bf 100644 --- a/srcs/juloo.keyboard2/Keyboard2.java +++ b/srcs/juloo.keyboard2/Keyboard2.java @@ -80,19 +80,19 @@ public class Keyboard2 extends InputMethodService _currentTextLayout = l; } - private void extra_keys_of_subtype(Set dst, InputMethodSubtype subtype) + private void extra_keys_of_subtype(Set dst, InputMethodSubtype subtype) { String extra_keys = subtype.getExtraValueOf("extra_keys"); if (extra_keys == null) return; String[] ks = extra_keys.split("\\|"); for (int i = 0; i < ks.length; i++) - dst.add(ks[i]); + dst.add(KeyValue.getKeyByName(ks[i])); } private void refreshAccentsOption(InputMethodManager imm, InputMethodSubtype subtype) { - HashSet extra_keys = new HashSet(); + HashSet extra_keys = new HashSet(); List enabled_subtypes = getEnabledSubtypes(imm); switch (_config.accents) { @@ -119,7 +119,7 @@ public class Keyboard2 extends InputMethodService switch (_config.accents) { case 1: case 2: case 3: _config.extra_keys = null; break; - case 4: _config.extra_keys = new HashSet(); break; + case 4: _config.extra_keys = new HashSet(); break; } // Fallback for the layout option: Use qwerty in the "system settings" case _currentTextLayout = (_config.layout == -1) ? R.xml.qwerty : _config.layout; -- cgit v1.2.3