android 平板 pin码,PinCodeView是一个Android PinCode 密码输入效果视图

625332134c6f4d4600884b99daebf603.png625332134c6f4d4600884b99daebf603.png

PinCodeView

PinCodeView is Android UI library for replace EditText's PIN input with pretty customizable view.

Demo

625332134c6f4d4600884b99daebf603.png

See demo app for usage example.

Installation

Edit your master gradle.build file and add maven { url 'https://jitpack.io' } to your current repositories block content (if you use other jitpack hosted libraries, then this step can be skipped):

allprojects {

repositories {

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

}

}

Next, edit your module's build.gradle and the following dependency:

compile 'com.github.antoxa2584x:PinCodeView:'

For recent value of consult library releases or jitpack badge: 625332134c6f4d4600884b99daebf603.png

How To Use

In Xml

android:id="@+id/ci_drawable"

android:layout_width="match_parent"

android:layout_height="wrap_content"

android:layout_marginTop="24dp"

app:pcv_pin_error_color="@color/accent"

app:pcv_pin_inner_alpha="1" //Default 0.3

app:pcv_pin_inner_color="@android:color/white"

app:pcv_pin_inner_drawable="@mipmap/ic_launcher" //Default circle

app:pcv_pin_length="4" //Default 4

app:pcv_pin_outer_color="@color/colorPrimary"

app:pcv_pin_outer_drawable="@mipmap/ic_launcher" //Default circle

app:pcv_pin_tint_inner="false" //Default false

app:pcv_pin_tint_outer="true" //Default false

app:pcv_pin_type="unlock" />

In Your Code

PinCodeView pinCodeView = new PinCodeView(this)

.setLockType(LOCK_TYPE.ENTER_PIN)

.setPinEnteredListener(this)

.setPinReEnterListener(this)

.setPinMismatchListener(this)

.setInnerCircleColor(color)

.setOuterCircleColor(color)

.setErrorColor(color)

.setLockType(isChecked ? LOCK_TYPE.ENTER_PIN : LOCK_TYPE.UNLOCK)

.setPinLength(length)

.setInnerAlpha(1)

.setTintInner(false)

.setTintOuter(false)

.setInnerDrawable(ContextCompat.getDrawable(this, R.drawable.circle))

.setOuterDrawable(ContextCompat.getDrawable(this, R.drawable.circle));

Changelog

v1.2

custom pin drawable

inner pin alpha

use tint or not

License

MIT License

Copyright (c) 2017 antoxa2584x

Permission is hereby granted, free of charge, to any person obtaining a copy

of this software and associated documentation files (the "Software"), to deal

in the Software without restriction, including without limitation the rights

to use, copy, modify, merge, publish, distribute, sublicense, and/or sell

copies of the Software, and to permit persons to whom the Software is

furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all

copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR

IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,

FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE

AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER

LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,

OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE

SOFTWARE.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值