From f8bce500ff3f870e6eadae591541a1210e458cff Mon Sep 17 00:00:00 2001 From: Jules Aguillon Date: Sun, 18 Apr 2021 00:55:31 +0200 Subject: Hide the input switching key if it's not needed Android has a new way of switching between input methods and this key need to be hidden in most cases. --- srcs/juloo.keyboard2/Keyboard2View.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'srcs/juloo.keyboard2/Keyboard2View.java') diff --git a/srcs/juloo.keyboard2/Keyboard2View.java b/srcs/juloo.keyboard2/Keyboard2View.java index ccbbb7e..1dbfb87 100644 --- a/srcs/juloo.keyboard2/Keyboard2View.java +++ b/srcs/juloo.keyboard2/Keyboard2View.java @@ -83,12 +83,13 @@ public class Keyboard2View extends View return (paint); } - public void setKeyboard(KeyboardData keyboard) + public void setKeyboard(KeyboardData kw) { + if (!_config.shouldOfferSwitchingToNextInputMethod) + kw = kw.removeKeys(new KeyboardData.RemoveKeysByEvent(KeyValue.EVENT_CHANGE_METHOD)); if (_config.disableAccentKeys) - _keyboard = keyboard.removeKeys(new KeyboardData.RemoveKeysByFlags(KeyValue.FLAGS_ACCENTS)); - else - _keyboard = keyboard; + kw = kw.removeKeys(new KeyboardData.RemoveKeysByFlags(KeyValue.FLAGS_ACCENTS)); + _keyboard = kw; reset(); } -- cgit v1.2.3