jf-roku/components/extras/ExtrasItem.xml
2022-03-13 08:46:03 +00:00

38 lines
1.4 KiB
XML

<?xml version="1.0" encoding="utf-8" ?>
<component name="ExtrasItem" extends="JFGroup">
<interface>
<field id="itemContent" type="node" onChange="showContent" />
</interface>
<script type="text/brightscript">
<![CDATA[
function init() as void
m.posterImg = m.top.findNode("posterImg")
m.name = m.top.findNode("pLabel")
m.role = m.top.findNode("subTitle")
end function
sub showContent()
if m.top.itemContent <> Invalid
cont = m.top.itemContent
m.name.text = cont.labelText
m.name.maxWidth = cont.imageWidth
m.role.Width = cont.imageWidth
m.posterImg.uri = cont.posterUrl
m.posterImg.width = cont.imageWidth
m.role.Text = cont.subTitle
else
m.role.text = "Who??"
m.posterImg.uri = "pkg:/images/baseline_person_white_48dp.png"
end if
end sub
]]>
</script>
<children>
<LayoutGroup layoutDirection="vert" >
<Poster id="posterImg" width="234" height="300" translation="[8,243]" failedBitmapUri="pkg:/images/baseline_person_white_48dp.png" />
<ScrollingLabel id="pLabel" horizAlign="center" vertAlign="bottom" maxWidth="266" font="font:SmallestBoldSystemFont" height="48" />
<Label id="SubTitle" horizAlign="center" vertAlign="center" font="font:SmallestBoldSystemFont" height="32" color="#A7A7A7FF" />
</LayoutGroup>
</children>
</component>