Skip to content

A powerful RowList alternative for Roku's SceneGraph

License

Notifications You must be signed in to change notification settings

rokucommunity/SmartList

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

SmartList

A powerful RowList alternative for Roku's SceneGraph

build status coverage status monthly downloads npm version license Slack

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!

Installation

ropm

The preferred way to install the list is through the ropm package manager for roku

ropm install roku-smart-label

Manual install

  1. Download the latest release from releases and extract the zip.

  2. 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

Usage

Initialization

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

About

A powerful RowList alternative for Roku's SceneGraph

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published