Fix: IAM now showing after switching to 3-button-navigation mode #2284
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.
Description
One Line Summary
Fix some IAMs being suppressed under some specific view layouts with the 3 button navigation mode
Details
Motivation
Fix the bug that causes IAM not shown when user is on the 3 button navigation mode.
Scope
The PR changes how we determine if keyboard is currently open by using WindowInsets instead of using a fixed value for the offset of current view height and the screen height. This change will only be available for devices running on Android 11 and up.
Testing
Manual testing
I was unable to reproduce the scenario that prevent IAM from showing. Instead, I tested whether isKeyboardUp returns the correct value with the soft keyboard being open and close.
Devices I tested:
Both
Affected code checklist
Checklist
Overview
Testing
Final pass
This change is