# Android_Lib_VerificationCodeEditText
**Repository Path**: fairy_android/Android_Lib_VerificationCodeEditText
## Basic Information
- **Project Name**: Android_Lib_VerificationCodeEditText
- **Description**: 验证码或密码输入框封装
- **Primary Language**: Kotlin
- **License**: Apache-2.0
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2022-01-30
- **Last Updated**: 2023-10-25
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# VerificationCodeEditText
[](https://jitpack.io/#FairyHeart/VerificationCodeEditText)
[中文使用](https://github.com/FairyHeart/VerificationCodeEditText/wiki/%E4%B8%AD%E6%96%87%E4%BD%BF%E7%94%A8%E8%AF%B4%E6%98%8E)
Verification code or password input box style
Use:
1. Add VerificationCodeEditText to the layout file and set relevant custom attributes
```xml
```
*** Need to set width and height for the control ***
2. Description of related attributes
| **Attribute name** | **Attribute description** |
| :---: | :---: |
| password | Set whether password style, true Display dots |
| showCursor | Whether to display the cursor |
| separateType | Button style, @ integer/type_hollow hollow square,type_solid = solid square,Type_equipments = underscores |
| maxLength | Set the number of display boxes. 0 indicates automatic calculation based on the screen. |
| corner | Set fillet dp |
| borderColor | Set the solid color of the box, type_solid is applicable |
| borderWidth | Set border thickness dp |
| blockColor | Set the solid color of the box, type_solid is applicable |
| textColor | Set the color of text drawing |
| blockSpacing | Set border gap, type_solid, type_underline applies |
| cursorDuration | Sets the cursor flicker duration in milliseconds |
| cursorWidth | Sets the width of the cursor |
| cursorColor | Sets the cursor display color |
3. Set listeners in java code, and you can also set custom related attributes.
```kotlin
val lineEdit = findViewById(R.id.rect_edit)
lineEdit.showCursor = true
lineEdit.textChangedListener = object : VerificationCodeEditText.TextChangedListener {
/**
* Enter / delete listener
*
* @param changeText Enter / delete characters
*/
override fun textChanged(changeText: CharSequence?) {
}
/**
* Input completed
* @param text Entered characters
*/
override fun textCompleted(text: CharSequence?) {
Toast.makeText(applicationContext, text, Toast.LENGTH_LONG).show()
}
}
```