jf-roku/components/tvshows/rowlist-episode.brs

64 lines
1.4 KiB
Plaintext
Raw Normal View History

2019-05-03 12:48:59 +00:00
sub init()
2020-02-23 04:47:00 +00:00
m.top.itemComponentName = "TVListDetails"
m.top.content = setData()
2019-05-03 12:48:59 +00:00
2020-02-23 04:47:00 +00:00
m.top.rowFocusAnimationStyle = "floatingFocus"
2019-05-03 12:48:59 +00:00
2020-02-23 04:47:00 +00:00
m.top.showRowLabel = [false]
updateSize()
m.top.setFocus(true)
2019-05-03 12:48:59 +00:00
end sub
2020-02-23 04:51:53 +00:00
sub updateSize()
2020-02-23 04:47:00 +00:00
dimensions = m.top.getScene().currentDesignResolution
2019-05-03 12:48:59 +00:00
2020-02-23 04:47:00 +00:00
border = 75
m.top.translation = [border, border + 115]
2019-05-03 12:48:59 +00:00
2020-02-23 04:47:00 +00:00
textHeight = 80
itemWidth = (dimensions["width"] - border*2)
itemHeight = 300
2019-05-03 12:48:59 +00:00
2020-02-23 04:47:00 +00:00
m.top.visible = true
2019-05-03 12:48:59 +00:00
2020-02-23 04:47:00 +00:00
' Size of the individual rows
m.top.itemSize = [dimensions["width"] - border*2, itemHeight]
' Spacing between Rows
m.top.itemSpacing = [ 0, 40]
2019-05-03 12:48:59 +00:00
2020-02-23 04:47:00 +00:00
' Size of items in the row
m.top.rowItemSize = [ itemWidth, itemHeight ]
' Spacing between items in the row
m.top.rowItemSpacing = [ 20, 0 ]
end sub
2019-05-03 12:48:59 +00:00
2020-02-23 04:47:00 +00:00
function setupRows()
updateSize()
objects = m.top.objects
m.top.numRows = objects.items.count()
m.top.content = setData()
end function
2019-05-03 12:48:59 +00:00
2020-02-23 04:47:00 +00:00
function setData()
data = CreateObject("roSGNode", "ContentNode")
if m.top.objects = invalid then
' Return an empty node just to return something; we'll update once we have data
return data
end if
2019-05-03 12:48:59 +00:00
2020-02-23 04:47:00 +00:00
for each item in m.top.objects.items
row = data.CreateChild("ContentNode")
row.appendChild(item)
end for
2019-05-03 12:48:59 +00:00
2020-02-23 04:47:00 +00:00
return data
end function
2019-05-03 12:48:59 +00:00
2020-02-23 04:47:00 +00:00
function onKeyEvent(key as string, press as boolean) as boolean
if not press then return false
2019-05-03 12:48:59 +00:00
2020-02-23 04:47:00 +00:00
return false
end function