kojofosu
PasswordValidationView
Kotlin

Android UI component to validate passwords.

Last updated Apr 29, 2026
100
Stars
6
Forks
0
Issues
0
Stars/day
Attention Score
18
Language breakdown
No language data available.
โ–ธ Files click to expand
README

PasswordValidationView

Jit

Android UI component that validates passwords.

All design credits goes to Piotr Sliwa And inspired by this design

inpsired-design

Demo

demo

https://user-images.githubusercontent.com/20203694/225364687-88e0047a-bb17-4636-bec3-6c6a7c1c5ea2.mp4

Setup

Add it in your root build.gradle at the end of repositories:

allprojects {
    repositories {
        //...omitted for brevity
        maven { url 'https://jitpack.io' }
    }
}

Add the dependency

dependencies {
   implementation "com.github.kojofosu:PasswordValidationView:$latest_release"
}

Usage

Sample implementation here

Password Validation View

  • Add PasswordValidationView to your xml layout.
<com.mcdev.passwordvalidationview.PasswordValidationView
        android:id="@+id/passwordvalidationview"
        android:layoutwidth="matchparent"
        android:layoutheight="wrapcontent"/>

:bulb: Important : To avoid the soft keyboard from covering the password validation view, place the view inside a TextInputLayout

<!-- The text input layout-->
    <com.google.android.material.textfield.TextInputLayout
        android:layoutwidth="matchparent"
        android:layoutheight="wrapcontent"
        android:hint="Password">
        
        <!-- The text input edit text for the password -->
        <com.google.android.material.textfield.TextInputEditText
            android:id="@+id/password_et"
            android:layoutwidth="matchparent"
            android:layoutheight="wrapcontent"
            android:inputType="textPassword"
            android:layout_margin="20dp"/>
        
        <!-- The passwrod validation view -->
        <com.mcdev.passwordvalidationview.PasswordValidationView
            android:id="@+id/pvv"
            android:layoutwidth="matchparent"
            android:layoutheight="wrapcontent"/>
    </com.google.android.material.textfield.TextInputLayout>

Initialize and customise PasswordValidationView

val passEditText = findViewById<EditText>(R.id.password_et) // edittext for the password
        val validationView = findViewById<PasswordValidationView>(R.id.pvv) //PasswordValidationView

validationView.passwordEditText = passEditText //Pass the edittext of for the password to validate validationView.passwordMinLength = 10 //minimum password length validationView.enabledColor = android.R.color.holoorangedark //change valid password activation color

Check if password is complete and valid

validationView.setOnValidationListener {
        button.isEnabled = it //returns true if password is complete and valid
    }

Licensed under the Apache-2.0 License

ยฉ 2026 GitRepoTrend ยท kojofosu/PasswordValidationView ยท Updated daily from GitHub