diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..632c60e --- /dev/null +++ b/readme.md @@ -0,0 +1,105 @@ +# PinView + +Provides a widget for enter PASSWORD/OTP code etc on Android 5+ (API 22). + +

+ +## Dependency + +### JitPack + +``` Groovy +allprojects { + repositories { + ... + maven { url 'https://jitpack.io' } + } +} + +dependencies { + implementation 'com.github.pdrozz:pinview:Tag' +} +``` + +## Usage + +### Step 1: + +Add PinView in your layout. + +#### XML + +``` xml + +``` + +#### Kotlin + +``` Kotlin +pinView.text = "12345" +pinView.clear() +pinView.setIsEnabled(false) +pinView.requestFocusToPin() +pinView.requestFocusToPin(pinIndex = 1) +pinView.setPinBackground(R.drawable.background_pin_item) +pinView.onTextChangedListener = { text -> + Log.d("PinViewSample", "onCreate: $text") +} +``` + +### Step 2: + +Specifies `pinViewStyle` in your theme, + +``` xml + + + +``` + +or use the `PinWidget.PinView` style. + +``` xml + +``` + +### Step 3 (Optional): + +You can use any drawable state using selector to pin item background + +``` xml + + + ... + + + + + + + +```