Master sample example
This app demonstrates an end-to-end streaming-app pattern: fetch a feed, browse a grid, view details, and play video.
Purpose
This app shows how the pieces of an app fit together in the RSG 2.0 SDK, including the following:
- Asynchronous data loading
- A state-machine-driven UI
- Navigation between screens
- BrightScript interoperation for app exit
Summary
This sample covers the following patterns:
- An
onMountasynchronousfetchof a remote JSON feed, parsed into typedRowandItemmodels - An
AppStatesignal (init,grid,detail,video) that gates which view renders through<Show> - Screen components:
GridView,DetailView, andVideoView, plus an Overhang - A
KeyHandlerthat drives back, left, and right navigation, withbackat the grid emitting anexitAppoutput so that BrightScript can close the app
Controls
You can use these keys to navigate the app:
- Arrow keys and OK: Navigate the grid and detail content
- Back: Step back through screens; at the grid, exit the app
Development
To build, test, and lint the sample, run these commands:
npx rk dev # Build + deploy to Roku device
pnpm test # Run tests
pnpm run lint # Lint sourcesUpdated about 4 hours ago
Did this page help you?