Giter Site home page Giter Site logo

anu-prakash-dev / xedittext Goto Github PK

View Code? Open in Web Editor NEW

This project forked from woxingxiao/xedittext

0.0 2.0 0.0 3.56 MB

XEditText: to clear contents easily; to separeta contents automatically, such as credit card number; to disable Emoji inputs; with an (tips) option icon; iOS style. 带删除功能的EditText;可设置自动添加分隔符分割电话号码、银行卡号等;支持禁止Emoji表情符号输入;自定义右边显示图标作功能选项;仿iOS输入框风格

Java 100.00%

xedittext's Introduction

Download

中文说明

##What can I do ?

  • Deleting function is available. Click the drawableRight icon to clear all contents.
  • Insert separator automatically during inputting. You can customize the separator whatever you want ("", -, etc.). But you have to set pattern, which is kind of a rule you are going to separate the contents.
  • Can disable Emoji input easily. You don't need to exclude the Emoji by yourself in codes anymore.
  • drawableRight icon, which be called Marker, can also be customized. When you do that, for example, you can turn it as an input tips option with a PopUpWindow by listening to the Marker's onMarkerClickListener.
  • iOS style is available. drawableLeft and hint are both at the center of EditText when it has not be focused.

##How to use ?

###Gradle

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

demo3 demo4

demo5 demo6


###Attributes

attr format describe
x_separator String separator, insert automatically during inputting. "" by default.
x_disableEmoji boolean disable Emoji or not, false by default.
x_customizeMarkerEnable boolean customize Marker or not, false by default.
x_showMarkerTime enum set when Marker shows, 3 options: after_input(by default), before_input, always
x_iOSStyleEnable boolean enable iOS style or not, false by default.

###Methods:

name describe
setSeparator(String separator) what separator you want to set.
setHasNoSeparator(boolean hasNoSeparator) set none separator or not, if set true, separator equals "".
setPattern(int[] pattern) pattern is a kind of rules that you want to separate the contents, for example, credit card input: separator = "-", pattern = int[]{4,4,4,4}, result = xxxx-xxxx-xxxx-xxxx.
setRightMarkerDrawable(Drawable drawable) set drawable to replace the default clear icon.When drawable == null, Marker is invisible.
setRightMarkerDrawableRes(int resId) set drawableResId to replace the default clear icon.
setTextToSeparate(CharSequence c) set normal strings to EditText, then show separated strings according to separator and pattern you've set already.
getNonSeparatorText() get none separators contents, no matter you've set separator or not.
setOnTextChangeListener(OnTextChangeListener listener) the same as EditText's addOnTextChangeListener() method.
setDisableEmoji(boolean disableEmoji) disable Emoji or not.
setCustomizeMarkerEnable(boolean customizeMarkerEnable) customize Marker or not.
setOnMarkerClickListener(OnMarkerClickListener markerClickListener) listen to Marker's onTouch event.
setShowMarkerTime(ShowMarkerTime showMarkerTime) set when the Marker shows.
setiOSStyleEnable(boolean iOSStyleEnable) enable iOS style or not.
setMaxLength(int maxLength) set max length of contents.

###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.

xedittext's People

Contributors

woxingxiao avatar

Watchers

James Cloos avatar Anu Prakash avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.