mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
1e48274223
Summary: RN for Android fires `keyboardDidShow` and `keyboardDidHide` by observing changes to viewable window size. This isn't always reliable, such as when an activity has `awindowSoftInputMode` set to not have the system adjust the viewport when a keyboard is opened. Android 11 added the direct ability to measure and check visibility of the soft keyboard via `WindowInsets`, which fixes these issues. This is exposed downlevel to API 23 via WindowInsetsComapt` with the same limitations as previously, but using it simplifies our calculations a lot. Changelog: [Android][Fixed] - Use WindowInsetsCompat for Keyboard Events Reviewed By: javache Differential Revision: D38500859 fbshipit-source-id: d4ad41d7e75e4b9c14a485539a5f9de19de74362