Need help with Keyboard?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

GitPhoenix
213 Stars 56 Forks Apache License 2.0 4 Commits 3 Opened issues

Description

防京东,支付宝密码键盘和密码输入框

Services available

!
?

Need anything else?

Contributors list

Keyboard 防京东,支付宝密码键盘和密码输入框

效果图:

image

具体应用:

  • 布局文件中 ``` <?xml version="1.0" encoding="utf-8"?>

```

  • 代码中 ``` //键 private static final String[] KEY = new String[] { "1", "2", "3", "4", "5", "6", "7", "8", "9", "<<", "0", "完成" }; //设置键盘 keyboard.setKeyboardKeys(KEY); //键盘键的点击事件 keyboard.setOnClickKeyboardListener(new Keyboard.OnClickKeyboardListener() { @Override public void onKeyClick(int position, String value) { if (position < 11 && position != 9) { payEditText.add(value); } else if (position == 9) { payEditText.remove(); }else if (position == 11) { //当点击d键盘上的完成时候,也可以通过payEditText.getText()获取密码,此时不应该注册OnInputFinishedListener接口 Toast.makeText(getApplication(), "您的密码是:" + payEditText.getText(), Toast.LENGTH_SHORT).show(); finish(); } } });

//当密码输入完成时的回调 payEditText.setOnInputFinishedListener(new PayEditText.OnInputFinishedListener() { @Override public void onInputFinished(String password) { Toast.makeText(getApplication(), "您的密码是:" + password, Toast.LENGTH_SHORT).show(); } }); ```

  • 键盘样式可以根据BaseAdapter的getItemViewType进行调整

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.