From 458e17bf31c9ef6b4dfadd56dd0c0dfb709eb32c Mon Sep 17 00:00:00 2001 From: Jules Aguillon Date: Tue, 18 Jul 2023 00:31:32 +0200 Subject: Add custom extra keys preference This is a new section in the extra keys option that allows to enter arbitrary strings which are then added to the keyboard. A new string is needed for the title of the section, Android's icons and strings are used as much as possible to avoid adding more strings. Keys are stored in the preferences as a JSON array of strings. --- srcs/juloo.keyboard2/ExtraKeysPreference.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'srcs/juloo.keyboard2/ExtraKeysPreference.java') diff --git a/srcs/juloo.keyboard2/ExtraKeysPreference.java b/srcs/juloo.keyboard2/ExtraKeysPreference.java index 340db1e..6b0547b 100644 --- a/srcs/juloo.keyboard2/ExtraKeysPreference.java +++ b/srcs/juloo.keyboard2/ExtraKeysPreference.java @@ -81,7 +81,7 @@ public class ExtraKeysPreference extends PreferenceCategory return ks; } - boolean _attached; /** Whether it has already been attached. */ + boolean _attached = false; /** Whether it has already been attached. */ public ExtraKeysPreference(Context context, AttributeSet attrs) { @@ -89,6 +89,7 @@ public class ExtraKeysPreference extends PreferenceCategory setOrderingAsAdded(true); } + @Override protected void onAttachedToActivity() { if (_attached) @@ -104,7 +105,7 @@ public class ExtraKeysPreference extends PreferenceCategory return "extra_key_" + key_name; } - final class ExtraKeyCheckBoxPreference extends CheckBoxPreference + static class ExtraKeyCheckBoxPreference extends CheckBoxPreference { boolean _key_font; -- cgit v1.2.3