Skip to content

Latest commit

 

History

History
76 lines (65 loc) · 3.63 KB

README_zh.md

File metadata and controls

76 lines (65 loc) · 3.63 KB

Download

##我的特点

  • 自带清除功能图标,点击清除输入内容
  • 输入时手机号时自动分割:138 0000 0000,提高用户体验,轻松实现;
  • 支持自定义分割符号和分割模板,如分割银行卡号:6000-0000-0000-0000-000;
  • 支持禁止Emoji表情符号输入;
  • drawableRight自定义,点击监听,配合PopupWindow等进行输入提示;
  • 支持仿iOS输入框风格

##怎么玩儿

###Gradle

dependencies{
    compile 'com.xw.repo:xedittext:1.0.6@aar'
}

demo3 demo4

demo5 demo6


###Attributes

attr format describe
x_separator String 分隔符,默认是一个空格
x_disableEmoji boolean 禁止Emoji输入, 默认可以输入
x_customizeMarkerEnable boolean 是否自定义Marker
x_showMarkerTime enum 显示Marker的时间:after_input(default), before_input, always
x_iOSStyleEnable boolean 是否使用iOS风格

###Methods:

方法名 描述
setSeparator(String separator) 自定义分隔符,默认是一个空格
setHasNoSeparator(boolean hasNoSeparator) 设置无分隔符,功能同普通EditText
setPattern(int[] pattern) 自定义模板,默认常见手机号分割,即int[]{3,4,4}
setRightMarkerDrawable(Drawable drawable) 自定义Marker图标。当设置为空时,Marker被隐藏
setRightMarkerDrawableRes(int resId) 自定义Marker图标的资源id
setTextToSeparate(CharSequence c) 设置需要自动模板转换的内容
getNonSeparatorText() 获得无分割符的内容
setOnTextChangeListener(OnTextChangeListener listener) 设置输入监听,功能与EditText的addOnTextChangeListener()完全一样
setDisableEmoji(boolean disableEmoji) true, 设置禁止Emoji输入
setCustomizeMarkerEnable(boolean customizeMarkerEnable) 设置是否自定义Marker
setOnMarkerClickListener(OnMarkerClickListener markerClickListener) 自定义Marker的点击监听
setShowMarkerTime(ShowMarkerTime showMarkerTime) 设置显示Marker的时间
setiOSStyleEnable(boolean iOSStyleEnable) 设置是否使用iOS风格
setMaxLength(int maxLength) 设置输入内容最大长度

###License

The MIT License (MIT)

Copyright (c) 2016 woxingxiao

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.