Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
OG_OTT
Visitor

ButtonGroup and focusBitmapUri not working

It appears that setting focusBitmapUri and focusFootprintBitmapUri do nothing at the ButtonGroup level.  Additionally, setting showFocusFootprint at the buttonGroup level also does nothing.  If I set this on the button level it 'kinda works' by showing the focusBitmap that I have, but it won't show the footprintBitmap or show the focusFootprint.  If I take the buttons out of the group it does work.

Here is my XML:

<?xml version="1.0" encoding="utf-8" ?>

<component name="loginScreen" extends="Group">
<script type="text/brightscript" uri="pkg:/components/screens/login/login.brs" />
    <script type="text/brightscript" uri="pkg:/components/enums/fonts.brs" />

    <interface>
    <field id="loginScreenReadyToLoad" type="bool" />
    </interface>

    <children>
    <Poster id="loginBackground" translation="[0,0]" />
    <Poster id="loginRandomWeatherImage" translation="[0,0]" />
    <ButtonGroup id="loginButtonGroup" translation="[600, 300]" focusBitmapUri="pkg:/assets/images/buttonSelected.9.png" focusFootprintBitmapUri="pkg:/assets/images/button.9.png" focusedIconUri="" iconUri="" showFocusFootprint="True">
            <Button id="LoginBtn" translation="[200,200]" text="Log-in" focusedIconUri="" iconUri="" showFocusFootprint="True"/>
        <Button id="EULABtn" translation="[200,200]" text="EULA" focusedIconUri="" iconUri="" showFocusFootprint="True"/>
        </ButtonGroup>
    </children>
</component>

 <!-- focusBitmapUri="pkg:/assets/images/buttonSelected.9.png" focusFootprintBitmapUri="pkg:/assets/images/button.9.png"  -->


Question:  What am I doing wrong with the buttonGroup?  My expectation was to have a bunch of buttons in a buttonGroup that I could globally set these styling attributes on the group level and have it apply to the children, but it appears not really work, despite the documentation (unless I missed something).  https://sdkdocs.roku.com/display/sdkdoc/ButtonGroup 

Thank you in advance.
0 Kudos
8 REPLIES 8
sharkieSBS
Newbie

Re: ButtonGroup and focusBitmapUri not working

I'm facing exactly the same issue and would love some guidance from Roku!

Does this sound familiar #OG_OTT?:
https://forums.roku.com/viewtopic.php?f=34&t=121160&p=603662#p603662
_______________________________________________________________________________
Craig Sharkie
Connected TV Lead, Engineering – EDS & OD
sbs.com.au
0 Kudos
norcaljohnny
Roku Guru

Re: ButtonGroup and focusBitmapUri not working

In your sub int() add this code

m.loginButtonGroup = m.top.findNode("loginButtonGroup")
m.loginButtonGroup.buttons = ["Log-in", "EULA"]



And your button group should look more like this.

<ButtonGroup
  id="loginButtonGroup"
  focusBitmapUri="pkg:/assets/images/buttonSelected.9.png"
  focusFootprintBitmapUri="pkg:/assets/images/button.9.png"
  translation="[600, 300]"
  />
0 Kudos
sharkieSBS
Newbie

Re: ButtonGroup and focusBitmapUri not working

@norcaljohnny This still won't allow each button to have an unfocused "state" image, will it?
_______________________________________________________________________________
Craig Sharkie
Connected TV Lead, Engineering – EDS & OD
sbs.com.au
0 Kudos
speechles
Roku Guru

Re: ButtonGroup and focusBitmapUri not working

    <ButtonGroup
  id="loginButtonGroup"
  focusBitmapUri="pkg:/assets/images/buttonSelected.9.png"
  focusFootprintBitmapUri="pkg:/assets/images/button.9.png"
  translation="[600, 300]"
  />

This is almost all you need. You don't need focusFootprintBitmapUri at all. The effect it provides isn't likely a desired one for what you are doing it serves no purpose. focusFootprintBitmapUri="" that is what you want for the footprint. You don't want one. You don't want the default. You just tell it nothing it renders nothing for it.

The ones you want to change for focus and unfocused are the text and icon.
textFont / focusedTextFont
textColor / focusedTextColor
iconUri / focusedIconUri

Make sure textFont and focusedTextFont are set to exactly the same thing unless you like the flashing. No one does. Set it the same. Do the same with textColor and focusedTextColor set them the same.

Make sure IconUri and focusedIconUri are set to exactly the same thing unless you want flashing icons or some other reason. usually set these two the same as well.

Use the focusBitmapUri to use with a 9 patch to create your focus indicator. This will be whatever color/style you want to be the background focus for your button.
0 Kudos
norcaljohnny
Roku Guru

Re: ButtonGroup and focusBitmapUri not working

"sharkieSBS" wrote:
@norcaljohnny This still won't allow each button to have an unfocused "state" image, will it?

Yes, it will allow for the unfocused state with your custom image, assuming it is located in your image folder.
0 Kudos
speechles
Roku Guru

Re: ButtonGroup and focusBitmapUri not working

"norcaljohnny" wrote:
"sharkieSBS" wrote:
@norcaljohnny This still won't allow each button to have an unfocused "state" image, will it?

Yes, it will allow for the unfocused state with your custom image, assuming it is located in your image folder.

Dude, what are you smoking? It must not be the same stuff I am... lol

You want IconUri/FocusedIconUri and FocusedBitmapUri(If you even want or care about a background focus). You do not want that footprint. I mean if you have a need for it use it but Roku set the default to "" for a reason. For a reason I say. Understand the reason because 99 times out of 100 it has an undesired effect of this lingering odd weird shadow thing hangs on a button til you navigate it to the new one as you navigate off. It is just a placeholder for where you will land when you move that button group back into focus. 99 times out of 100 intutively people know. They don't like clumsy reminders unless it is done for a reason. Roku sets it "" so you can hopefully never use it. When you do you see it and go.. oh.. I see what that does it makes it look horrible. LOL

But you need to help people without misleading them. The individual in this case wants to use IconUri and FocusedBitmapUri to change an entire button as the focus and not just tint/blendcolor it or throw a background behind it or change its background. There are multiple ways to handle this. Focus is a wonderful thing since it can be so many things. Focus is alot like Tigger from Winnie the Pooh. The wonderful thing about focus is the tops are made out of rubber the bottoms are made out of springs. My focus is anyways.

Have fun with this. Don't get angry you cannot figure it out. Not everyone shares advice who really knows what they are doing. They have limited time. Whatever the reason there are some people who share code that are wonderful. You go wow I can dig that. Learn from it. Thanks for sharing. Then other times where you go.. wow.. I wish people would help only when they really know themselves what they are doing to help. You help people but hurt them by limit their knowledge by the limit of your own. Read the docs on button group ( https://sdkdocs.roku.com/display/sdkdoc/ButtonGroup ) not just saying this to blow wind in your face either. Not saying it to put you in your place. Just saying it because that is an obvious and most crucial place to start when you want to know something. Once you see how it is supposed to work try it. Does it work that way? How does it work? Can you figure out how it works if it differs from the SDK says it should? If you can make a note and always remember that. Share with us when you notice this difference.

There are many places the docs are not correct with how things work today. They were written yesterday. Always remember this. The best advice is your own, even if you don't take it or want to second guess yourself. The second best advice is to read the docs. The third best advice is trust no one. Believe nothing. Try code people give before you put confidence in anything they provide (text or code or conversation). You need to learn from good examples. The best examples are those which need no explanation. The simplest answer is likely correct. In this case it is just misunderstanding the button group and the uri to use for the buttons.

To mislead someone may not have been intentional but it is noticed by myself and others. If you can limit the misinformation you spread you are part of the solution otherwise you are part of the problem. Thanks for reading. 🙂
0 Kudos
norcaljohnny
Roku Guru

Re: ButtonGroup and focusBitmapUri not working

"speechles" wrote:
"norcaljohnny" wrote:
"sharkieSBS" wrote:
@norcaljohnny This still won't allow each button to have an unfocused "state" image, will it?

Yes, it will allow for the unfocused state with your custom image, assuming it is located in your image folder.

Dude, what are you smoking? It must not be the same stuff I am... lol

You want IconUri/FocusedIconUri and FocusedBitmapUri(If you even want or care about a background focus). You do not want that footprint. I mean if you have a need for it use it but Roku set the default to "" for a reason. For a reason I say. Understand the reason because 99 times out of 100 it has an undesired effect of this lingering odd weird shadow thing hangs on a button til you navigate it to the new one as you navigate off. It is just a placeholder for where you will land when you move that button group back into focus. 99 times out of 100 intutively people know. They don't like clumsy reminders unless it is done for a reason. Roku sets it "" so you can hopefully never use it. When you do you see it and go.. oh.. I see what that does it makes it look horrible. LOL

But you need to help people without misleading them. The individual in this case wants to use IconUri and FocusedBitmapUri to change an entire button as the focus and not just tint/blendcolor it or throw a background behind it or change its background. There are multiple ways to handle this. Focus is a wonderful thing since it can be so many things. Focus is alot like Tigger from Winnie the Pooh. The wonderful thing about focus is the tops are made out of rubber the bottoms are made out of springs. My focus is anyways.

Have fun with this. Don't get angry you cannot figure it out. Not everyone shares advice who really knows what they are doing. They have limited time. Whatever the reason there are some people who share code that are wonderful. You go wow I can dig that. Learn from it. Thanks for sharing. Then other times where you go.. wow.. I wish people would help only when they really know themselves what they are doing to help. You help people but hurt them by limit their knowledge by the limit of your own. Read the docs on button group ( https://sdkdocs.roku.com/display/sdkdoc/ButtonGroup ) not just saying this to blow wind in your face either. Not saying it to put you in your place. Just saying it because that is an obvious and most crucial place to start when you want to know something. Once you see how it is supposed to work try it. Does it work that way? How does it work? Can you figure out how it works if it differs from the SDK says it should? If you can make a note and always remember that. Share with us when you notice this difference.

There are many places the docs are not correct with how things work today. They were written yesterday. Always remember this. The best advice is your own, even if you don't take it or want to second guess yourself. The second best advice is to read the docs. The third best advice is trust no one. Believe nothing. Try code people give before you put confidence in anything they provide (text or code or conversation). You need to learn from good examples. The best examples are those which need no explanation. The simplest answer is likely correct. In this case it is just misunderstanding the button group and the uri to use for the buttons.

To mislead someone may not have been intentional but it is noticed by myself and others. If you can limit the misinformation you spread you are part of the solution otherwise you are part of the problem. Thanks for reading. 🙂



Hey man dont come off like a prick. I didnt pay attention to the focus uri and such, only they way his code was in general for the way he had coded his button group.
You wrote alot of BS but didnt answer his question or even try to come off as a helpful user so save the crap.
0 Kudos
speechles
Roku Guru

Re: ButtonGroup and focusBitmapUri not working

"norcaljohnny" wrote:
"speechles" wrote:
"norcaljohnny" wrote:
"sharkieSBS" wrote:
@norcaljohnny This still won't allow each button to have an unfocused "state" image, will it?

Yes, it will allow for the unfocused state with your custom image, assuming it is located in your image folder.

Dude, what are you smoking? It must not be the same stuff I am... lol

You want IconUri/FocusedIconUri and FocusedBitmapUri(If you even want or care about a background focus). You do not want that footprint. I mean if you have a need for it use it but Roku set the default to "" for a reason. For a reason I say. Understand the reason because 99 times out of 100 it has an undesired effect of this lingering odd weird shadow thing hangs on a button til you navigate it to the new one as you navigate off. It is just a placeholder for where you will land when you move that button group back into focus. 99 times out of 100 intutively people know. They don't like clumsy reminders unless it is done for a reason. Roku sets it "" so you can hopefully never use it. When you do you see it and go.. oh.. I see what that does it makes it look horrible. LOL

But you need to help people without misleading them. The individual in this case wants to use IconUri and FocusedBitmapUri to change an entire button as the focus and not just tint/blendcolor it or throw a background behind it or change its background. There are multiple ways to handle this. Focus is a wonderful thing since it can be so many things. Focus is alot like Tigger from Winnie the Pooh. The wonderful thing about focus is the tops are made out of rubber the bottoms are made out of springs. My focus is anyways.

Have fun with this. Don't get angry you cannot figure it out. Not everyone shares advice who really knows what they are doing. They have limited time. Whatever the reason there are some people who share code that are wonderful. You go wow I can dig that. Learn from it. Thanks for sharing. Then other times where you go.. wow.. I wish people would help only when they really know themselves what they are doing to help. You help people but hurt them by limit their knowledge by the limit of your own. Read the docs on button group ( https://sdkdocs.roku.com/display/sdkdoc/ButtonGroup ) not just saying this to blow wind in your face either. Not saying it to put you in your place. Just saying it because that is an obvious and most crucial place to start when you want to know something. Once you see how it is supposed to work try it. Does it work that way? How does it work? Can you figure out how it works if it differs from the SDK says it should? If you can make a note and always remember that. Share with us when you notice this difference.

There are many places the docs are not correct with how things work today. They were written yesterday. Always remember this. The best advice is your own, even if you don't take it or want to second guess yourself. The second best advice is to read the docs. The third best advice is trust no one. Believe nothing. Try code people give before you put confidence in anything they provide (text or code or conversation). You need to learn from good examples. The best examples are those which need no explanation. The simplest answer is likely correct. In this case it is just misunderstanding the button group and the uri to use for the buttons.

To mislead someone may not have been intentional but it is noticed by myself and others. If you can limit the misinformation you spread you are part of the solution otherwise you are part of the problem. Thanks for reading. 🙂



Hey man dont come off like a prick. I didnt pay attention to the focus uri and such, only they way his code was in general for the way he had coded his button group.
You wrote alot of BS but didnt answer his question or even try to come off as a helpful user so save the crap.

Please behave. If all you have to say is you didn't pay attention then simply say that. Why did you type the rest? Why did you insult me with this prick statement? You were offended you were too quick to give advice? If you can't be bothered to read the poor fellows post to offer help when they are being contrite. Look it up. I am not being a prick. I am honestly being curt. There is no time for nonsense. There is no such thing as BS. That term BS is created when an opinion differs from that of others. The differing opinion is called BS. One mans BS is another mans wisdom. Learn. They write SDK docs on Roku.com website. Roku publishes them and makes them available for free. Point users there. If you don't know something it is okay to say so. Don't call me out as a prick when you are the guy madly answering posts with wrong/inaccurate/attention-lacking information. Seriously. No harm in calling a black kettle black is there. No offense taken either in the prick remark. A fine point can be mistaken for a prick.

We are all people. We want answers. We want solutions. We want honesty. We don't want lack of attention to detail. Sorry. It is just painful to see people get bad advice and poor instruction. Other times it is people asking what the docs already cover and they get no reply? Gee.. they wonder why they don't get a reply. Then you help them rather poorly. I have to help the guy out of that hole. I tried to. You kept burying him. So brother give me a break. Give the world a break.

Why did you post just to have me post again? Clearly you must have expected this post. You called me a prick and that pretty much basically demanded this reply. Well.. this doesn't mean I expect one. We can just say yep.. That went totally off-topic for absolutely no reason and go about our respective days. Yep.. I can do that.. Can you?

@sharkieSBS Do you still have issues with this or is everything now smooth sailing? Can you spell awkward? Oh wait I just did. I gave an example of it in the post above. 🙂
0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.