Your Digital Media Has Never Looked So Good

 
jaxim
Topic Author
Posts: 83
Joined: Mon Sep 26, 2016 6:25 am

Problem w/ Changing the focusBitmapUri of MiniKeyboard

Fri Jun 29, 2018 11:19 am

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?
Last edited by jaxim on Fri Apr 12, 2019 6:41 am, edited 1 time in total.
 
jaxim
Topic Author
Posts: 83
Joined: Mon Sep 26, 2016 6:25 am

Re: Problem w/ Changing the focusBitmapUri of MiniKeyboard

Fri Apr 12, 2019 6:30 am

this is still a problem. Does anyone know of a solution?
 
norcaljohnny
Posts: 99
Joined: Thu Apr 13, 2017 11:00 pm

Re: Problem w/ Changing the focusBitmapUri of MiniKeyboard

Fri Apr 12, 2019 8:14 am

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.
 
jaxim
Topic Author
Posts: 83
Joined: Mon Sep 26, 2016 6:25 am

Re: Problem w/ Changing the focusBitmapUri of MiniKeyboard

Fri Apr 12, 2019 10:55 am

ui_resolutions is set to "fhd"
 
norcaljohnny
Posts: 99
Joined: Thu Apr 13, 2017 11:00 pm

Re: Problem w/ Changing the focusBitmapUri of MiniKeyboard

Fri Apr 12, 2019 2:51 pm

As in like this with no spaces or quotes?


ui_resolutions=fhd
 
jaxim
Topic Author
Posts: 83
Joined: Mon Sep 26, 2016 6:25 am

Re: Problem w/ Changing the focusBitmapUri of MiniKeyboard

Mon Apr 15, 2019 7:16 am

that is correct. Suggestions?
 
jaxim
Topic Author
Posts: 83
Joined: Mon Sep 26, 2016 6:25 am

Re: Problem w/ Changing the focusBitmapUri of MiniKeyboard

Wed Apr 17, 2019 11:44 am

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?
 
jaxim
Topic Author
Posts: 83
Joined: Mon Sep 26, 2016 6:25 am

Re: Problem w/ Changing the focusBitmapUri of MiniKeyboard

Mon Apr 29, 2019 2:32 pm

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? 
 
User avatar
speechles
Posts: 154
Joined: Thu Aug 06, 2015 11:15 pm

Re: Problem w/ Changing the focusBitmapUri of MiniKeyboard

Mon Apr 29, 2019 4:28 pm

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.
 
jaxim
Topic Author
Posts: 83
Joined: Mon Sep 26, 2016 6:25 am

Re: Problem w/ Changing the focusBitmapUri of MiniKeyboard

Thu May 02, 2019 6:41 am

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!! :-)
 
jaxim
Topic Author
Posts: 83
Joined: Mon Sep 26, 2016 6:25 am

Re: Problem w/ Changing the focusBitmapUri of MiniKeyboard

Thu May 02, 2019 6:44 am

p.s. I am now focused on resolving issue #1 (the focused background key not being as big as expected when using focusBitmapUri) as issue #2 has been resolved by using a slight transparency when setting the color.
Again thanks!
 
User avatar
speechles
Posts: 154
Joined: Thu Aug 06, 2015 11:15 pm

Re: Problem w/ Changing the focusBitmapUri of MiniKeyboard

Thu May 02, 2019 8:58 am

    m.top.keyboard.focusBitmapUri = "pkg:/images/actions/listbtnfocus.png"

Works for me. Although, like I said my listbtnfocus.png is a proper 9patch. It shrinks and grows just like the stock white one does on the keyboard. Including the shrink/grow effect when you press OK on a key.

I really think it is your 9patch png causing you issues since mine works as expected.
 
jaxim
Topic Author
Posts: 83
Joined: Mon Sep 26, 2016 6:25 am

Re: Problem w/ Changing the focusBitmapUri of MiniKeyboard

Thu May 02, 2019 1:22 pm

Currently my 9-patch image is 80x80. It has rounded corners. There is no longer a transparent border - but instead goes 1 pixel from any of the edges. There are four 1-pixel wide or high black lines around the edge of the image to indicate where the image can stretch.

Does this sound like your 9-patch image that you are using?
 
User avatar
speechles
Posts: 154
Joined: Thu Aug 06, 2015 11:15 pm

Re: Problem w/ Changing the focusBitmapUri of MiniKeyboard

Fri May 03, 2019 12:32 pm

Image

Above is the 9patch you can use for keyboards and dialogs. In this same vein you make the focus indicator 9patch you want except make it a more squashed rectangle not so tall. Corners not so big. Maybe 4-5x wider than it is in height.

The 9patch above grows/shrinks just fine as the dialog background (which shows for keyboards too). Color/Darken/Lighten/Resize as needed. This is a PNG with opacity.

Notice the edge is the edge. There is no 1 pixel border extra anything. WYSIWYG. Wizzy Wig. What you see is what you get.

The 9patch is a fancy way to say "it notices the corners". The only special things about a 9patch is the rounded corners. The rest is just a simple rectangle. Keep your edges as the edges. Only does the edge change at the corners. You can be as elaborate as you like in these 9patch. This is of course just a simple example to illustrate where you are making a mistake. From here you should be able to understand this completely and go wild design your 9patch of your dreams.

Who is online

Users browsing this forum: No registered users and 5 guests