hugetv
8 years agoVisitor
Helps insert content into RowList content
How can I have it load its item into each category by selecting it
How can I insert each ContentNode when selecting
This content -> http://www.sdktestinglab.com/homeoptionslistcontent.xml
<?xml version="1.0" encoding="utf-8" ?>
<!--********** Copyright 2016 Roku Corp. All Rights Reserved. **********-->
<!-- node that renders Grid Screen, handles bookmark buttons, and handles start of video playback -->
<component name="GridScreen" extends="Group">
<interface>
<!-- Row item selection handler -->
<field id="rowItemSelected" type="intarray" alwaysnotify="true" alias="RowList.rowItemSelected"/>
<!-- Row item focused handler -->
<field id="itemFocused" type="intarray" alias="RowList.rowItemFocused" onChange="OnItemFocused"/>
<!-- Interface to focused item (Content Node) -->
<field id="focusedContent" type="node"/>
</interface>
<script type="text/brightscript" >
<![CDATA[
Function Init()
Print"[GridScreen] Init"
m.rowList=m.top.findNode("RowList")
m.description=m.top.findNode("Description")
m.background=m.top.findNode("Background")
m.top.observeField("visible","onVisibleChange")
m.top.observeField("focusedChild","OnFocusedChildChange")
End Function
'handler of focused item in RowList
Sub OnItemFocused()
itemFocused=m.top.itemFocused
If itemFocused.Count()=2
focusedContent=m.top.content.getChild(itemFocused[0]).getChild(itemFocused[1])
If focusedContent<>invalid
m.top.focusedContent=focusedContent
m.description.content=focusedContent
m.background.uri=focusedContent.hdBackgroundImageUrl
End If
End If
End Sub
'set proper focus to RowList in case if return from Details Screen
Sub onVisibleChange()
If m.top.visible=TRUE
m.rowList.setFocus(TRUE)
End If
End Sub
'set proper focus to RowList in case if return from Details Screen
Sub OnFocusedChildChange()
If m.top.isInFocusChain() And Not m.rowList.hasFocus()
m.rowList.setFocus(TRUE)
End If
End Sub
]]>
</script>
<children>
<FadingBackground
id="Background"
width="1280"
height="720"
color="0xAAAAAA"
ShadeOpacity="0.8"/>
<Poster
id="Background"
translation="[0,0]"
uri="pkg:/images/Background/Fondo.jpg"
width="1280"
height="720" />
<Rectangle
translation="[0,0]"
width="1280"
height="720"
color="0x000000"
opacity="0.8"
/>
<RowList
id="RowList"
focusBitmapUri="pkg:/images/focus_grid.9.png"
translation="[-60,372]"
itemSize="[1327,218]"
numRows="2"
itemSpacing="[13,0]"
focusXOffset="[147]"
rowFocusAnimationStyle="fixedFocusWrap"
rowItemSize="[[262,147]]"
rowItemSpacing="[[16.5,3]]"
showRowLabel="true"
showRowCounter="true"
rowLabelOffset="[[147,20]]"
>
<ContentNode id="menucontent" role="content">
<ContentNode
id="0"
title="INSERT CONTENT HERE" />
<ContentNode
id="1"
title="INSERT CONTENT HERE" />
<ContentNode
id="2"
title="INSERT CONTENT HERE" />
<ContentNode
id="3"
title="INSERT CONTENT HERE" />
</ContentNode>
</RowList>
<Poster
translation="[0,650]"
uri="pkg:/images/BG_dark_down.png"
width="2000"
height="95" />
<Description
id="Description"
translation="[106,119]"
itemSpacings="[7,17]"/>
</children>
</component>
How can I insert each ContentNode when selecting
This content -> http://www.sdktestinglab.com/homeoptionslistcontent.xml