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: 
jaxim
Visitor

Problem w/ Changing the focusBitmapUri of MiniKeyboard

I am trying to change the background (focusBitmapUri) of the focused text box of a minikeyboard using a 9-patch image. I ran into 2 problems:

  1. The background is no longer enlarged like the default focused background. (The focused key no longer appears scaled by a factor greater than 100%.) I tried to alter where I place the 9 grid lines. I tried to include an empty border around the 9-patched image. I get varying results but none of those results have the focused key as large as the default focused key (with no passed focusBitmapUri). 

  2. I also tried to alter the keyboard's focusedKeyColor and it seems that when I also assign a value to focusBitmapUri, then the text color has an opacity to it. (it's see thru.) My background is completely black and when I assign the focused text color to white "0xFFFFFFFF", the text looks dark gray rather than white and it is very hard to read. If I do not pass an image to the focusBitmapUri, then the font has no opacity.

Here are my questions:

  1. How do I get the focused background to be appear as large as the default focused background?

  2. How do I ensure the text color of the focused key does not have any opacity?
0 Kudos
14 REPLIES 14
jaxim
Visitor

Re: Problem w/ Changing the focusBitmapUri of MiniKeyboard

this is still a problem. Does anyone know of a solution?
0 Kudos
norcaljohnny
Roku Guru

Re: Problem w/ Changing the focusBitmapUri of MiniKeyboard

2 things...
1. What do you have your "ui_resolutions=" set to in your manifest file?
2. You can use color="#ffffff" if you intend not to have transparency. Which I get better results from and when transparency is needed I simply use opacity=".7" for instance.
0 Kudos
jaxim
Visitor

Re: Problem w/ Changing the focusBitmapUri of MiniKeyboard

ui_resolutions is set to "fhd"
0 Kudos
norcaljohnny
Roku Guru

Re: Problem w/ Changing the focusBitmapUri of MiniKeyboard

As in like this with no spaces or quotes?


ui_resolutions=fhd
0 Kudos
jaxim
Visitor

Re: Problem w/ Changing the focusBitmapUri of MiniKeyboard

that is correct. Suggestions?
0 Kudos
jaxim
Visitor

Re: Problem w/ Changing the focusBitmapUri of MiniKeyboard

Why would the ui_resolutions affect things? Do I need to create an fhd version of the focusBitmapUri image? If so, how is it different?
0 Kudos
jaxim
Visitor

Re: Problem w/ Changing the focusBitmapUri of MiniKeyboard

Does anyone have any insight into this? I'm starting to think it might be a Roku firmware bug. 

Has anyone had any success in using the ui_resolutions field to add a custom focus indicator AND still have it successfully display larger than a non-focused key? 
0 Kudos
speechles
Roku Guru

Re: Problem w/ Changing the focusBitmapUri of MiniKeyboard

Show come code. Explain your issue with code. Do not try to do this with text. Code please.

What are you trying to do with the keyboard? Does it open within a dialog? Do you really want to change backgroundUri of the dialog the keyboard spawns into?

    m.top.keyboard.focusedKeyColor = "0xffffffff"
    m.top.keyboard.keyColor = "0xffffffff"

I use the above just fine. You can set the opacity _IN_ the color. The last 2 ff means make it bright as bright gets. The 255 on the scale of 255.
To figure the opacity divide what you put: ff = 255. say you want 0.8 opacity. 80% of FF = what you want to put at the end of your colors.


The main thing is likely there is no issue here. You just aren't doing it right. Without providing code for us to see what you are doing wrong we can't assume you are doing it right. It cannot be assumed this is a bug. You need code that proves the bug. Can you provide that?


Also your statement of: "I tried to include an empty border around the 9-patched image. "

No wonder it doesn't work. Do you understand what a 9patch image is? There can't be empty around. Yes really. Stop doing that.. lol. It needs to know where exactly the edge is to know how to compose the "growth" of this 9patch. It also needs this to know how to apply your corners. You wont get proper growth without proper understanding of this and how to construct a 9patch.
0 Kudos
jaxim
Visitor

Re: Problem w/ Changing the focusBitmapUri of MiniKeyboard

Here's the code...

m.top.keyboard.focusBitmapUri = [pathToImage]


One line. That simple. 

Changing the focused or unfocused text color as you suggested is not what I want. I want to change the color of the background color. Do you have any experience changing the background color? If you do and you have seen what I have described, then I am interested to hear from you.

thanks so much!! 🙂
0 Kudos