All Projects → jenly1314 → Splitedittext

jenly1314 / Splitedittext

Licence: mit
🔢 SplitEditText 是一个灵活的分割编辑框。常常应用于验证码输入 、密码输入等场景。

Programming Languages

java
68154 projects - #9 most used programming language

Labels

Projects that are alternatives of or similar to Splitedittext

textmatcher
A simple text watcher that matches specific targets like mention or hashtag in a string by defining rules
Stars: ✭ 67 (+103.03%)
Mutual labels:  edittext
Spedittool
An efficient and scalable library for inputing and displaying gif or @mention on graph-text mixed TextView/EditText
Stars: ✭ 292 (+784.85%)
Mutual labels:  edittext
Maskara
A simple way to format text fields without getting affected by input filters
Stars: ✭ 515 (+1460.61%)
Mutual labels:  edittext
RotatableAutofitEditText
Extended EditText which allows to move, rotate and resize text at the same time
Stars: ✭ 51 (+54.55%)
Mutual labels:  edittext
Bankcardformat
💳 自动格式化银行卡号的EditText,卡号格式化、归属银行及卡别判断
Stars: ✭ 273 (+727.27%)
Mutual labels:  edittext
Pinview
A PIN view library for Android. Use to enter PIN/OTP/password etc.
Stars: ✭ 387 (+1072.73%)
Mutual labels:  edittext
TagEditText
A simple Android Tag EditText
Stars: ✭ 14 (-57.58%)
Mutual labels:  edittext
Textfieldboxes
Material Design text field that comes in a box, based on (OLD) Google Material Design guidelines.
Stars: ✭ 760 (+2203.03%)
Mutual labels:  edittext
Editdrawabletext
EditDrawableText - An EditText which makes your Drawable Clickable
Stars: ✭ 288 (+772.73%)
Mutual labels:  edittext
Xedittext
XEditText: clear contents easily; show/hide password; separeta contents automatically, such as credit card number; disable Emoji inputs; 带删除功能的EditText;显示或者隐藏密码;可设置自动添加分隔符分割电话号码、银行卡号等;支持禁止Emoji表情符号输入。
Stars: ✭ 474 (+1336.36%)
Mutual labels:  edittext
CustomEditText
Simple Custom EditText for Android like Instagram
Stars: ✭ 23 (-30.3%)
Mutual labels:  edittext
currency edittext
Simple currency formatter for Android EditText
Stars: ✭ 64 (+93.94%)
Mutual labels:  edittext
Edittext Mask
The custom masks for EditText. The solution for input phone numbers, SSN, and so on for Android
Stars: ✭ 413 (+1151.52%)
Mutual labels:  edittext
CustomFontView
Custom View classes for TextView, EditText & Buttons - to set custom fonts
Stars: ✭ 26 (-21.21%)
Mutual labels:  edittext
Gsyricktext
类似微博的emoji表情、@人、话题等的EdiText,优化了编辑框中的光标点击和删除处理。TextView支持emoji表情、话题、链接、电话和@某人特殊显示的文本。
Stars: ✭ 651 (+1872.73%)
Mutual labels:  edittext
LG LinesEditView
Android 多行文本输入框 字数统计 限制字数
Stars: ✭ 31 (-6.06%)
Mutual labels:  edittext
Autocomplete
Simple yet powerful autocomplete behavior for EditTexts, to avoid working with MultiAutoCompleteTextView APIs.
Stars: ✭ 307 (+830.3%)
Mutual labels:  edittext
Textinputview
Permanent hint for EditText
Stars: ✭ 26 (-21.21%)
Mutual labels:  edittext
Rxmarkdown
📠Markdown for Android, supports TextView && EditText (Live Preview), supports code high light.
Stars: ✭ 714 (+2063.64%)
Mutual labels:  edittext
Androidedit
Android EditText的撤销和恢复(反撤销)
Stars: ✭ 449 (+1260.61%)
Mutual labels:  edittext

SplitEditText

Download JCenter JitPack CI CircleCI API License Blog QQGroup

SplitEditText for Android 是一个灵活的分割编辑框。常常应用于 验证码输入密码输入 、等场景。

之所以造这个轮子,是因为之前有这样的需求,然后也用过其它类似开源的库(VerificationCodeView),但是需求随着需求的变动,之前使用的库就不太满足现有的需求。所以最近抽空写了一个。

特性说明

  • [x] 支持设置框数量
  • [x] 支持设置框的风格样式
  • [x] 支持根据状态区分框颜色
  • [x] 基于EditText实现,更优雅

Gif 展示

Image

SplitEditText 自定义属性说明

属性 值类型 默认值 说明
setStrokeWidth dimension 1dp 画笔描边的宽度
setBorderColor color #FF666666 边框颜色
setInputBorderColor color #FF1E90FF 已输入文本的边框颜色
setFocusBorderColor color 焦点框的边框颜色
setBoxBackgroundColor color 框的背景颜色
setBorderCornerRadius dimension 0dp 框的圆角大小(当 BorderSpacing0dp 时,只有最左和最右两端的框有圆角)
setBorderSpacing dimension 8dp 框与框之间的间距大小
setMaxLength integer 6 允许输入的最大长度(框个数量)
setBorderStyle enum box 边框风格
setTextStyle enum plain_text 文本风格(可以是明文或者密文,默认:明文)
setCipherMask string * 密文掩码(当 TextStyle 为密文时,可自定义密文掩码)
setFakeBoldText boolean false 是否是粗体

引入

Maven:

<dependency>
  <groupId>com.king.view</groupId>
  <artifactId>splitedittext</artifactId>
  <version>1.0.0</version>
  <type>pom</type>
</dependency>

Gradle:

//AndroidX
implementation 'com.king.view:splitedittext:1.0.0'

Lvy:

<dependency org='com.king.view' name='splitedittext' rev='1.0.0'>
  <artifact name='$AID' ext='pom'></artifact>
</dependency>
如果Gradle出现compile失败的情况,可以在Project的build.gradle里面添加如下:(也可以使用上面的GitPack来complie)
allprojects {
    repositories {
        maven { url 'https://dl.bintray.com/jenly/maven' }
    }
}

示例

布局示例

    <com.king.view.splitedittext.SplitEditText
        android:id="@+id/splitEditText"
        android:layout_width="match_parent"
        android:layout_height="45dp"
        android:inputType="number"/>

代码示例

Kotlin

    //设置监听
    splitEditText.setOnTextInputListener(object : SplitEditText.OnTextInputListener {
        override fun onTextInputChanged(text: String, length: Int) {
            //TODO 文本输入改变
        }

        override fun onTextInputCompleted(text: String) {
            //TODO 文本输入完成
        }

    })

Java

    //设置监听
    splitEditText.setOnTextInputListener(new SplitEditText.OnTextInputListener(){

        @Override
        public void onTextInputChanged(String text, int length) {
            //TODO 文本输入改变
        }

        @Override
        public void onTextInputCompleted(String text) {
            //TODO 文本输入完成
        }
    });

更多使用详情,请查看app中的源码使用示例

相关推荐

KingKeyboard 自定义键盘,满足各种不同场景的键盘输入需求

版本记录

v1.0.0:2021-1-5

  • SplitEditText初始版本

赞赏

如果您喜欢SplitEditText,或感觉SplitEditText帮助到了您,可以点右上角“Star”支持一下,您的支持就是我的动力,谢谢 😃

您也可以扫描下面的二维码,请作者喝杯咖啡 ☕️

关于我

Name: Jenly

Email: jenly1314#gmail.com / jenly1314#vip.qq.com

CSDN: jenly121

CNBlogs: jenly

GitHub: jenly1314

Gitee: jenly1314

加入QQ群: 20867961

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].