diff options
| author | Jules Aguillon | 2022-04-16 23:36:54 +0200 |
|---|---|---|
| committer | Jules Aguillon | 2022-04-16 23:36:54 +0200 |
| commit | 9a8c4f291da8babf3560e509554c78e1991cb22c (patch) | |
| tree | 8051ab1abe74a7ce4dd6a5b78a1155871b3b6bed /srcs/juloo.keyboard2/Keyboard2.java | |
| parent | 14cc318a0eb1f7ccd7695ed5ad6ef27f2428ffe9 (diff) | |
| download | unexpected-keyboard-9a8c4f291da8babf3560e509554c78e1991cb22c.tar.gz unexpected-keyboard-9a8c4f291da8babf3560e509554c78e1991cb22c.zip | |
Fix compatibility with Android 6
Android 6 uses Java 1.7, the only incompatible feature in use was
lambdas.
Diffstat (limited to 'srcs/juloo.keyboard2/Keyboard2.java')
| -rw-r--r-- | srcs/juloo.keyboard2/Keyboard2.java | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/srcs/juloo.keyboard2/Keyboard2.java b/srcs/juloo.keyboard2/Keyboard2.java index abea412..5b7935e 100644 --- a/srcs/juloo.keyboard2/Keyboard2.java +++ b/srcs/juloo.keyboard2/Keyboard2.java @@ -294,10 +294,13 @@ public class Keyboard2 extends InputMethodService if (_config.programming_layout == -1) return; KeyboardData layout = - getLayout(_config.programming_layout).replaceKeys(key -> { - if (key != null && key.eventCode == KeyValue.EVENT_SWITCH_PROGRAMMING) - return KeyValue.getKeyByName("switch_text"); - return key; + getLayout(_config.programming_layout).replaceKeys(new KeyboardData.MapKeys() { + public KeyValue apply(KeyValue key) + { + if (key != null && key.eventCode == KeyValue.EVENT_SWITCH_PROGRAMMING) + return KeyValue.getKeyByName("switch_text"); + return key; + } }); _keyboardView.setKeyboard(layout); } |
