Fix keyboard IME inset handling in app drawer - #74
Merged
Conversation
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
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.
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
clearedWindowFlagsfield to track which window flags were cleared inonStart()RESIZE_BLOCKING_WINDOW_FLAGSconstant in companion object listing the three flags that defeatSOFT_INPUT_ADJUST_RESIZE:FLAG_LAYOUT_NO_LIMITSFLAG_TRANSLUCENT_STATUSFLAG_TRANSLUCENT_NAVIGATIONonStart()to:SOFT_INPUT_ADJUST_RESIZE(existing behavior)onStop()to restore exactly the flags that were cleared, preserving the edge-to-edge look for the rest of the launcherImplementation 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