Roku Developer Program

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

Possible Grid Bug

I'm not sure if this is a bug in my code itself or a bug in the Roku software. It seems to be that if you use a specific combination of function calls it will make the row list indexes and the row focus index produce gibberish. I'm able to replicate it in the Simple Grid example. So here is a link to the full code that causes the problem:

https://www.dropbox.com/s/bohy240b34llw ... leGrid.txt

So if you use a "mixed-aspect-ratio" grid style, then set an empty content row and then hide that empty row, you can cause all sorts of problems in it by also setting the row styles. So doing this:


print "enter showGridScreen"

categoryList = getCategoryList()
categoryList[0] = "GridStyle: " + gridstyle
categoryList[1] = "Test Empty: "
screen.setupLists(categoryList.count())
screen.SetListNames(categoryList)

' Uncomment To cause bad row data
'screen.SetListPosterStyles(["portrait","portrait","portrait","portrait","portrait","portrait"])

StyleButtons = getGridControlButtons()
screen.SetContentList(0, StyleButtons)
screen.SetContentList(1, []) ' Empty Row
for i = 2 to categoryList.count()-1
screen.SetContentList(i, getShowsForCategoryItem(categoryList[i]))
end For

screen.SetListVisible(1, false) ' Hide Empty Row

screen.Show()

Here is a sample of the output:

------ Running ------
starting grid style= mixed-aspect-ratio
enter showGridScreen
getting shows for category History
getting shows for category News
getting shows for category Comedy
getting shows for category Drama
Waiting for message
Got Message:roGridScreenEvent
msg= , index= 0 data= 0
list item focused | current show = 0
Waiting for message
Got Message:roGridScreenEvent
msg= , index= 20 data= 8947848
list item focused | current show = 20
Waiting for message
Got Message:roGridScreenEvent
msg= , index= 0 data= 0
list item focused | current show = 0
Waiting for message
Got Message:roGridScreenEvent
msg= , index= 2 data= 0
list item focused | current show = 2
Waiting for message

Does anybody notice anything wrong with the code itself. Doesn't seem like it should be producing the gibberish row data like it does. Am I doing anything wrong or is it a bug? Thanks.
0 Kudos
1 Reply
KentL
Level 7

Re: Possible Grid Bug

I have just encountered the exact problem described above. Commenting out the screen.SetListPosterStyles keeps the problem from happening. But this does seem to be a bug in the roGridScreen that manifests when hiding one or more rows, particularly if the bottom row is hidden.

Avoiding SetListPosterStyles also fixed a couple of annoyances such as the item selector flickering when navigating between rows. Also the description box would disappear if the up button was pressed while on the top row (or the down button on the bottom row).

I do believe this to be a bug in the grid component but if there is a better workaround (than avoiding the SetListPosterStyles) I'd love to know!
0 Kudos