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: 
arno
Level 7

RowList Poster Incorrectly Displayed

Hello!

I have a RowList containing 32 rows. Each Row has an "itemComponentName" that contains a Poster component. For some of the rows, the first 4 items are displayed incorrectly, their position is translated to the right and towards the bottom of the screen. If I replace the poster with a Rectangle of let's say 100x100 pixels, all the items are correctly displayed, none of them is weirdly translated.

Why is this happening?
0 Kudos
5 Replies
ChrisDP
Level 7

Re: RowList Poster Incorrectly Displayed

Can you provide any sample code for the itemComponent that contains the poster? 
Christopher Dwyer-Perkins
Developer, REDspace
redspace.com
0 Kudos
arno
Level 7

Re: RowList Poster Incorrectly Displayed

<script type="text/brightscript">
        <![CDATA[
            Sub Init()
                m.Poster = m.top.findNode("poster")
                m.landscapeRows = { "Search & Info": 0, "Featured" : 1 }
                m.Poster.opacity = 0.2
                m.Label = m.top.findNode("titleLabel")
                m.Label.text = ""
            End Sub
sub itemContentChanged()
m.top.itemContent.observeField("itemIsFocused", "onItemIsFocusedChange")
        m.Label.text = ""
           m.Label.visible = false
           if m.landscapeRows[m.top.itemContent.category] <> invalid
            if m.top.itemContent.category = "Featured"
            m.Poster.width = 288
              m.Poster.height = 188
              if m.top.itemContent.landscape_img <> ""
              m.Poster.uri = m.top.itemContent.landscape_img
              else
              m.Poster.uri = "pkg:/images/default_movie_image.jpg"
              end if
              m.Label.visible = true
                m.Label.text = m.top.itemContent.title
            end if
            if m.top.itemContent.category = "Search & Info"
                m.Poster.width = 127
                m.Poster.height = 127
                centerX = (270 - m.Poster.width) / 2
                centerY = (196 - m.Poster.height) / 2
                m.Poster.translation = [ centerX, centerY ]
                m.Poster.uri = m.top.itemContent.HDPOSTERURL
                m.Label.visible = true
                m.Label.text = m.top.itemContent.title 
               end if
else
            m.Poster.width = 188
               m.Poster.height = 288
               if m.top.itemContent.HDPOSTERURL <> ""
                m.Poster.uri = m.top.itemContent.HDPOSTERURL
else
m.Poster.uri = "pkg:/images/default_movie_image.jpg"
end if
end if
end sub
            sub onItemIsFocusedChange()
            if m.top.itemContent.itemIsFocused
            m.Poster.opacity = 1
            m.Label.opacity = 1
            else
            m.Poster.opacity = 0.2
            m.Label.opacity = 0.2
            end if
            end sub
]]>
</script>
<children>
<Poster id="poster" width="188" height="288" translation="[-13, 6]"
loadingBitmapUri="pkg:/images/default_movie_image.jpg"
failedBitmapUri="pkg:/images/default_movie_image.jpg"
loadDisplayMode="scaleToFill" />
<Label id="titleLabel" visible="false" translation="[-15, 205]">
<Font role="font" uri="pkg:/fonts/GothamNarrow-Medium.otf" size="22" />
</Label>
</children>
0 Kudos
arno
Level 7

Re: RowList Poster Incorrectly Displayed

I printed the translation property for all the items and for those items that were incorrectly displayed, the translation was indeed different. I manually set the translation for all of my cases and now everything is properly displayed. Strange, somehow I think the translation that has to be done for the items in my "Search & Info" category was applied to those random rows also.
0 Kudos
ChrisDP
Level 7

Re: RowList Poster Incorrectly Displayed

Investing. Glad you found the problem  Smiley Very Happy
Christopher Dwyer-Perkins
Developer, REDspace
redspace.com
0 Kudos
joetesta
Level 10

Re: RowList Poster Incorrectly Displayed

Do you have multiple SG children having the same id of "poster" and hence are getting incorrectly grabbed when you do the update of one particular child?  When you first update your children with the content, try setting their id to something unique at the same time.
aspiring
0 Kudos