Skip to content

fix(android): Apply bottom insets to system keyboard#14808

Merged
darcywong00 merged 6 commits intomasterfrom
fix/android/some-bottom-inset
Sep 25, 2025
Merged

fix(android): Apply bottom insets to system keyboard#14808
darcywong00 merged 6 commits intomasterfrom
fix/android/some-bottom-inset

Conversation

@darcywong00
Copy link
Copy Markdown
Contributor

@darcywong00 darcywong00 commented Sep 22, 2025

Fixes #14794 and follows #14619

This should create test builds that @ermshiperete and I can try on our devices to troubleshoot.

This updates SystemKeyboard to adjust the padding and offsets for the navigation bar height.

TODO:

User Testing

Setup - Install the PR build of Keyman for Android. Set Keyman as the default system keyboard. Also on the device Settings, configure the bottom navigation to use the 3-button bar instead of gestures. Use the Android API level per the Group name

GROUP_API_31 - Use Android API 31 on the device/emulator

GROUP_API_34 - Use Android API 34 on the device/emulator

GROUP_API_35 - Use Android API 35 on the device/emulator

  • TEST_OSK - Verifies Keyman system keyboard is connected to the bottom navigation bar and not covered
  1. Launch Keyman and dismiss the Get Started menu
  2. Verify the in-app keyboard functions
    a. base keys
    b. longpress keys
    c. suggestion banner
  3. Force-quit Keyman in the system settings
  4. Launch Chrome and select a text area to type in
  5. Select a non-Keyman system keyboard
  6. Select the Keyman system keyboard
  7. Verify the Keyman OSK is not covered by the bottom navigation bar
  8. Verify there's no gap between the Keyman OSK and the bottom navigation bar
  9. Verify the Keyman system keyboard functions
    a. base keys
    b. longpress keys
    c. suggestion banner
  10. Launch Keyman
  11. Return to Chrome and select a text area to type in
  12. Verify the Keyman OSK is not covered by the bottom navigation bar
  13. Verify there's no gap between the Keyman OSK and the bottom navigation bar

@keymanapp-test-bot
Copy link
Copy Markdown

keymanapp-test-bot bot commented Sep 22, 2025

User Test Results

Test specification and instructions

  • ✅ GROUP_API_31: - Use Android API 31 on the device/emulator

    1 tests PASSED
  • ✅ GROUP_API_34: - Use Android API 34 on the device/emulator

    1 tests PASSED
  • ✅ GROUP_API_35: - Use Android API 35 on the device/emulator

    1 tests PASSED

Test Artifacts

@ermshiperete
Copy link
Copy Markdown
Contributor

On my phone, the keyboard shows up correctly if the Keyman app is running. However, then I can't select a text suggestion.
If the Keyman app is not running the keyboard still shows behind the system buttons, but typing + suggestions work.
In the Keyman app, the keyboard is showing correctly and the text suggestions work.

@ermshiperete
Copy link
Copy Markdown
Contributor

ermshiperete commented Sep 22, 2025

Also seeing the wrong behavior in the emulator: Pixel 9, API 35, Android 15.

image

@darcywong00 darcywong00 force-pushed the fix/android/some-bottom-inset branch from dec72a0 to aa886ce Compare September 23, 2025 10:08
@ermshiperete
Copy link
Copy Markdown
Contributor

With the latest commit keyboards now show correctly on my phone, and as you said in the code comment the suggestions banner still doesn't work.

@ermshiperete
Copy link
Copy Markdown
Contributor

ermshiperete commented Sep 23, 2025

Not everything works: in some apps, e.g. messages, the edit field appears behind the keyboard.

screen-20250923-214356.mp4

@darcywong00
Copy link
Copy Markdown
Contributor Author

darcywong00 commented Sep 24, 2025

As of ddc9948 the alignments should work on @ermshiperete and my device. (independent of Keyman app running)

Remaining Keyman system keyboard issues on @ermshiperete 's device:

  • can't click suggestion bar (maybe landscape orientation works?)
  • some app fields covered by the suggestion bar

@ermshiperete
Copy link
Copy Markdown
Contributor

With 0a91f50 I can confirm that everything works in landscape orientation.
In portrait, clicking the suggestion bar doesn't work and some fields are behind the suggestion bar. This is independent of the Keyman app running.

…/android/some-bottom-inset

# Keyman Conventional Commit suggestions:
#
# - Link to a Sentry issue with git trailer:
#     Fixes: _MODULE_-_ID_
# - Give credit to co-authors:
#     Co-authored-by: _Name_ <_email_>
# - Use imperative, present tense ('attach' not 'attaches', 'attached' etc)
# - Don't include a period at the end of the title
# - Always include a blank line before trailers
# - More: https://github.com/keymanapp/keyman/wiki/Pull-Request-and-Commit-workflow-notes
@darcywong00
Copy link
Copy Markdown
Contributor Author

Huzzah - suggestion bar on the system keyboard works in 8af7803

Turns out I had to adjust the contentTopOffset computation to include the navigation bar inset.

This should be ready to review and test for several API levels

Copy link
Copy Markdown
Member

@mcdurdin mcdurdin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Do we need to document getNavigationBarHeight in the Engine API? And I assume back-port to 18.0 is coming?

@darcywong00
Copy link
Copy Markdown
Contributor Author

LGTM. Do we need to document getNavigationBarHeight in the Engine API? And I assume back-port to 18.0 is coming?

Yep, documented in #14830 and will 🍒 pick to 18.0

@ermshiperete
Copy link
Copy Markdown
Contributor

👍 Works correctly on my phone.

@dinakaranr
Copy link
Copy Markdown

Test Results

I tested this PR in the "Keyman 19.0.126-alpha-test-14808" build on Android API 31, 34, 35. Here I am sharing my observation.

GROUP_API_31: - Use Android API 31 on the device/emulator

  • TEST_OSK (Passed):
  1. Install the "Keyman 19.0.126-alpha-test-14808" PR build on the Pixel 7a API 31 platform.
  2. Launch Keyman and dismiss the Get Started menu.
  3. Verified the in-app keyboard functions
    a. base keys
    b. longpress keys
    c. suggestion banner
  4. Force-quit Keyman in the system settings(from background)
  5. Launch Chrome and select a text area to type in (e.g. online editor)
  6. Select a non-Keyman system keyboard
  7. Select the Keyman system keyboard
  8. Verified the Keyman OSK is not covered by the bottom navigation bar
  9. Verified there's no gap between the Keyman OSK and the bottom navigation bar
  10. Verified the Keyman system keyboard functions
    a. base keys
    b. longpress keys
    c. suggestion banner
  11. Verified that keyboard function works above three options.
  12. Launch Keyman
  13. Return to Chrome and select a text area to type in the search box.
  14. Verified the Keyman OSK is not covered by the bottom navigation bar.
  15. Verified there's no gap between the Keyman OSK and the bottom navigation bar.

GROUP_API_34: - Use Android API 34 on the device/emulator

  • TEST_OSK (Passed):
  1. Install the "Keyman 19.0.126-alpha-test-14808" PR build on the Pixel 7a API 34 platform.
  2. Launch Keyman and dismiss the Get Started menu.
  3. Verified the in-app keyboard functions
    a. base keys
    b. longpress keys
    c. suggestion banner
  4. Force-quit Keyman in the system settings(from background)
  5. Launch Chrome and select a text area to type in (e.g. online editor)
  6. Select a non-Keyman system keyboard
  7. Select the Keyman system keyboard
  8. Verified the Keyman OSK is not covered by the bottom navigation bar
  9. Verified there's no gap between the Keyman OSK and the bottom navigation bar
  10. Verified the Keyman system keyboard functions
    a. base keys
    b. longpress keys
    c. suggestion banner
  11. Verified that keyboard function works above three options.
  12. Launch Keyman
  13. Return to Chrome and select a text area to type in the search box.
  14. Verified the Keyman OSK is not covered by the bottom navigation bar.
  15. Verified there's no gap between the Keyman OSK and the bottom navigation bar.

GROUP_API_35: - Use Android API 35 on the device/emulator

  • TEST_OSK (Passed):
  1. Install the "Keyman 19.0.126-alpha-test-14808" PR build on the Pixel 7a API 35 platform.
  2. Launch Keyman and dismiss the Get Started menu.
  3. Verified the in-app keyboard functions
    a. base keys
    b. longpress keys
    c. suggestion banner
  4. Force-quit Keyman in the system settings(from background)
  5. Launch Chrome and select a text area to type in (e.g. online editor)
  6. Select a non-Keyman system keyboard
  7. Select the Keyman system keyboard
  8. Verified the Keyman OSK is not covered by the bottom navigation bar
  9. Verified there's no gap between the Keyman OSK and the bottom navigation bar
  10. Verified the Keyman system keyboard functions
    a. base keys
    b. longpress keys
    c. suggestion banner
  11. Verified that keyboard function works above three options.
  12. Launch Keyman
  13. Return to Chrome and select a text area to type in the search box.
  14. Verified the Keyman OSK is not covered by the bottom navigation bar.
  15. Verified there's no gap between the Keyman OSK and the bottom navigation bar.
    It works well. There is no keyman keyboard overlapped on the navigation bar. There is no blank space between keyboard and navigation bar.

@keymanapp-test-bot keymanapp-test-bot bot removed the user-test-required User tests have not been completed label Sep 25, 2025
@dinakaranr dinakaranr removed their assignment Sep 25, 2025
@darcywong00 darcywong00 merged commit b04309c into master Sep 25, 2025
7 checks passed
@darcywong00 darcywong00 deleted the fix/android/some-bottom-inset branch September 25, 2025 13:52
@github-project-automation github-project-automation bot moved this from Todo to Done in Keyman Sep 25, 2025
@keyman-server
Copy link
Copy Markdown
Collaborator

Changes in this pull request will be available for download in Keyman version 19.0.127-alpha

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

bug(android): Keyboard is behind the android home buttons

6 participants