Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Level 7

Horizontal MarkupGrid w/ a single row focus issue?

I am trying to create a horizontal list of labels at top of screen for navigation similar to what iHeartRadio uses. I am new to Brightscript and could not figure out a way to use LabelList horizontally which would be all I need. So, I am using a MarkupGrid with number of rows set to 1 which does work. However, when I select a label, I would like to change the font of the label to bold and not highlight it. I tried using 'focusPercent' in the gridItem, but have 2 issues:

1. The font is changed for the first element even before the MarkupGrid has focus.
2. The font is not changed back even when I leave the element.

Since I am new to the platform, I am sure that there are better ways of going about what I am doing. Any help would be appreciated. (Please ignore the image - just some more test code)

My code is below:

function showFocus()
'    if ( <> invalid)
        if = 1.0
        else if = 0.0
        end if
'    end if
'    if focus
'    else
'        m.itemText.font="font:MediumSystemFont"
'    end if
'    print
end function

<?xml version="1.0" encoding="utf-8" ?>
<!--********** Copyright 2016 Roku Corp.  All Rights Reserved. **********-->

<component name="SimpleGridItem" extends="Group" xmlns:xsi="" xsi:noNamespaceSchemaLocation="">
  <field id="itemContent" type="node" onChange="itemContentChanged"/> 
  <field id="focusPercent" type="float" onChange="showfocus"/>

<script type="text/brightscript" uri="pkg:/components/SimpleGridItem.brs" />
<LayoutGroup layoutDirection="vert" vertAlignment="top" itemSpacings="20" translation="[0,0]" >
<Poster id="itemImage" translation="[17,3]" width="195" height="150" />

<LayoutGroup layoutDirection="horiz" horizAlignment="center" itemSpacings="0" >
<Label id="itemText" font="font:MediumSystemFont" horizAlign="center"/>


0 Kudos
1 REPLY 1\
Level 7

Re: Horizontal MarkupGrid w/ a single row focus issue?

Same issue did you find solution?

0 Kudos