A powerful RowList alternative for Roku's SceneGraph
NOTE: this is a work in progress. Nothing has been published, and the design is not yet finalized. i.e. you can't actually use it yet. Coming soon!
The preferred way to install the list is through the ropm package manager for roku
ropm install roku-smart-label
-
Download the latest release from releases and extract the zip.
-
Copy the files into your
pkg:/components
folder. The package contents should look something like this:./YourApp ├─ components/ | ├─ SmartList/ | | ├─ SmartList.brs | | ├─ SmartList.xml │ | └─ ...other smart list files │ └─ MainScene.xml ├─ source/ │ └─ main.brs └─ manifest
Declare the component in your xml like this. Be sure to give it an ID so we can find it later in brightscript.
<component name="HomePage">
<children>
<SmartList id="homeList">
</children>
<script uri="HomePage.brs">
</component>
Now we need to populate the list with some data:
HomePage.brs
sub init()
m.homeList = m.top.findNode("homeList")
rowCount = 10
cellCount = 10
content = createObject("roSGNode", "ContentNode")
for r = 0 to rowCount
rowContent = listContent.createChild("ContentNode")
for c = 0 to cellCount
cellContent = rowContent.createChild("ContentNode")
cellContent.update({
title: "Row " + r.ToStr() + " Cell " + c.ToStr()
})
end for
end for
'assign the content of the list, this will render the list
m.homeList.content = content
end sub