Hi all,
I’m working on a POC app for 10-foot UI devices (eg: Android TV) where users navigate primarily with arrow keys.
The main challenge is managing a single visible “focused” element and moving it between components using arrow keys. The FocusTraverser currently only supports backwards and forwards traversal, which doesn’t naturally map to up/down/left/right navigation in grids or other non-linear layouts. Tab-order mechanisms also tend to overwrite focus and aren’t flexible enough for 10-foot UI patterns; there’s no way to disable tabbing around or change its behaviours. And accessibility code seems relevant, in that it has focus related concepts, but is tightly coupled and not easily reusable.
I’m looking for advice on patterns to:
- Track and display one focused
Component.- Including having control over what the focus display looks like (eg: a red border, etc), preferably via a L&F but I’m open to alternatives.
- Navigate between components via arrow keys in flexible layouts.
- Including choosing whether a
Componentis focusable or not. (eg:canBeFocusedwithsetFocusableor something) - Includes between parent container Component boundaries…
- Including choosing whether a
- Work with any existing focus/tab system without fighting it.
If no clean solution exists yet, this might make a useful feature request.
Any guidance or examples would be greatly appreciated!
