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

MarkupList does not create last element on OS 8.0


I've got the problem with markupList after OS 8.0 rolled out. Last item is not created until focus moved on that item.
I have reproduced this bug on example from sdk - after slight modification.
This is how list gets configured:
function init()
   m.simpleMarkupList ="SimpleMarkupList")
   m.simpleMarkupList.content = getMarkupListData()
   m.simpleMarkupGrid ="SimpleMarkupGrid")
   m.simpleMarkupGrid.content = getMarkupGridData()
   m.simpleMarkupList.ObserveField("itemFocused", "onFocusChanged")
   m.rowHeights = []
   m.itemIndex = 0{scene: m})
end function

function getMarkupListData() as object
   ? "getMarkupListData !!!!!!!!!!!!!!!!!!!!!"
   data = CreateObject("roSGNode", "ContentNode")

   for i = 1 to 5
       dataItem = data.CreateChild("SimpleListItemData")
       dataItem.posterUrl = ""
       dataItem.labelText = "This is list item " + stri(i)
       dataItem.label2Text = "Subitem " + stri(i)
   end for
   return data
end function

function itemContentChanged() 
 ? "itemContentChanged!!!!!"
 itemData =
 m.itemImage.uri = itemData.posterUrl
 m.itemText.text = itemData.labelText
 m.item2Text.text = itemData.label2Text
end function

function init()
 m.itemImage ="itemImage")
 m.itemText ="itemText")
 m.item2Text ="item2Text")
end function

function addItem()
 scene =
 ? "ITEM INDEX: "; scene.itemIndex
 if scene.rowHeights.count() = 0 then
     scene.rowHeights.append([0.0, 0.0, 0.0, 0.0, 0.0])
 end if
 scene.rowHeights[scene.itemIndex] = 50.0
 scene.simpleMarkupList.rowHeights = scene.rowHeights
 scene.itemIndex++ = scene
end function

The thing is that if rowHeights for all list items set to 0 then itemContentChanged gets triggered one time less than needed. I got 5 items in the list and if I launch this code on OS 7.0 itemContentChanged ran 5 times, but if I launch it on OS 8.0 itemContentChanged ran 4 times and fifth time it ran when I moved focus from fourth item to fifth.

The code snippet above in addItem() doesn't make much sense but it describes the problem we have got on production app. Bug is not present on OS 7.0 and it is present on OS 8.0. Can this be fixed with the next OS build?

0 Kudos