How to make softkeyboard candidate view not block application view?

2.2k Views Asked by At

I am playing with the Demo SoftKeyboard the comes with the Android SDK.

In portrait mode when the candidate view is shown, it doesn't move the app up as the default android keyboard does. Hence it covers part of the application view.

What should be changed in order to make the candidate view in the demo softkeyboard behave as the default android keyboard does?

I've also looked at the source of the android keyboard from git but found nothing related to this behavior.

1

There are 1 best solutions below

0
On

I know this is old but here is an answer anyway.

 @Override public void onComputeInsets(InputMethodService.Insets outInsets) {
    super.onComputeInsets(outInsets);
    if (!isFullscreenMode()) {
        outInsets.contentTopInsets = outInsets.visibleTopInsets;
    }
}