top of page

An Easy Trick To Achieve Android App Password Hide/Show

  • Writer: Lotus Xu
    Lotus Xu
  • Jul 15, 2020
  • 1 min read

Updated: Jul 22, 2020

If you are making an Android app, your app might have a login page, while most of the apps today have the feature, for their login page specifically, that when users type in their passwords, they can hide/show the password visibility by clicking an eye icon at the end of the line. Have you wondered how to achieve the same effect? Let's see how to do it!



If you're providing a field for users to type in their passwords, you must have implemented an EditText field somewhere inside your XML file for the page



That's great! Then you just simply sandwich your code for EditText with two pieces of 'bun', another two blocks of code and you're done!




Also, don't forget to add this line of code: 'app:passwordToggleEnabled="true"' to the upper 'bun'. Have fun!



Comments


bottom of page