I use FloatLabel library (https://github.com/weddingparty/AndroidFloatLabel) to add a little animation when user begin to write something in an EditText Android.
My problem is that the typeface seems to be changed when i apply the password type to my EditText. I would like to keep the same typeface as normal. (see picture 1)
But when i add the following line to apply password type, the typeface of hint seems to be changed !
pass.getEditText().setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD);
The following might solve it for you.
Essentially it just passes the
Typeface
of your username field and passes it as theTypeface
for your password field.I found an explanation of this in the Dialogs API Guide.
In otherwords, a fix that can be done in XML would be as follows:
For some reason I didn't have to set the transformation method so this may be a better solution. In MyActivity:
It may be late to answer this question but i have came across this problem. So thought to answer this. I have solved it by
Implementing a CustomTextWatcher
.Here is the snippet
Here is how you can use it in your application
you can use android:hit, and setHitColor in your activity, it will not affect the normal input