Android - Add workaround for android 11 ime insets being weird #16201
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does the pull request do?
On android 11, forwards ime inset changes as InputPane State change events.
What is the current behavior?
On Android 11(api 30), insets have a bug where the first inset update after a config change(launching activity, orientation change) can either have 0 size, or double the actual size of the input pane on the first frame of the input pane animation. Because we calculate both the start and end bounds of the input pane at the start of the animation to enable text control editor to animate to input pane changes, on this android version, the predicted ime margin can either be covered by the input pane, or be double the input pane size at launch or when orientation changes.
What is the updated/expected behavior with this PR?
On Android 11, every change to the ime inset will be forwarded as a State change. Since the OS will send the correct insets after the animation ends, input pane margins will be corrected when the input pane is active.
How was the solution implemented (if it's not obvious)?
Checklist
Breaking changes
Obsoletions / Deprecations
Fixed issues
Fixes #16171