From f7e16c03459af3172782d720c6dd8c5b7fe28616 Mon Sep 17 00:00:00 2001 From: Jules Aguillon Date: Sun, 13 Nov 2022 20:59:40 +0100 Subject: [PATCH] Fix missing version check setSystemGestureExclusionRects is API 29. Broken since d644d2b, which almost got into the release! --- srcs/juloo.keyboard2/Keyboard2View.java | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/srcs/juloo.keyboard2/Keyboard2View.java b/srcs/juloo.keyboard2/Keyboard2View.java index 631b363..41d32ef 100644 --- a/srcs/juloo.keyboard2/Keyboard2View.java +++ b/srcs/juloo.keyboard2/Keyboard2View.java @@ -242,13 +242,16 @@ public class Keyboard2View extends View { if (!changed) return; - // Disable the back-gesture on the keyboard area - Rect keyboard_area = new Rect( - left + (int)_config.horizontalMargin, - top + (int)_config.marginTop, - right - (int)_config.horizontalMargin, - bottom - (int)_config.marginBottom); - setSystemGestureExclusionRects(Arrays.asList(keyboard_area)); + if (VERSION.SDK_INT >= 29) + { + // Disable the back-gesture on the keyboard area + Rect keyboard_area = new Rect( + left + (int)_config.horizontalMargin, + top + (int)_config.marginTop, + right - (int)_config.horizontalMargin, + bottom - (int)_config.marginBottom); + setSystemGestureExclusionRects(Arrays.asList(keyboard_area)); + } } @Override