An android small library to show and hide password in a EditText
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
app
gradle/wrapper
revealpassword
.gitignore
README.md
build.gradle
gradle.properties
gradlew
gradlew.bat
sample_printscreen.png
settings.gradle

README.md

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.