Repository navigation
fix(layout): reserve only the part of the navigation bar the keyboard really overlaps - #828
Merged
Merged
Conversation
… really overlaps Some devices (reported on a Samsung Note 10, Android 12) report the navigation bar inset although the IME window already leaves room for it. The inset was cached and added as bottom padding on top of that room, so the gap below the keys was too large. The first show of a new input view looked right, because the inset had not arrived yet, and later shows were wrong. The padding is now the overlap between the laid out view and the navigation bar, never more than the reported inset, and that value is also what the children get as their bottom inset, so the framework does not add the full inset again.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
A user on a Samsung Note 10 (Android 12) reports a too large gap below the keys, in every app, on 4.3.2 and 4.3.3 (also beta3). The bottom padding scale is already 0 for them and does not change it, so the gap does not come from the keyboard's own padding. They also say that after restarting the keyboard it is right once, then wrong again.
Cause (not reproduced, this is from the code and the report)
InputViewcaches the navigation bar inset and adds it as bottom padding, and the keyboard views also fit system windows. On such a device the IME window already leaves room for the navigation bar, so the inset is added a second time. A new input view looks right the first time because the inset has not arrived yet.Change
navBarOverlap), never more than the reported inset. If the window already leaves room, nothing is reserved.Testing
assembleStandardDebug,compileOfflineRunTestsKotlinandNavBarOverlapTest.