Skip to content

fix(keyboard): resolve Android 16 edge-to-edge layout expansion and navigation insets - #760

Closed
prince-0408 wants to merge 3 commits into
scribe-org:mainfrom
prince-0408:fix/api36-keyboard-edge-to-edge
Closed

prince-0408 wants to merge 3 commits into
scribe-org:mainfrom
prince-0408:fix/api36-keyboard-edge-to-edge

Conversation

@prince-0408

Copy link
Copy Markdown
Collaborator

Contributor checklist


Description

This PR fixes two layout and window decor issues on Android 16 (API 36, tested on Pixel 9) where edge-to-edge windowing is enforced:

  1. Massive grey screen overlay:

    • empty_state_banner_container in input_method_view.xml was set to android:layout_width="0dp" inside a vertical LinearLayout (top_container). On clean installs or before language data is cached, the empty state text wrapped character-by-character vertically, expanding top_container to ~1,500px and blowing up the entire keyboard window frame to >2,200px.
    • Setting the theme background directly on targetWindow.decorView caused the entire oversized IME window to paint solid grey over the host application.
    • Fix: Changed empty_state_banner_container width from 0dp to match_parent and stripped obsolete ConstraintLayout attributes. Kept decorView and root backgrounds transparent, applying the theme background directly to keyboardCard.
  2. Keyboard bottom row flush against gesture bar:

    • On gesture navigation, bottom system navigation insets are small (~16–24dp). Without extra bottom clearance, the bottom row of keys (?123, spacebar, ., enter) sat directly on top of the system navigation bar (∨, gesture bar, and 🌐).
    • Fix: Added a 16dp bottom cushion (extraBottomPadding) to keyboardCard.setPadding() in docked mode so the keys have comfortable breathing room while the card's background color fills behind the navigation bar seamlessly.

Current Behavior

Key Files Changed

  • input_method_view.xml: Fixed empty_state_banner_container width to match_parent.
  • KeyboardThemeManager.kt: Ensured decorView and root are transparent; applied theme background and navigation bar padding + 16dp bottom cushion to keyboardCard.
  • GeneralKeyboardIME.kt: Targeted keyboardCard for docked onComputeInsets() location calculations.
  • CHANGELOG.md: Added bug fix entry referencing [Bug]: Keyboard decor obscures screen and layout expands on Android 16 (API 36) #759.

Testing

  • Verified on Pixel 9 (API 36.0, Android 16 emulator): confirmed keyboard window frame shrinks from 2,200px to ~834px docked at the bottom, grey block is eliminated, and keys have comfortable clearance from the navigation bar.
  • Tested ./gradlew lintKotlin: Passed with 0 errors.
  • Tested ./gradlew detekt: Passed with 0 errors.
  • Tested ./gradlew testKeyboardsDebugUnitTest: 35 tasks passed / up to date.

Related issue

@prince-0408 prince-0408 changed the title fix(keyboard): resolve Android 16 edge-to-edge layout expansion and i… fix(keyboard): resolve Android 16 edge-to-edge layout expansion and navigation insets Nov 8, 2026
@andrewtavis

Copy link
Copy Markdown
Member

Hey @prince-0408 👋 As the issues in #758 are from me not having the latest Android Studio, I think we're good to close this one and move on to other priorities. Thanks for opening the PR!

@andrewtavis andrewtavis closed this Nov 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Keyboard decor obscures screen and layout expands on Android 16 (API 36)

2 participants