Skip to content

Fix keyboard IME inset handling in app drawer - #74

Merged
ketansp merged 1 commit into
masterfrom
claude/search-bar-keyboard-visibility-rge1be
Jul 28, 2026
Merged

Fix keyboard IME inset handling in app drawer#74
ketansp merged 1 commit into
masterfrom
claude/search-bar-keyboard-visibility-rge1be

Conversation

@ketansp

@ketansp ketansp commented Jul 28, 2026

Copy link
Copy Markdown
Owner

Summary

Fixes the app drawer search bar being hidden behind the keyboard by properly managing window flags that were silently defeating SOFT_INPUT_ADJUST_RESIZE. The launcher's edge-to-edge window configuration (translucent system bars + FLAG_LAYOUT_NO_LIMITS) prevents the window from resizing for the IME, so those flags must be temporarily cleared while the drawer is visible.

Key Changes

  • Added clearedWindowFlags field to track which window flags were cleared in onStart()
  • Introduced RESIZE_BLOCKING_WINDOW_FLAGS constant in companion object listing the three flags that defeat SOFT_INPUT_ADJUST_RESIZE:
    • FLAG_LAYOUT_NO_LIMITS
    • FLAG_TRANSLUCENT_STATUS
    • FLAG_TRANSLUCENT_NAVIGATION
  • Modified onStart() to:
    • Set SOFT_INPUT_ADJUST_RESIZE (existing behavior)
    • Clear the resize-blocking window flags so the window can shrink for the keyboard
    • Store which flags were cleared for restoration
  • Modified onStop() to restore exactly the flags that were cleared, preserving the edge-to-edge look for the rest of the launcher
  • Expanded comments to explain the two-part solution needed for proper IME inset dispatch

Implementation Details

The fix works by temporarily disabling the edge-to-edge window configuration only while the app drawer is visible. This allows applyWindowInsets() to receive the actual IME inset and lift the search bar above the keyboard. Once the drawer closes, the flags are restored so the home screen and other UI elements maintain their wallpaper-behind-the-bars appearance.

https://claude.ai/code/session_01XGBCj9hdWMBcqXs7YMo22b

Users reported that opening the keyboard in the app drawer hid the
bottom-anchored search bar behind it, so they couldn't see what they
were typing.

The drawer already asked for SOFT_INPUT_ADJUST_RESIZE and padded itself
by the IME inset, but that never worked: the launcher window is laid out
edge-to-edge via the theme's translucent system bars plus
FLAG_LAYOUT_NO_LIMITS added in MainActivity. While those flags are set,
Android silently ignores ADJUST_RESIZE (the window never shrinks for the
keyboard) and reports the IME inset as zero, leaving the search bar
tucked behind the keyboard.

Clear those resize-blocking flags while the drawer is visible so the
window can resize for the keyboard, and restore them in onStop so the
rest of the launcher keeps its edge-to-edge, wallpaper-behind-the-bars
look. Scoped to the drawer alongside the existing softInputMode
save/restore.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XGBCj9hdWMBcqXs7YMo22b
@ketansp
ketansp merged commit fe00371 into master Jul 28, 2026
1 check passed
@ketansp
ketansp deleted the claude/search-bar-keyboard-visibility-rge1be branch July 28, 2026 12:34
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.

2 participants