From 8b4e769385255a938f986549dc559a84b1f2be28 Mon Sep 17 00:00:00 2001 From: Darcy Wong Date: Tue, 18 Feb 2025 14:26:13 +0700 Subject: [PATCH] fix(android): Update system keyboard height consistently --- .../com/keyman/android/SystemKeyboard.java | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/android/KMAPro/kMAPro/src/main/java/com/keyman/android/SystemKeyboard.java b/android/KMAPro/kMAPro/src/main/java/com/keyman/android/SystemKeyboard.java index a59f81dbc9..05c82082ad 100644 --- a/android/KMAPro/kMAPro/src/main/java/com/keyman/android/SystemKeyboard.java +++ b/android/KMAPro/kMAPro/src/main/java/com/keyman/android/SystemKeyboard.java @@ -155,16 +155,7 @@ public void onStartInput(EditorInfo attribute, boolean restarting) { KMManager.onStartInput(attribute, restarting); KMManager.resetContext(KeyboardType.KEYBOARD_TYPE_SYSTEM); - // This method (likely) includes the IME equivalent to `onResume` for `Activity`-based classes, - // making it an important time to detect orientation changes. Context appContext = getApplicationContext(); - int newOrientation = KMManager.getOrientation(appContext); - if(newOrientation != lastOrientation) { - lastOrientation = newOrientation; - Configuration newConfig = this.getResources().getConfiguration(); - KMManager.onConfigurationChanged(newConfig); - } - // Temporarily disable predictions on certain fields (e.g. hidden password field or numeric) int inputType = attribute.inputType; KMManager.setMayPredictOverride(inputType); @@ -234,6 +225,16 @@ public void onConfigureWindow(Window win, boolean isFullscreen, boolean isCandid public void onComputeInsets(InputMethodService.Insets outInsets) { super.onComputeInsets(outInsets); + // This method (likely) includes the IME equivalent to `onResume` for `Activity`-based classes, + // making it an important time to detect orientation changes. + Context appContext = getApplicationContext(); + int newOrientation = KMManager.getOrientation(appContext); + if(newOrientation != lastOrientation) { + lastOrientation = newOrientation; + Configuration newConfig = this.getResources().getConfiguration(); + KMManager.onConfigurationChanged(newConfig); + } + // We should extend the touchable region so that Keyman sub keys menu can receive touch events outside the keyboard frame Point size = KMManager.getWindowSize(getApplicationContext());