Skip to content

Latest commit

 

History

History
56 lines (44 loc) · 1.96 KB

README.md

File metadata and controls

56 lines (44 loc) · 1.96 KB

PasswordStrengthView

This is my first shot at creating a library in the Android SDK. This is an Android library to represent password strength, or you can use it to measure password strength yourself.

Preview

The images below show how you can adjust the view to achieve different shapes.

Empty Ok Easy

Medium Strong VStrong

How to use?

Add maven to your project gradle file

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

Add dependency in your app gradle file.

implementation 'com.github.RHSaliya:PasswordStrengthView:1.5'

Add view on your layout

<com.rhs.psw.PasswordStrengthView
        android:id="@+id/passwordSV"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_margin="24sp"
        app:indicatorWidth="16dp"
        app:empty_color="#ddd"/>

Attatch EditText directly

passwordSV.attachEditText(passwordET);

or use update method

passwordSV.update(String password);

To just calculate strength

Calculator calculator = new Calculator();
calculator.initScores(10,20,30,40);
calculator.calculate("Password",Calculator.INCREMENTAL);