Skip to content

自定义数字键盘--类似与微信的数字键盘可随机显示数字

Notifications You must be signed in to change notification settings

changhaismile/CustomKeyboard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

author
dingchangqing
Sep 14, 2016
70d4207 · Sep 14, 2016

History

3 Commits
Sep 14, 2016
Sep 14, 2016
Sep 14, 2016
Sep 14, 2016
Sep 14, 2016
Sep 14, 2016
Sep 14, 2016
Sep 14, 2016
Sep 14, 2016
Sep 14, 2016
Sep 14, 2016

Repository files navigation

自定义数字键盘

该Library仅仅是因为需求自定义的一个类似与微信支付时显示的密码键盘,不同样式的键盘可以在项目中xml目录下定义不同的键盘格式,主要包含KeyboardRowKey 这些都是系统提的自定义键盘的xml格式,里面也包含了一些设置属性,可根据需求自行定制。

效果图:

customeKeyboard

使用方法

使用也很简便,只需创建一个CustomKeyboardHelper 实例,然后将需要使用自定义键盘的EditText注册给该help实例即可:

// 参数需要是一个Activity
CustomKeyboardHelper helper = new CustomKeyboardHelper(this);

// 使用固定数字键盘
helper.registerEditText(editText1);
// 使用随机数字键盘
helper.registerEditText(editText3, true);

不同键盘样式可以使用2个参数的构造方法,传递keyboard对应的xml

helper = new CustomKeyboardHelper(this,R.xml.keyboardnumber);

不同的按键功能可以参考CustomKeyboardHelper中的实现自行定义。

About

自定义数字键盘--类似与微信的数字键盘可随机显示数字

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages