Comments (5)
Hello @jeremies.
I assume you are wanting to use react-native in this instance? If so then it should just be a matter of following the example here: https://github.com/NoriginMedia/Norigin-Spatial-Navigation/#using-the-library-in-react-native-environment
Here is an example React Native Android TV project: https://github.com/wouterds/react-native-tv-example, which has several example components you could wrap in the example provided above, f.ex. something similar to the Touchable component.
Perhaps you could elaborate a bit on where you are struggling?
from norigin-spatial-navigation.
Hello @predikament.
Yes, you are correct, we want to use react-native in this instance. I have followed the example https://github.com/NoriginMedia/Norigin-Spatial-Navigation/#using-the-library-in-react-native-environment you gave me with an expo blank app (npx create-expo-app NameApp) and it doesn't work.
Here you have the repo: https://github.com/jeremies/demo-norigin-spatial-navigation-androidtv
The important file is App.js: https://github.com/jeremies/demo-norigin-spatial-navigation-androidtv/blob/main/App.js
This demo has two blue buttons that should change to backgroundColor red when focused. But in an AndroidTV simulator doesn't work because the onFocus event never gets called. We can listen the sound when pressing arrow keys but the focus doesn't move.
How can this be fixed?
Thank you!
from norigin-spatial-navigation.
Hello again @jeremies,
I cannot see that this example is following the documentation quite as intended.
You are missing initializing the actual library.. : https://github.com/NoriginMedia/Norigin-Spatial-Navigation/#init
As well as enabling the native flag which is needed for React Native: https://github.com/NoriginMedia/Norigin-Spatial-Navigation/#nativemode-boolean-default-false
Please make sure to properly read the documentation before opening issues here. Best of luck to you!
from norigin-spatial-navigation.
Hello @predikament
Sorry, I have updated the repo https://github.com/jeremies/demo-norigin-spatial-navigation-androidtv with init function, but still doesn't work. Which are the steps that I have to follow to fix it?
Thank you!
from norigin-spatial-navigation.
Hi @jeremies
Sorry, I have updated the repo https://github.com/jeremies/demo-norigin-spatial-navigation-androidtv with init function, but still doesn't work. Which are the steps that I have to follow to fix it?
I believe the problem is that you need to use the react-native-tvos
Please look at the example that @predikament has provided above (https://github.com/wouterds/react-native-tv-example).
Just to be clear, we don't include any logic for focusing items natively. When your Android app has received focus on your items, then you can sync it with our library.
from norigin-spatial-navigation.
Related Issues (20)
- Test cases HOT 6
- React Native, cannot connect native focus to Norigin focus HOT 2
- Compatibility with WebView in AndroidTV HOT 1
- Can anyone check why manual setFocus not working as expected HOT 2
- RTL Flag isn't work HOT 1
- ScrollTo is not Working in Y - axis When Data is Wrapped inside the Row HOT 1
- Allow `ref` on items not yet displayed. (see below for more info)
- Allow for `onArrowPress` to have next focused node as property of KeyPressDetails HOT 1
- Unexplainable behaviour when focusable is removed
- Dynamic RTL switching
- A suggestion about keycode mapping HOT 2
- focus on closest element within the directional input? HOT 2
- Vertically stacked items focus issue HOT 1
- How to deal with conditional rendering of a FocusContext HOT 3
- Example scroll position incorrect when useGetBoundingClientRect: true HOT 1
- useFocusable CB on selected/focused child? HOT 1
- Add throttle: 250 and shouldFocusDOMNode: true in init causing scroll behavior weird HOT 2
- `navigateByDirection` does not trigger `onArrowPress` handler HOT 2
- Remember focus on navigate back HOT 2
- Wrong decision on distance measurement SpatialNavigation.ts : getSecondaryAxisDistance() HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from norigin-spatial-navigation.