diff options
| author | Jules Aguillon | 2023-11-19 19:07:54 +0100 |
|---|---|---|
| committer | Jules Aguillon | 2023-11-19 19:07:54 +0100 |
| commit | 15de829138b7121fa6ad139782c5f192ecc1a402 (patch) | |
| tree | e859522ba3ade53d4e35c686b2c6651844e3c38a /srcs/juloo.keyboard2/Config.java | |
| parent | c57d896d8d5fb7264cbc190a5ff8949e00ed8fbc (diff) | |
| download | unexpected-keyboard-15de829138b7121fa6ad139782c5f192ecc1a402.tar.gz unexpected-keyboard-15de829138b7121fa6ad139782c5f192ecc1a402.zip | |
Persist current selected layout
Diffstat (limited to 'srcs/juloo.keyboard2/Config.java')
| -rw-r--r-- | srcs/juloo.keyboard2/Config.java | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/srcs/juloo.keyboard2/Config.java b/srcs/juloo.keyboard2/Config.java index e24f339..b6eb4b9 100644 --- a/srcs/juloo.keyboard2/Config.java +++ b/srcs/juloo.keyboard2/Config.java @@ -66,6 +66,7 @@ final class Config public final IKeyEventHandler handler; public boolean orientation_landscape = false; + public int current_layout; // Index in 'layouts' of the currently used layout private Config(SharedPreferences prefs, Resources res, IKeyEventHandler h) { @@ -154,6 +155,15 @@ final class Config extra_keys_param = ExtraKeysPreference.get_extra_keys(_prefs); extra_keys_custom = CustomExtraKeysPreference.get(_prefs); pin_entry_enabled = _prefs.getBoolean("pin_entry_enabled", true); + current_layout = _prefs.getInt("current_layout", 0); + } + + public void set_current_layout(int l) + { + current_layout = l; + SharedPreferences.Editor e = _prefs.edit(); + e.putInt("current_layout", l); + e.apply(); } KeyValue action_key() |
