Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Anastasiyav
Level 8

How to make button disabled?

Good day. How can I make the button disabled?

E.g. I have a program with a list of showtimes and a list of related channels, where this program also shows.

But, for some programs there are only one current channel available. So, I don't need the button functionality to choose another channel. I can do

channelButton.unobserveField("buttonSelected")

 but it still could be focused. How can I make this button not focusable?

0 Kudos
2 REPLIES 2
RokuJonathanD
Roku Employee
Roku Employee

Re: How to make button disabled?

Hi @Anastasiyav,

As an alternative approach, could you implement logic in your channel application that stores the number of channels for a given program, and then just generates a button for each channel?

Thanks,

Jonathan

0 Kudos
Anastasiyav
Level 8

Re: How to make button disabled?

Hi. But in this way the button is still focusable. And also, I need to open the list of similar channels with the current program when I click on the channel button.

Unfortunately, It's not the way. I hoped there is some attribute "disable = true" for buttons, like in HTML.

I think there is one way: listen to key press and if channels count = 1, then move focus to another button.

Thank you

 

0 Kudos