Coder Social home page Coder Social logo

Comments (5)

predikament avatar predikament commented on June 26, 2024

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.

jeremies avatar jeremies commented on June 26, 2024

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.

predikament avatar predikament commented on June 26, 2024

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.

jeremies avatar jeremies commented on June 26, 2024

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.

guilleccc avatar guilleccc commented on June 26, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.