Skip to content

Commit

Permalink
Merge pull request #11134 from keymanapp/fix/android/osk-height
Browse files Browse the repository at this point in the history
fix(android/app): Track previous device orientation for SystemKeyboard
  • Loading branch information
darcywong00 authored Apr 3, 2024
2 parents 183a17c + fcad85e commit a067401
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public class SystemKeyboard extends InputMethodService implements OnKeyboardEven
private static View inputView = null;
private static ExtractedText exText = null;
private KMHardwareKeyboardInterpreter interpreter = null;
private int lastOrientation = Configuration.ORIENTATION_UNDEFINED;

private static final String TAG = "SystemKeyboard";

Expand Down Expand Up @@ -197,7 +198,10 @@ public void onUpdateExtractingVisibility(EditorInfo ei) {
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
KMManager.onConfigurationChanged(newConfig);
if (newConfig.orientation != lastOrientation) {
lastOrientation = newConfig.orientation;
KMManager.onConfigurationChanged(newConfig);
}
}

@Override
Expand All @@ -220,8 +224,9 @@ public void onComputeInsets(InputMethodService.Insets outInsets) {
wm.getDefaultDisplay().getSize(size);

int inputViewHeight = 0;
if (inputView != null)
if (inputView != null) {
inputViewHeight = inputView.getHeight();
}

int bannerHeight = KMManager.getBannerHeight(this);
int kbHeight = KMManager.getKeyboardHeight(this);
Expand Down

0 comments on commit a067401

Please sign in to comment.