How to use custom image instead of '*' in edittext password field?
see image:
Any answer or hint will be greatly appreciated.
How to use custom image instead of '*' in edittext password field?
see image:
Any answer or hint will be greatly appreciated.
The answer comes from this tutorial and it covers a behaviour when a user:
enters into the login screen, keyboard will open automatically.
tries to enter value in it then textbox background changes to textbox with star background.
tries to cancel/delete the input value by using back key on keyboard then textbox background will change to textbox without star background.
First of all you have to create two
drawables
:Then, according to this approach, you have to implement
addTextChangedListener
method on yourEditText
. After that, as a parameter, you create a new instance of aTextWatcher
class and you implement its methods:Then, you have to implement
setOnKeyListener
and its methodonKey
:Another approach: create you own class which extends PasswordTransformationMethod.
Reference: In android how to show asterisk (*) in place of dots in EditText having inputtype as textPassword?
I think simple way is, you have to define 6-edittext in xml layout. and set width and height with custom background resorces.
Like,
and read all edittext value. I am not sure but it will help you.