diff options
| author | Jules Aguillon | 2022-11-13 00:24:23 +0100 |
|---|---|---|
| committer | Jules Aguillon | 2022-11-13 00:24:23 +0100 |
| commit | 51b330c6168a8b0e0c16482254d4674fbe5476c7 (patch) | |
| tree | bc3b05120d606e386269322e7fab2694e20ee845 /srcs/juloo.keyboard2/Keyboard2.java | |
| parent | 815e30a505eb6766e29d85c2e1a5d8f4da9c83d3 (diff) | |
| download | unexpected-keyboard-51b330c6168a8b0e0c16482254d4674fbe5476c7.tar.gz unexpected-keyboard-51b330c6168a8b0e0c16482254d4674fbe5476c7.zip | |
Allow switching quickly between two layouts
A new option allow to choose a secondary layout, the switching key is
placed on the top edge of the space bar.
The "Programming layout" option was basically doing that but it was
possible to choose from a few layouts only. It is improved and renamed.
The 'LayoutListPreference' allows setting the string for the first entry
but otherwise share the rest of the array.
Add nice icons from materialdesignicons.
Diffstat (limited to 'srcs/juloo.keyboard2/Keyboard2.java')
| -rw-r--r-- | srcs/juloo.keyboard2/Keyboard2.java | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/srcs/juloo.keyboard2/Keyboard2.java b/srcs/juloo.keyboard2/Keyboard2.java index 7bf9812..d2fdb2c 100644 --- a/srcs/juloo.keyboard2/Keyboard2.java +++ b/srcs/juloo.keyboard2/Keyboard2.java @@ -157,9 +157,9 @@ public class Keyboard2 extends InputMethodService refreshAccentsOption(imm, subtype); } } - _config.shouldOfferSwitchingToProgramming = - _config.programming_layout != -1 && - _currentTextLayout != _config.programming_layout; + _config.shouldOfferSwitchingToSecond = + _config.second_layout != -1 && + _currentTextLayout != _config.second_layout; } private String actionLabel_of_imeAction(int action) @@ -343,17 +343,17 @@ public class Keyboard2 extends InputMethodService _keyboardView.setKeyboard(getLayout(R.xml.greekmath)); } - public void switchProgramming() + public void switchSecond() { - if (_config.programming_layout == -1) + if (_config.second_layout == -1) return; KeyboardData layout = - getLayout(_config.programming_layout).mapKeys(new KeyboardData.MapKeyValues() { + getLayout(_config.second_layout).mapKeys(new KeyboardData.MapKeyValues() { public KeyValue apply(KeyValue key, boolean localized) { if (key.getKind() == KeyValue.Kind.Event - && key.getEvent() == KeyValue.Event.SWITCH_PROGRAMMING) - return KeyValue.getKeyByName("switch_text"); + && key.getEvent() == KeyValue.Event.SWITCH_SECOND) + return KeyValue.getKeyByName("switch_second_back"); return key; } }); |
