Update UiUtils keyboard detection heuristic
Previously, the utility that tried to determine if the keyboard was showing used a magic number (100 dp). Despite what the code implies, this number accounts for both the top and bottom Android controls on screen -- status bar and bottom navigation controls. On notched phones the status bar is considerably larger; when added to the bottom controls, the logic breaks. This change updates the logic to determine the height of the status bar and does a best-effort to get the height of the bottom Android controls. If the difference in height of the app's viewport and window size is greater than the combined height of the controls, the keyboard might be showing. BUG=805030 Change-Id: Ie923549a0c6bcc0067f8d784250fbf273125bff9 Reviewed-on: https://chromium-review.googlesource.com/884829 Commit-Queue: Matthew Jones <mdjones@chromium.org> Reviewed-by:Ted Choc <tedchoc@chromium.org> Reviewed-by:
Theresa <twellington@chromium.org> Cr-Commit-Position: refs/heads/master@{#533046}
Showing
Please register or sign in to comment