3

Screenshot of Hidden Password

My issue is when you hit show / hide password (eye icon) to display password. The dot spacing for the same password takes more space. Is there any way to fit it in same position at which the text or the password is? I think there is an issue with TypeFace but not fully sure about it.

Screenshot of Show Password

I tried following this link, its kind of the same thing but its not working. Its either changing my font family or my font style. Here is the link

Darpal
  • 352
  • 5
  • 20
  • Extend the ```PasswordTransformationMethod``` class and try to create your own password dots, And set that, with this method ```setTransformationMethod``` of your EditText. – Ali Rezaiyan Dec 03 '19 at 20:48
  • This [Answer](https://stackoverflow.com/a/24849287/5255963) may help you – Ali Rezaiyan Dec 03 '19 at 20:50
  • @AliRezaiyan Actually thats not working. Tried it. thats not how i want to do it, changing each character by character :) – Darpal Dec 05 '19 at 20:36

2 Answers2

0

I have faced same issues some days ago for viewing password use this code (this code is in kotlin if you are using java and face any issue comment here I will help in that also).

et_pass.transformationMethod = null

and for hiding password again use this code

et_pass.transformationMethod = PasswordTransformationMethod()
Shahzain ali
  • 1,679
  • 1
  • 20
  • 33
  • thats what i am doing for show hide password. It works perfect, its just how to maintain the spacing of dots as same as the text written :) – Darpal Dec 03 '19 at 20:53
  • I am sorry but its not working for me, tried it. It only prevents from going text to next line. – Darpal Dec 03 '19 at 21:28
0

Implement this code below within your password XML UI. This will hide the letters and create dots.

app:passwordToggleEnabled="true"

TMB
  • 31
  • 2