Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shiburagi/blockedittext
Block EditText is a library provide an input view present in multiple block style that common use in TAC or credit card field.
https://github.com/shiburagi/blockedittext
android credit-card edittext gradle kotlin tac widget
Last synced: 12 days ago
JSON representation
Block EditText is a library provide an input view present in multiple block style that common use in TAC or credit card field.
- Host: GitHub
- URL: https://github.com/shiburagi/blockedittext
- Owner: shiburagi
- License: apache-2.0
- Created: 2018-05-29T15:21:19.000Z (over 6 years ago)
- Default Branch: v0.3
- Last Pushed: 2021-05-31T03:11:26.000Z (over 3 years ago)
- Last Synced: 2024-10-12T20:09:30.667Z (26 days ago)
- Topics: android, credit-card, edittext, gradle, kotlin, tac, widget
- Language: Kotlin
- Homepage:
- Size: 595 KB
- Stars: 122
- Watchers: 5
- Forks: 25
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# BlockEditText
[ ![Download](https://api.bintray.com/packages/infideap2/Block-EditText/com.infideap.blockedittext/images/download.svg) ](https://bintray.com/infideap2/Block-EditText/com.infideap.blockedittext/_latestVersion)
Block EditText is a library provide an input view present in multiple block style that common use in **TAC** or **credit card field**.
![Alt Text](https://raw.githubusercontent.com/shiburagi/BlockEditText/preview/preview2.gif)
Android 14.0+ support
---
[![paypal](https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=D9JKYQL8452AL)## Including In Your Project
If you are a Maven user you can easily include the library by specifying it as
a dependency:#### Gradle
```groovy
repositories {
maven{
maven { url 'https://jitpack.io' }
}
}
```
```groovy
dependencies {
implementation 'com.github.shiburagi:BlockEditText:v0.2'
}
```**or**,
you can include it by **download this project** and **import /blockedittext** as **module**.## How to use
**Creating the layout**
### TAC
```xml```
### Credit Card
```xml```
### Customize
```java
amexEditText.setNumberOfBlock(3);
amexEditText.setDefaultLength(4);
amexEditText.setLengthAt(1,6);amexEditText.setHint("Amex");
amexEditText.setText("1234567890");
amexEditText.getText();amexEditText.setTextSize(16);
amexEditText.setHintTextSize(16);
amexEditText.setSeparatorTextSize(16);amexEditText.setSeparatorCharacter('-');
amexEditText.setSeparatorPadding(8);amexEditText.setInputType(InputType.TYPE_CLASS_NUMBER);
amexEditText.setTextAppearance(android.support.v7.appcompat.R.style.Base_TextAppearance_AppCompat_Medium);
amexEditText.setHintTextAppearance(android.support.v7.appcompat.R.style.Base_TextAppearance_AppCompat_Medium);
amexEditText.setSeparatorTextAppearance(android.support.v7.appcompat.R.style.Base_TextAppearance_AppCompat_Medium);amexEditText.setEdiTextBackground(ContextCompat.getDrawable(this, R.drawable.selector_edittext_round_border_line));
amexEditText.setSelection(0);
amexEditText.setShiftPosition(true);amexEditText.addCardPrefix(CardPrefix.amex(this))
amexEditText.addCardPrefix(CardPrefix.amex(amexDrawable))
amexEditText.addCardPrefix(new CardPrefix(this, R.drawable.ic_amex, "34"))
amexEditText.addCardPrefix(new CardPrefix(amexDrawable, "34"))```
### Listener
```java
amexEditText.setTextChangedListener(TextWatcher watcher)
amexEditText.setOnCardPrefixListener(OnCardPrefixListener listener)
```## Contact
For any enquiries, please send an email to [email protected].## License
Copyright 2018 Shiburagi
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.