abouttreesummaryrefslogcommitdiff
path: root/srcs/juloo.keyboard2/Keyboard2.java
diff options
context:
space:
mode:
authorJules Aguillon2022-06-06 00:23:45 +0200
committerJules Aguillon2022-06-06 00:23:45 +0200
commit31d6a70dfb9c7ad3a72302bca2339f926e4593ee (patch)
tree18aacc302fb21472688c01c0f73b53662b61cd37 /srcs/juloo.keyboard2/Keyboard2.java
parent7462955507325bf8f9037a45aec17c15b5f8b9e7 (diff)
downloadunexpected-keyboard-31d6a70dfb9c7ad3a72302bca2339f926e4593ee.tar.gz
unexpected-keyboard-31d6a70dfb9c7ad3a72302bca2339f926e4593ee.zip
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.
Diffstat (limited to 'srcs/juloo.keyboard2/Keyboard2.java')
-rw-r--r--srcs/juloo.keyboard2/Keyboard2.java8
1 files changed, 4 insertions, 4 deletions
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<String> dst, InputMethodSubtype subtype)
+ private void extra_keys_of_subtype(Set<KeyValue> 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<String> extra_keys = new HashSet<String>();
+ HashSet<KeyValue> extra_keys = new HashSet<KeyValue>();
List<InputMethodSubtype> 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<String>(); break;
+ case 4: _config.extra_keys = new HashSet<KeyValue>(); break;
}
// Fallback for the layout option: Use qwerty in the "system settings" case
_currentTextLayout = (_config.layout == -1) ? R.xml.qwerty : _config.layout;