Skip to content

Allow setting windowSoftInputMode #1462

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Oct 17, 2021

Conversation

M-i-k-e-l
Copy link
Collaborator

Description

Currently our CustomKeyboardLayout is forcing the app to have windowSoftInputMode=SOFT_INPUT_ADJUST_RESIZE even if you did not use a KeyboardAccessoryView in your app.
This fix changes this behaviour to only occur if a KeyboardAccessoryView is loaded (even in a different tab etc).

@ethanshar, I've tested on both public and private demo apps, but I think it isn't without risk, what's your opinion?

Changelog

Do not force SOFT_INPUT_ADJUST_RESIZE on Android apps.

Fixes #1360

Comment on lines 184 to 189
if (mIsShown) {
Window window = getWindow();
if (window != null) {
window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe extract this functionality to a separate method since it pretty much returns itself

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean the setKeyboardOverlayMode and the clearKeyboardOverlayMode?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, they are very similar, don't you think?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ping

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do think so, I usually try to minimize changes in these files; done.
Just to be sure it's not missed, there is a small risk in this PR.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the risk?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have a few Activities that have a different windowSoftInputMode than adjustResize they might look different if this bug has indeed overridden their selection.
I can send you the details in DM.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ethanshar, do we want to talk about this?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should (:
Can you write this down and raise it in the next sprint meeting

@M-i-k-e-l M-i-k-e-l requested a review from ethanshar August 12, 2021 12:17
@ethanshar ethanshar merged commit 368932b into master Oct 17, 2021
@M-i-k-e-l M-i-k-e-l deleted the fix/allow-setting-window-softInput-mode branch October 17, 2021 09:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RNUiLib forces android's softInputMode to 'adjustResize'
2 participants