From ff0c0354d6395f58da6d7c4d4b5b724fa054e38f Mon Sep 17 00:00:00 2001 From: Jules Aguillon Date: Sun, 23 Oct 2022 21:51:43 +0200 Subject: Show keys description in settings The symbols alone might be hard to understand when scrolling through the "extra keys" option. --- srcs/juloo.keyboard2/ExtraKeyCheckBoxPreference.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'srcs/juloo.keyboard2/ExtraKeyCheckBoxPreference.java') diff --git a/srcs/juloo.keyboard2/ExtraKeyCheckBoxPreference.java b/srcs/juloo.keyboard2/ExtraKeyCheckBoxPreference.java index e66c2cc..c75ed08 100644 --- a/srcs/juloo.keyboard2/ExtraKeyCheckBoxPreference.java +++ b/srcs/juloo.keyboard2/ExtraKeyCheckBoxPreference.java @@ -57,10 +57,14 @@ public class ExtraKeyCheckBoxPreference extends CheckBoxPreference int index = a.getInteger(R.styleable.ExtraKeyCheckBoxPreference_index, 0); a.recycle(); String key_name = extra_keys[index]; + KeyValue kv = KeyValue.getKeyByName(key_name); + String title = kv.getString(); + String descr = KeyValue.getKeyDescription(key_name); + if (descr != null) + title += " (" + descr + ")"; setKey(pref_key_of_key_name(key_name)); setDefaultValue(default_checked(key_name)); - KeyValue kv = KeyValue.getKeyByName(key_name); - setTitle(kv.getString()); + setTitle(title); _key_font = kv.hasFlags(KeyValue.FLAG_KEY_FONT); } -- cgit v1.2.3