Skip to content
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

Android windowSoftInputMode is ignored #7428

Closed
kabus202 opened this issue Jan 25, 2022 · 10 comments · Fixed by #7453
Closed

Android windowSoftInputMode is ignored #7428

kabus202 opened this issue Jan 25, 2022 · 10 comments · Fixed by #7453

Comments

@kabus202
Copy link

kabus202 commented Jan 25, 2022

🐛 Bug Report

after the 7.24.0 release the windowSoftInputMode is ignored for android. For example android:windowSoftInputMode="adjustPan" has no effect at all.

Last working version: 7.23.1

Have you read the Contributing Guidelines on issues?

Yes

To Reproduce

  1. In AndroidManifest.xml set android:windowSoftInputMode to android:windowSoftInputMode="adjustPan"
  2. Add a component
  3. run

Expected behavior

Is that the Keyboard is not pushed up.

Actual Behavior

Keyboard getting pushed up

yogevbd added a commit that referenced this issue Feb 12, 2022
# Issue:

Window insets does not apply when keyboard got closed in case of adjustPan, and in case of adjustNothing it will just ignore it and treat it like adjustResize.

The difference between Pan and Resize as pointed [here](https://www.techrepublic.com/article/pro-tip-make-sense-of-pan-vs-resize-in-the-android-manifest/):
adjustResize: The activity’s main window is always resized to make room for the soft keyboard on screen.
adjustPan: The activity’s main window is not resized to make room for the soft keyboard. Rather, the contents of the window are automatically panned so that the current focus is never obscured by the keyboard and users can always see what they are typing. **This is generally less desirable than resizing, because the user may need to close the soft keyboard to get at and interact with obscured parts of the window.**


# Fix:
- Due to the nature of adjustPan, we need to wait for the layout to be updated after the keyboard closed, and then apply insets to determine the final state.
- Take adjustNothing into consideration and don't adjust the insets.

Adjust Nothing:

https://user-images.githubusercontent.com/7227793/153453913-7af3fcb7-87f6-4cfa-aaf8-e2f32b023c61.mov

Adjust Pan:

https://user-images.githubusercontent.com/7227793/153453981-73ccf0c9-e42e-41e3-bede-8f561f9ba53a.mov

AdjustPan old Androids (the white space fixed in master, which is not included in the recorded demo)

https://user-images.githubusercontent.com/7227793/153454164-300c115b-9e7a-407c-b612-c0ca8ac158ea.mov



**NOTE:
As checked, if flags are set to adjustResize, then there is no issue at all across all versions.**


Closes: #7433.
Closes: #7427.
Closes: #7428.
Closes: #7402.


Co-authored-by: Yogev Ben David <yogev132@gmail.com>
@alan-nakagiri
Copy link

alan-nakagiri commented Mar 8, 2022

@yogevbd I'd like to reopen this issue. It looks like the recent release may have reintroduced this issue for Android 30.

Below are some screenshots of what I am seeing. The same code except swapping emulators and RNN versions.

AdjustPan Android 30, v7.25.4 (left) v7.26 (right)
Screen Shot 2022-03-07 at 5 55 03 PM

AdjustPan, Android 29, v7.25.4(left), v7.26 (right)
image

I double checked I had things set up right, but it looks like Android 30 w/ 7.26 does not work but Android 29 with 7.26 does, while Android 30 w/ 7.25.4 does work but Android 29 w/ 7.25.4 does not.

Can we reopen this issue?

@stachu2k
Copy link

stachu2k commented Mar 9, 2022

I have the same problem. My app has android:windowSoftInputMode="adjustPan" and it's ignored. Library version 7.26.0. Device Android 11 SDK 30.

@marf
Copy link

marf commented Mar 20, 2022

Same issue here

1 similar comment
@lethienhung
Copy link

Same issue here

@huynqjmango360
Copy link

yeb. Android is suck!

@kabus202
Copy link
Author

@alan-nakagiri did you manage to find a workaround?

@alan-nakagiri
Copy link

@kabus202 we ended up having to fork the repo and made an adjustment to the ComponentViewController.java file

@kabus202
Copy link
Author

kabus202 commented Nov 6, 2022

Thanks @alan-nakagiri for your reply. I manage to fix it within the component itself.

@MattEveritt
Copy link

Hi @kabus202 , would really appreciate it if you could share how you managed to fix this? Im experiencing the same issue.

@marcshilling
Copy link

marcshilling commented Mar 11, 2024

Setting android:windowSoftInputMode="adjustPan" (or adjustNothing) has no effect, it just behaves the same way as adjustResize. This used to work with this library. I suspect it broke when I upgraded from 7.32.1 to 7.37.2. Issue should not be closed IMO.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants