Created
August 7, 2020 00:46
-
-
Save febbraro/4b7794c8c30e70b59202cefea8e16934 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sub init() | |
' Setup the Activation Screen | |
m.activation = createObject("roSGNode", "ActivationView") | |
m.activation.ObserveField("activationSuccess", "MainScene_OnActivationSuccess") | |
' Setup the main Grid | |
m.grid = CreateObject("roSGNode", "GridView") | |
m.grid.SetFields({ | |
style: "standard" | |
posterShape: "16x9" | |
}) | |
' Fetch data for the grid | |
content = CreateObject("roSGNode", "ContentNode") | |
content.AddFields({ | |
HandlerConfigGrid: { | |
name: "RootHandler" | |
} | |
}) | |
' Attach the retrieved data to the grid | |
m.grid.content = content | |
' Get a handle on the Navbar | |
m.navbar = m.top.findNode("navbar") | |
end sub | |
sub Show(args as object) | |
print "Show MainScene" | |
' Lets set some overall Theme settings | |
scene = m.top.getScene() | |
scene.theme = { | |
global: { | |
OverhangVisible: false | |
} | |
} | |
' Hide the Navbar and display the intro screens | |
m.navbar.visible = false | |
m.top.ComponentController.CallFunc("show", { | |
view: m.activation | |
}) | |
m.top.signalBeacon("AppLaunchComplete") | |
end sub | |
sub MainScene_OnActivationSuccess(event as object) | |
?"MainScene_OnActivationSuccess" | |
ShowHomeScreen() | |
end sub | |
sub ShowHomeScreen() | |
m.navbar.visible = true | |
m.navbar.setFocus(true) | |
m.top.ComponentController.CallFunc("show", { | |
view: m.grid | |
}) | |
end sub |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<component name="MainScene" extends="BaseScene"> | |
<!-- importing main handler --> | |
<script type="text/brightscript" uri="pkg:/components/screens/MainScene.brs" /> | |
<script type="text/brightscript" uri="pkg:/components/controllers/DetailsViewLogic.brs" /> | |
<interface> | |
<field id="currentVideo" type="node" /> | |
</interface> | |
<children> | |
<Navbar translation="[0, 175]"/> | |
</children> | |
</component> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment