Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/kojofosu/passwordvalidationview

Android UI component to validate passwords.
https://github.com/kojofosu/passwordvalidationview

android edittext kotlin library password validation

Last synced: 11 days ago
JSON representation

Android UI component to validate passwords.

Awesome Lists containing this project

README

        

# PasswordValidationView
![Jit](https://img.shields.io/jitpack/v/github/kojofosu/PasswordValidationView?style=for-the-badge&color=2F9319)

Android UI component that validates passwords.

All design credits goes to [Piotr Sliwa](https://dribbble.com/dslv) And inspired by [this design](https://dribbble.com/shots/4957240-Fintech-Onboarding-Principles/attachments/10692818?mode=media)

![inpsired-design](https://user-images.githubusercontent.com/20203694/137953838-5b68f10d-9924-43de-b6b1-8a0d3600850f.gif)

## 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:

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

Add the dependency

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

## Usage
Sample implementation [here](app/)

### Password Validation View
- Add `PasswordValidationView` to your xml layout.

```xml

```

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

```xml









```

### Initialize and customise PasswordValidationView

```kotlin
val passEditText = findViewById(R.id.password_et) // edittext for the password
val validationView = findViewById(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.holo_orange_dark //change valid password activation color
```

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

### Licensed under the [Apache-2.0 License](LICENSE)