Fix search focus trap and improve D-Pad navigation#5319
Open
sandro-byte32 wants to merge 2 commits intojellyfin:masterfrom
Open
Fix search focus trap and improve D-Pad navigation#5319sandro-byte32 wants to merge 2 commits intojellyfin:masterfrom
sandro-byte32 wants to merge 2 commits intojellyfin:masterfrom
Conversation
- Migrate SearchTextInput to AppCompatEditText for better D-Pad support - Fix focus trap when dismissing keyboard via Back button - Enable IME re-triggering on D-Pad Center click - Improve visual highlighting for D-Pad navigation - Prevent focus navigation into empty search results
Author
|
To provide some context on the architectural changes in this PR: I decided to migrate SearchTextInput from the standard Compose BasicTextField to a wrapped AppCompatEditText (via AndroidView). The reason for this is that the current Compose implementation lacks the necessary low-level D-Pad and IME intercept capabilities, specifically the ability to override onKeyPreIme. This was the only reliable way to catch the Back button event while the keyboard is open and programmatically resolve the focus trap across various Android TV vendors (e.g., Sony, FireTV, Shield). This change allows for much more robust focus orchestration between the search input and the Leanback results grid. |
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.
Changes:
Overhauled the search screen navigation by migrating SearchTextInput from a standard Compose field to a wrapped AppCompatEditText. This fix resolves a focus trap occurring when the keyboard is dismissed via the Back button and ensures the IME can be re-triggered using the D-Pad Center button. Additionally, visual highlighting for D-Pad navigation was improved, and navigation into empty search result fragments is now prevented.
Code assistance:
Code was generated and refined using LLMs (Claude and Codex) to orchestrate complex focus transitions between Jetpack Compose components and the Leanback-based RowsSupportFragment. The AI assisted in implementing a robust AndroidView wrapper to handle low-level key events that are currently limited in standard Compose text fi
Fixes #5300
Refs #5160
Related to #5162