Skip to content

Latest commit

 

History

History
47 lines (38 loc) · 2.03 KB

README.md

File metadata and controls

47 lines (38 loc) · 2.03 KB

RevealPassword

An android small library to show and hide password in a EditText.

Download

Download the latest version in JitPack or Gradle bellow

implementation 'com.github.pedrofsn:RevealPassword:1.0.2'

How to use

Using only XML:

    <br.com.redcode.revealpassword.library.EditTextWithImageForRevealPassword
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:drawableRevealPassword="@android:drawable/ic_menu_add"
        app:hint="Custom Hint Hardcoded" />

Using XML and JAVA/Kotlin:

    <EditText
        android:id="@+id/editTextSampleFunction"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="10dp"
        android:inputType="textWebPassword"
        android:text="\@pedrofsn" />

    <Button
        android:id="@+id/buttonShowHidePassword"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Show/hide password" />
 buttonShowHidePassword.setOnClickListener { editTextSampleFunction.showOrHidePassword() }

You can see more samples in XML and Java/Kotlin.

Sample printscreen:

Sample printscreen

Attention: If you're using TextInputLayout from Material Components. You can use builtin solution for this problem domain.