Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
ajaypaudel
Visitor

Adding menu list in video Screen

Hello,
i want to add the menu list in video screen and i have used LabelList and here is my code where i have created the ColumnChannelList custom node in from which i can get channel list and i have add funcnility of while clicking * the channel list rectangle is visible but focus on that list is not happening, can you guys help me out?here is the code
ChannelList.brs
function init()
 m.theColumnList = m.top.FindNode("theColumnList")
end function
on OnkeyEvent function
else if m.videoPlayer.visible = true and  m.theColumnList.visible=false and key = "options" then
print "menu opened"
           m.theColumnList.visible=true
           print m.theColumnList
           
           
           else if m.videoPlayer.visible = true and  m.theColumnList.visible=true and key = "options" then
           print "menu closed now"
           m.theColumnList.visible=false




ChannelList.xml
<ColumnChannelList id="theColumnList" translation="[0, 0]" visible="false"  />


ColumnChannelList.xml
<component name="ColumnChannelList" extends="Group" initialFocus = "coreList"  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://devtools.web.roku.com/schema/RokuSceneGraph.xsd">

<script type="text/brightscript" uri="pkg:/components/screen/ColumnList/ColumnChannelList.brs" />



<children>
 <Rectangle id="menuinvideoscreen" width="400" height="1000" color="0x000000"  opacity="0.6" >
    <LabelList
      id = "coreList"
      textHorizAlign="center"
      focusable="true"
      focusedColor="0xFF0000"
      drawFocusFeedback="true"
      drawFocusFeedbackOnTop="false"
      vertFocusAnimationStyle="floatingFocus"
      sectionDividerBitmapUri="pkg:/images/line.png"
      translation = "[ 0, 0 ]"
      itemSize = "[ 440, 48 ]"
      itemSpacing = "[ 0, 0 ]"
      sectionDividerHeight = "48.0"
      sectionDividerFont = "font:MediumBoldSystemFont"
      sectionDividerTextColor = "0x880088FF" />
 </Rectangle>
  </children>
</component>



ColumnChannelList.brs
 sub init()
  m.menuinvideoscreen = m.top.FindNode("menuinvideoscreen")
      m.list = m.top.FindNode("coreList")
 
      m.content = createObject("RoSGNode","ContentNode")
 
      addSection("Renderable Nodes")
      addItem("Rectangle")
      addItem("Rotated Rectangle")
      addItem("Label")
      addItem("Poster")
      addItem("Video")
      addItem("Video Zoom")
 
      addSection("Animation Nodes")
      addItem("Animation Vector 2D Interpolator")
      addItem("Animation Color Interpolator")
      addItem("Animation Float Interpolator")
      addItem("Sequential Animation")
      addItem("Parallel Animation")
      addItem("Fade-In Animation")
      addItem("Fade-Out Animation")
 
      addSection("Control Nodes")
      addItem("Timer")
 
      addSection("Lists and Grids")
      addItem("Poster Grid")
      addItem("Markup Grid")
 
      m.list.content = m.content
 
      m.top.setFocus(true) 
    end sub
 
    sub addSection(sectiontext as string)
      m.sectionContent = m.content.createChild("ContentNode")
      m.sectionContent.CONTENTTYPE = "SECTION"
      m.sectionContent.TITLE = sectiontext
    end sub
 
    sub addItem(itemtext as string)
      item = m.sectionContent.createChild("ContentNode")
      item.title = itemtext
    end sub

My problem is when i click * menulayer visible but focus on that menu item is not happening so can you guys help me out or did i did any mistake so that its not happening
0 Kudos
3 REPLIES 3
norcaljohnny
Roku Guru

Re: Adding menu list in video Screen

You need to set focus.

After 
m.theColumnList.visible=true
m.video.setFocus(false)
m.theColumnList.setFocus(true)


and then do the opposite when closing menu.
0 Kudos
ajaypaudel
Visitor

Re: Adding menu list in video Screen

"norcaljohnny" wrote:
You need to set focus.

After 
m.theColumnList.visible=true
m.video.setFocus(false)
m.theColumnList.setFocus(true)


and then do the opposite when closing menu.

We want to create a menu listing of all channel category and when hover or focused on channel category we want to list its channel list  and want ho have option like DVR Sd  in video screen, for more explanation we have attached the screenshot also, can you explain in detail how can we make like that in screenshot https://prnt.sc/mnzqyt
0 Kudos
destruk
Binge Watcher

Re: Adding menu list in video Screen

You should never use setfocus(FALSE) - because it is redundant.
When you set something with Setfocus(TRUE) the firmware automatically sets everything else's focus to false.

https://sdkdocs.roku.com/display/sdkdoc/ifSGNodeFocus
Even the SDK docs state
Setting the remote control focus to false is rarely necessary, and can lead to unexpected behavior.


Something should always have the focus at all times. Simply because you never want to miss an event.
0 Kudos