Android: How to change text size of KeyboardView? - android

I have made a Custom keyboard to my application, and I would like to change the key's text size.
Is there any way to archive this? May be using themes or any other way?

Never mind. I've found the KeyboardView property: android:keyTextSize

Related

Android Custom Keyboard Layout as a Vector Asset

I am attempting to create a custom keyboard where a vector image is the keyboard itself. Rather than having a custom xml file in the directory res/xml and defining a Keyboard tag, I want to have solely the image as the keyboard. I wanted to know if this is even possible to do because all of the examples I have seen thus far regarding how to create a custom keyboard is just defining an xml file for the layout of the keys and placing it inside of a KeyboardView. Any help would be appreciated!
No, it's not possible. To create a cusotm keyboard you need KeyboardView and Keyboard classes.
Also, I don't understand why would you need it. Do you want a background/theme for your keyboard? If yes, you can do it like this : mKeyboardView.setBackground(drawable/color) Also, there are other ways to set theme(including key border/background/color etc) for a keyboard, but since you are only concern to learn if it's possible to create a custom keyboard via vector asset. So, the answer is no.

Android change look of custom keyboard

I have successfully made a very basic custom keyboard for Android based off of this tutorial. The problem is, this keyboard looks very odd and outdated for Android lollipop:
Image of the current keyboard:
I have been looking at other keyboards such as the default OS keyboard and this one:
And they look much better for Android.
How can I modify the color scheme and style of my keyboard to look better?
It is also worth noting I am making a keyboard that is very similar to the second example (it will just have a few extra buttons).
If you want a lot of control and be able to do things dynamically, I suggest you ditch the xml layout and KeyboardView class and make your own custom keyboard view

How to display Custom font on the onScreenKeyboardof the android device?

I want to change the onscreen keyboard according to the font .ttf file in my assets folder. I searched a lot but it always change the text which we typed but thier is no way i found to change the display of the onScreen Keyboard.
Please any body knows how to do that?
Thanks in advance.
check my answer in this below link. This method will change the font style of your android application and as the keyboard is also in an android application of service so the font of the keyboard is also changed.
This answer is verified and i have used this trick even i was searching of the same from a long time

set different fonts for hint and text in android

I am using floatlabelededittext in my application. My requirement is to set 2 different fonts for hint and text. Is it possible? Then how?
To have 2 different fonts for text and hint you need to use custom TypefaceSpan.
Set a font to a text by using usual setTypeface method
Set a font to a hint by using SpannableString
I already answered to that question Android EditText hint uses the same font that the EditText has
You can also keep the same font and change the hint's size and style independently. To know how, please, see my answer here
I don't think it is possible right now. But if you look at the source code of floatlabeledittext here https://github.com/wrapp/floatlabelededittext/blob/master/library/src/com/wrapp/floatlabelededittext/FloatLabeledEditText.java you see that it will be easy to add such feature.
All you need to do is to use setTypeface on the hint label mHintTextView.

Updating Android EditText's hint on focus change using XML only

I read with interest user sunit's answer to this question about updating an EditText's hint but have been unable to find any documentation on using the method that I presume he appears to describe there: using the <selector> element in an XML layout to dynamically adjust attributes of an EditText at runtime when the element is focused/unfocused.
In my case I am actually more interested in adjusting the android:inputType element (because the hint disappears for me when the inputType is specified) but adjusting the hint would work just as well.
To be clear I know how to make this change in Java code--I'm trying to find out if there is a way to specify the behavior in XML. Thanks!
I'm afraid it isn't yet possible. <selector> is only valid to be applied in making state lists out of Drawable and Color resources, it does not yet work for Strings.
With regards to your mention of adjusting android:inputType to make the hint disappear, this is actually a known Android bug that will eventually be fixed in later versions so I wouldn't recommend building your code around this functionality as it will break when they fix it:
http://code.google.com/p/android/issues/detail?id=13895
Since you mentioned that you already know how to do this in the Java code, I won't point out how to call setHint() from within a OnFocusChangeListener ;)
Cheers.

Categories

Resources