fix(tv): re-enable navigation_home nextFocusRight so D-pad can reach the 'None' provider button - #3126
Conversation
…'None' provider button
The previous attempt only handled rail-button navigation to home via onNavDestinationSelected. Returning via the back stack (popBackStack) or on first load never re-pointed the rail's nextFocusRightId, so D-pad right from the rail could not reach the 'None' / provider selector button. Move the home case into addOnDestinationChangedListener, which fires on every arrival at home regardless of navigation path (rail button, back stack pop, first load).
fire-light42
left a comment
There was a problem hiding this comment.
Great change. I would have merged if not for the new bug.
| // Re-point nav rail focus at the provider button on every arrival | ||
| // (rail button, back stack pop, first load), so D-pad right always | ||
| // reaches the "None" / provider selector button. | ||
| if (isLayout(TV or EMULATOR)) { |
There was a problem hiding this comment.
This pull request works and it really is an important bug fix, but right now it breaks D-pad behavior when pressing right on a populated home screen. It always changes focus to home_change_api even if home_change_api is not visible on the screen when scrolled down.
I am not sure how to best solve this issue. I can not trade one bug for another. Please see if you can resolve this new bug.
|
The scrolled-down case is fixed: the rail re-point now lives in HomeFragment instead of MainActivity, targeting home_change_api only when the home list is at scroll top. When scrolled, the rail buttons get no explicit right-target, so RIGHT from the rail uses default focus search and enters content, matching the old populated-home behavior. Triggers: the existing homeMasterRecycler onScrolled listener plus doOnLayout, which covers first load and returning to a home fragment recreated at a saved scroll offset. The MainActivity destination-listener block was reverted. |
tested. when there is homepage loaded with plugin and has rows. the dpad doesn't focus on the |
Fixes #2592
Problem
On TV, the D-pad cannot reach the "None" / provider-selector button (
home_change_api) on the home screen. After navigating away from Home and back (via Search/Favorites, the BACK button, or even a fresh load), pressing right from the nav rail does nothing — focus is stuck on the rail.Root cause
onNavDestinationSelected(MainActivity.kt) setsnextFocusRightIdon all nav-rail buttons when navigating to Search/Favorites/Downloads (pointing at e.g.main_search), but thenavigation_homecase was commented out with a stale id. Two problems followed:main_search, so right-focus from the rail was dead.Fix
Move the Home rail-focus handling into
addOnDestinationChangedListener(MainActivity.kt), which fires on every arrival at Home regardless of how you got there:so on every visit to Home, all rail buttons'
nextFocusRightIdpoint at the provider-selector button.Verification
Reproduced on the TV emulator (blank home, "None" selected) across all three arrival paths:
home_change_apihome_change_apiAlso verified with a plugin + home content loaded (StreamPlay): LEFT/RIGHT between rail and provider button works, and DOWN from the provider button drops into content as before.
Notes
home_preview_change_api); the live id ishome_change_api, which exists in bothfragment_home.xmlandfragment_home_tv.xml.<requestFocus />infragment_home_tv.xml; this change additionally makes the rail→provider path work on every arrival.AI note: this change was written with AI assistance per AI-POLICY.md; the logic was reproduced and verified on the TV emulator and every line is understood.