How To Force Redraw Of Soft Keyboard
I created a custom keyboard which doesn't resize correctly when the orientation changes. I've tried invalidateKeys(), and manually setting the size of all of the keys, but no joy.
Solution 1:
I was having a simular problem with resizing my keyboardview's key height dynamically. To workaround the problem I did a couple of things:
1) Create a new class that extends the Keyboard class that defines a public getKeyHeight method and overrides the getHeight method. My prototype code:
publicvoidsetKeyHeight(int height) {
super.setKeyHeight(height);
}
@OverridepublicintgetHeight() {
return getKeyHeight() * 3;
}
2) Defined a new method in my
double height_modifier = 1.5;
int height = 0;
for(Keyboard.Key key : mKeyboard.getKeys()) {
key.height *= height_modifier;
key.y *= height_modifier;
height = key.height;
}
mKeyboard.setKeyHeight(height);
I hope this helps...
Solution 2:
My keyboard changes some keys and redraws the softkeyboard after the user hits any character button. I call the invalidateAllKeys() on my Subclass of KeyboardView to redraw the keyboard. invalidateAllKeys() works fine!
Post a Comment for "How To Force Redraw Of Soft Keyboard"