类似微信支付宝密码控件

NumberCodeView

一个类似微信支付和支付宝支付的时候输入密码面板的控件。

使用方式

普通样式

正常情况下,你可以把控件的声明写到你的 '.xml' 文件里面。

<com.lkp.numbercodeview.normal.NumberCodeView
        android:id="@+id/numberCodeView"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        numbercodeview:isPassword="true"/>

可以使用 numbercodeview:isPassword 这个属性去控制是否是密码,密码的话会用黑点替代数字。

底部面板样式

使用底部样式,那么久可以从界面的底部弹出来。

可以通过以下代码进行调用:

BottomSheetNumberCodeViewActivity.show(this, mIsPassword);

isPassword 属性

如果是密码,那么输入框里面的数字将会用 ● 取代。

截屏





LICENSE

项目地址:https://github.com/linkaipeng/NumberCodeView

猜你喜欢

转载自blog.csdn.net/fengyeNom1/article/details/81355569