Skip to content

Commit

Permalink
Merge pull request #13273 from keymanapp/fix/android/adjust-osk-heigh…
Browse files Browse the repository at this point in the history
…t-rotate

fix(android): Update system keyboard height consistently
  • Loading branch information
darcywong00 authored Feb 21, 2025
2 parents aa43b3b + 8b4e769 commit 9712e3b
Showing 1 changed file with 10 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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());

Expand Down

0 comments on commit 9712e3b

Please sign in to comment.