question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Proposal : TVFocusGuideView for Android

See original GitHub issue

Currently, it’s very difficult to direct Focus between Viewgroups of Touchables

ForExample

  1. In the below image it’s very difficult to direct focus from any items in cluster 2 to the previously focused item in cluster 1 to achieve this currently we have to set nextFocusUp props for all the children in cluster 2 to cluster 1 last focused item id.
tv-nav-focusable-1
  1. In the below example from all the horizontal list items we should open a previously selected menu, which is the second item. For this, we have to set all the first items of lists nextFocusLeft to the 2nd menu item id
Screenshot 2021-08-06 at 4 19 12 PM

Also, one more problem is we have to pass node id between components to achieve this via props which make components reusability an issue

Solution If we have WrapperView like TVFocusFocusGuide which gets focus first for a cluster and then based on requirement we can pass the focus to any of its children’s.

We have android:descendantFocusability and onRequestFocusInDescendants view group props which will let us achieve this behavior.

We can have a component that wraps touchable and controls the focus setup and movement between view groups.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:5
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
douglowdercommented, Oct 8, 2021

@TrebuhD that API looks VERY interesting indeed, thank you for letting me know.

2reactions
TrebuhDcommented, Oct 8, 2021

API-wise, it would be great to have something like react-spatial-navigation.

Read more comments on GitHub >

github_iconTop Results From Across the Web

React Native Repo with Additions for Apple TV Support - Morioh
TVFocusGuideView : This component provides support for Apple's ... You can use this open-source framework to code natively rendering Android and iOS mobile ......
Read more >
Building For TV Devices - React Native
TV devices support has been implemented with the intention of making existing React Native applications work on Apple TV and Android TV, ...
Read more >
IOS and android mobile app development using react native ...
Project details. I build app for IOS and android mobile app development platform then React Native/Expo is the best choice. I am experienced...
Read more >
react-native-tvos - npm
(but no Android TV devices) you can use: ... TVFocusGuideView: This component provides support for Apple's UIFocusGuide API, to help ensure ...
Read more >
0 - Stack Overflow
-2) Run this command below. $ cd android $ ./gradlew assembleRelease. -3) Result: I receive the following error message. index.js: Cannot find ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found