diff options
| author | Jules Aguillon | 2023-07-18 00:31:32 +0200 |
|---|---|---|
| committer | Jules Aguillon | 2023-07-19 23:30:58 +0200 |
| commit | 458e17bf31c9ef6b4dfadd56dd0c0dfb709eb32c (patch) | |
| tree | 7e4bd6dd451f13071fd85ebecb984388c236fd39 /srcs/juloo.keyboard2/ExtraKeysPreference.java | |
| parent | 324aa26ba4d062edcbbecab9de2f0a8f2c3c8dfc (diff) | |
| download | unexpected-keyboard-458e17bf31c9ef6b4dfadd56dd0c0dfb709eb32c.tar.gz unexpected-keyboard-458e17bf31c9ef6b4dfadd56dd0c0dfb709eb32c.zip | |
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.
Diffstat (limited to 'srcs/juloo.keyboard2/ExtraKeysPreference.java')
| -rw-r--r-- | srcs/juloo.keyboard2/ExtraKeysPreference.java | 5 |
1 files changed, 3 insertions, 2 deletions
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; |
