joetesta
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2017
09:42 AM
Rowlist focusBitmapUri offset on first focus
Hello,
Is this a problem with the 9 patch I'm using, is there an example app with a "good" 9 patch I can test against?
I'm trying to use a custom 9 patch for focusBitmapUri in a rowlist and seeing that every time the rowlist gets focus the first time, the selector is offset a bit to the left. Any navigation from there gets the selector in the correct position.
Trying to figure out what's going on here, I took the Example Rowlist app, included my 9 patch and modified "rowlistscene.xml" like so:
and commented out the scaling in "rowlistitem.xml"
It has the exact same problem - on first focus to the rowlist, the custom focusBitmapUrl is offset to the left and any navigation corrects it.

Is this a problem with the 9 patch I'm using, is there something else going on? Any suggestions?
tyvmia
Joe
Is this a problem with the 9 patch I'm using, is there an example app with a "good" 9 patch I can test against?
I'm trying to use a custom 9 patch for focusBitmapUri in a rowlist and seeing that every time the rowlist gets focus the first time, the selector is offset a bit to the left. Any navigation from there gets the selector in the correct position.
Trying to figure out what's going on here, I took the Example Rowlist app, included my 9 patch and modified "rowlistscene.xml" like so:
<?xml version = "1.0" encoding = "utf-8" ?>
<!--********** Copyright 2016 Roku Corp. All Rights Reserved. **********-->
<component name = "RowListExample" extends = "Scene" initialFocus = "mybutton" >
<script type = "text/brightscript" >
<![CDATA[
sub init()
m.top.backgroundURI = "pkg:/images/rsgde_bg_hd.jpg"
m.rowlist = m.top.findNode("exampleRowList")
mybutton = m.top.findnode("mybutton")
mybutton.observeField("buttonSelected", "clicked")
m.rowlist.content = CreateObject("roSGNode", "RowListContent")
m.top.setFocus(true)
end sub
function clicked()
? " MyButton clicked :: setting focus on rowlist"
if m.rowlist = invalid then m.rowlist = m.top.getchild(1)
m.rowlist.setFocus(true)
end function
]]>
</script>
<children >
<Button id="mybutton" minwidth="300" height="100" text="click me" translation = "[ 130, 30 ]" />
<RowList
id = "exampleRowList"
translation = "[ 130, 160 ]"
itemComponentName = "RowListItem"
numRows = "4"
itemSize = "[ 1608, 308 ]"
rowItemSize = "[ [512, 288] ]"
rowItemSpacing = "[ [40, 0] ]"
itemSpacing = "[ 0, 40 ]"
showRowLabel = "[ true ]"
focusBitmapUri="pkg:/images/highlight_focus.9.png" />
</children>
</component>
and commented out the scaling in "rowlistitem.xml"
sub showfocus()
'scale = 1 + (m.top.focusPercent * 0.08)
'm.itemposter.scale = [scale, scale]
end sub
It has the exact same problem - on first focus to the rowlist, the custom focusBitmapUrl is offset to the left and any navigation corrects it.

Is this a problem with the 9 patch I'm using, is there something else going on? Any suggestions?
tyvmia
Joe
aspiring
4 REPLIES 4
joetesta
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2017
10:14 AM
Re: Rowlist focusBitmapUri offset on first focus
fwiw toggling focus on first entry corrects it;
Maybe need to do this anywhere there's a rowlist with a custom focusBitmapUri ?
function clicked()
? " MyButton clicked :: setting focus on rowlist"
m.rowlist.setFocus(true)
mybutton = m.top.findnode("mybutton")
mybutton.setFocus(true)
m.rowlist.setFocus(true)
end function
Maybe need to do this anywhere there's a rowlist with a custom focusBitmapUri ?
aspiring
joetesta
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2017
11:35 AM
Re: Rowlist focusBitmapUri offset on first focus
Update: this bug is affected by rowFocusAnimationStyle, seems this only happens when using the default "floatingFocus" and using "fixedFocusWrap" prevents the bug.
Wonder if this is something that might be corrected?
Wonder if this is something that might be corrected?
aspiring
BVatBBOD
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2018
11:30 AM
Re: Rowlist focusBitmapUri offset on first focus
Found another "workaround" solution....
Seems to do the trick
Thanks to the guys over at the Roku Developers Slack chat who pointed me here and helped me come up with a solution!
See https://forums.roku.com/viewtopic.php?f=34&t=138220To join!
m.rowlist.setFocus(true)
m.rowlist.setFocus(false)
m.rowlist.setFocus(true)
Seems to do the trick
Thanks to the guys over at the Roku Developers Slack chat who pointed me here and helped me come up with a solution!
See https://forums.roku.com/viewtopic.php?f=34&t=138220To join!
Join the Roku Developers Slack Workspace for quicker help and great dev collaboration: http://tiny.cc/nrdf0y
silentEngineer
Channel Surfer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2023
01:13 AM
Re: Rowlist focusBitmapUri offset on first focus
i need help for this too not the solutions mentioned are not working for me.