Skip to content

zhouchupen/SixNumEditText

Repository files navigation

SixNumEditText

Android仿微信六位数字输入框

Installing

Users of your library will need add the jitpack.io repository:

allprojects {
 repositories {
    jcenter()
    maven { url "https://jitpack.io" }
 }
}

and:

dependencies {
    compile 'com.github.zhouchupen:SixNumEditText:v1.0'
}

Note: do not add the jitpack.io repository under buildscript

Adding a sample app

If you add a sample app to the same repo then your app needs to depend on the library. To do this in your app/build.gradle add a dependency in the form:

dependencies {
    compile project(':library')
}

where 'library' is the name of your library module.

Using

You may need this to use the edittext. Put this into your xml file:

<com.scnu.zhou.widget.SixNumEditText
     android:id="@+id/sixNumEditText"
     android:layout_width="match_parent"
     android:layout_height="wrap_content">

</com.scnu.zhou.widget.SixNumEditText>

If you want to input a number, take this:

sixNumEditText.input(number);

And if you want to backspace, take this:

sixNumEditText.backspace();

You also be able to know when is finished input:

sixNumEditText.setOnCompleteInputListener(new SixNumEditText.OnCompleteInputListener() {
        @Override
        public void onCompleteInput() {
            // finished input
        }
});

And it always be accompanied with a NumberKeyBoard.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages