Git Product home page Git Product logo

xedittext's Introduction

中文说明

##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 youself 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.2@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.
setClearDrawable(int resId) set your drawableResId to replace the defalut 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.

xedittext's People

Contributors

woxingxiao avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar  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.