Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/kojofosu/passwordvalidationview
- Owner: kojofosu
- License: apache-2.0
- Created: 2021-10-19T15:00:39.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-03-15T15:48:36.000Z (over 1 year ago)
- Last Synced: 2024-10-14T23:08:05.948Z (24 days ago)
- Topics: android, edittext, kotlin, library, password, validation
- Language: Kotlin
- Homepage:
- Size: 135 KB
- Stars: 96
- Watchers: 1
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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
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) //PasswordValidationViewvalidationView.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)