-
Notifications
You must be signed in to change notification settings - Fork 1k
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
fix(android): incorrect keyboard height #2924
Conversation
how can I reproduce this? |
Hey! You can reproduce this with a simulated cutout by looking at the value of For example, in Pixel 2 simulator with a simulated 'tall cutout' I get To further clarify, it's this value I'm referring to, not the height of the actual keyboard (which is unrelated). Hope this makes it clear but do let me know if you need more information. |
android/capacitor/src/main/java/com/getcapacitor/plugin/Keyboard.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just a minor comment
other than that, looks good to me
I've committed the changes since we are doing a release today and wanted to include this fix. |
At the moment, the Keyboard plugin returns incorrect keyboard height on Android phones with cutouts. This fixes it by subtracting the size of the bottom cutout from the total screen height.
I also removed obsolete code ensuring backwards-compatibility with Android SDK versions <21 since Capacitor doesn't support these versions.