Skip to content

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

Notifications You must be signed in to change notification settings

mecaocao/RevealPassword

 
 

Repository files navigation

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.

About

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

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Kotlin 100.0%