From 9a8c4f291da8babf3560e509554c78e1991cb22c Mon Sep 17 00:00:00 2001 From: Jules Aguillon Date: Sat, 16 Apr 2022 23:36:54 +0200 Subject: Fix compatibility with Android 6 Android 6 uses Java 1.7, the only incompatible feature in use was lambdas. --- srcs/juloo.keyboard2/Keyboard2.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'srcs/juloo.keyboard2/Keyboard2.java') 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); } -- cgit v1.2.3