GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - wangdaban/Keyboard: 防京东,支付宝密码键盘和密码输入框

BranchesTags
Open more actions menu
 
 

Latest commit

 

History

4 Commits
4 Commits

Folders and files

NameName
Last commit message
Last commit date
.idea
.idea
 
 
app
app
 
 
art
art
 
 
gradle/wrapper
gradle/wrapper
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
build.gradle
build.gradle
 
 
gradle.properties
gradle.properties
 
 
gradlew
gradlew
 
 
gradlew.bat
gradlew.bat
 
 
settings.gradle
settings.gradle
 
 

Repository files navigation

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

####效果图: image ####具体应用:

  • 布局文件中
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
                android:layout_width="match_parent"
                android:layout_height="match_parent">

    <com.github.phoenix.widget.PayEditText
        android:id="@+id/PayEditText_pay"
        android:layout_width="match_parent"
        android:layout_marginTop="20dp"
        android:paddingLeft="12dp"
        android:layout_alignParentTop="true"
        android:paddingRight="12dp"
        android:layout_height="48dp"/>

    <com.github.phoenix.widget.Keyboard
        android:id="@+id/Keyboard_pay"
        android:layout_alignParentBottom="true"
        android:layout_width="match_parent"
        android:layout_height="300dp"/>

</RelativeLayout>
  • 代码中
//键
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进行调整

About

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

Resources

Readme
Apache-2.0 license
Activity

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.