Auto insert text into EditText.
AutoAddTextWatcher will insert text into EditText at positions you are setted.
AutoAddTextWatcher will delete text in EditText at positions you are setted, when text length bigger than 1.
Gradle
compile 'tw.henrychuang.lib:auto-insert-edittext:1.0.1'
Maven
<dependency>
<groupId>tw.henrychuang.lib</groupId>
<artifactId>auto-insert-edittext</artifactId>
<version>1.0.1</version>
<type>pom</type>
</dependency>
Add char at positions
mEditText_creditCard.addTextChangedListener(new AutoAddTextWatcher(mEditText_creditCard,
"-",
4, 8, 12));
Add and delete chars at positions
mEditText_multiChars.addTextChangedListener(new AutoAddTextWatcher(mEditText_multiChars,
"##",
new int[]{3, 6}));
Add char at positions, and callback listener
mEditText_birthday.addTextChangedListener(new AutoAddTextWatcher(mEditText_birthday,
"/",
new TextWatcher() {},
4, 6));
Apache License Version 2.0 http://apache.org/licenses/LICENSE-2.0.txt