From a77b6755d9a089e307ecee6592b1f3aa500df7fb Mon Sep 17 00:00:00 2001 From: Trevor Terris Date: Sun, 2 May 2021 09:49:08 -0400 Subject: [PATCH] Extend touchable region to nav bar Extend the touchable region to include the navigation bar, so that taps on the nav bar aren't sent to the underlying application. Credit to https://github.com/rkkr/simple-keyboard --- .../java/org/dslul/openboard/inputmethod/latin/LatinIME.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/dslul/openboard/inputmethod/latin/LatinIME.java b/app/src/main/java/org/dslul/openboard/inputmethod/latin/LatinIME.java index 2495606f5..df8a284f1 100644 --- a/app/src/main/java/org/dslul/openboard/inputmethod/latin/LatinIME.java +++ b/app/src/main/java/org/dslul/openboard/inputmethod/latin/LatinIME.java @@ -114,6 +114,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen static final String TAG = LatinIME.class.getSimpleName(); private static final boolean TRACE = false; + private static final int EXTENDED_TOUCHABLE_REGION_HEIGHT = 100; private static final int PERIOD_FOR_AUDIO_AND_HAPTIC_FEEDBACK_IN_KEY_REPEAT = 2; private static final int PENDING_IMS_CALLBACK_DURATION_MILLIS = 800; static final long DELAY_WAIT_FOR_DICTIONARY_LOAD_MILLIS = TimeUnit.SECONDS.toMillis(2); @@ -1207,7 +1208,9 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen final int touchLeft = 0; final int touchTop = mKeyboardSwitcher.isShowingMoreKeysPanel() ? 0 : visibleTopY; final int touchRight = visibleKeyboardView.getWidth(); - final int touchBottom = inputHeight; + final int touchBottom = inputHeight + // Extend touchable region below the keyboard. + + EXTENDED_TOUCHABLE_REGION_HEIGHT; outInsets.touchableInsets = InputMethodService.Insets.TOUCHABLE_INSETS_REGION; outInsets.touchableRegion.set(touchLeft, touchTop, touchRight, touchBottom); }