### Install app dependencies Source: https://github.com/amazonappdev/vega-tv-interfaces-sample/blob/main/README.md Run this command in the source code directory to install dependencies. Installation can take several minutes. ```bash npm install ``` -------------------------------- ### Start the Vega Virtual Device Source: https://github.com/amazonappdev/vega-tv-interfaces-sample/blob/main/README.md Run this command to start the Vega Virtual Device at the command prompt. ```bash vega virtual-device start ``` -------------------------------- ### useFocusGuideEventHandler Example Source: https://github.com/amazonappdev/vega-tv-interfaces-sample/blob/main/src/services/focusGuide/README.md Use this hook to listen for TV remote events and update state. The handler receives an event object with details about the event. ```jsx import React, { useState } from 'react'; import { Text, View } from 'react-native'; import { useFocusGuideEventHandler } from '@AppServices/focusGuide'; const TVRemoteHandler = () => { const [lastEventType, setLastEventType] = useState(null); const myTVEventHandler = (evt) => { if (evt && evt.eventType) { setLastEventType(evt.eventType); } }; useFocusGuideEventHandler(myTVEventHandler); return ( Press a button on the TV remote Last event: {lastEventType || 'None'} ); }; ``` -------------------------------- ### Install @amazon-devices/keplerscript-netmgr-lib Source: https://github.com/amazonappdev/vega-tv-interfaces-sample/blob/main/src/services/netInfo/README.md Install the required package to use the NetInfo Service. This is a prerequisite for the service to function. ```bash npm install @amazon-devices/keplerscript-netmgr-lib ``` -------------------------------- ### Run app on Vega Virtual Device (x86_64) Source: https://github.com/amazonappdev/vega-tv-interfaces-sample/blob/main/README.md Install and launch the app on the Vega Virtual Device for x86_64-based devices. ```bash vega run-app build/x86_64-release/keplertvinterfaces_x86_64.vpkg ``` -------------------------------- ### Example .env file Source: https://github.com/amazonappdev/vega-tv-interfaces-sample/blob/main/src/services/appConfig/README.md Define environment variables in a .env file at the project root. Copy and adjust the existing .env.example file. ```bash REACT_APP_DEBUG=true REACT_APP_API_URL=https://api.example.com ``` -------------------------------- ### makeListNavigationHintPropsGenerator usage example Source: https://github.com/amazonappdev/vega-tv-interfaces-sample/blob/main/src/services/a11y/README.md Factory for hint props for components in order, wrapping `injectListNavigationHints`. The example shows creating a generator for vertical navigation guides and applying it to a button and a horizontal component group. ```typescript // vertical navigation guides for screen sections const screenA11yNavigationHintsGenerator = makeListNavigationHintPropsGenerator( [ btnChangeLanguageLabel, t('my-screen-a11y-horiz-buttons-section-hint'), ], { directionLabels: { previous: t('a11y-hint-direction-up'), next: t('a11y-hint-direction-down'), }, formatOtherItemNavigationHint: ({ item, direction }) => t('menu-item-use-direction-to-go-to-a11y-label') .replace('', direction) .replace('', item), }, ); ...