XEditText

by woxingxiao

woxingxiao /XEditText

XEditText: clear contents easily; show/hide password; separeta contents automatically, such as credi...

454 Stars 80 Forks Last release: over 3 years ago (2.0.0) 110 Commits 6 Releases

Available items

No Items, yet!

The developer of this repository has not created any items for sale yet. Need a bug fixed? Help with integration? A different license? Create a request here:

Download

XEditText

Wrapped common usage of

EditText
.

Features

  • To clear all text content just by one click on the right. The clear drawable is customizable.
  • Perfectly fit for password input scenario. The toggle drawable is also customizable.
  • You can customize the Separator or Pattern to separate the text content. But the text content by COPY, CUT, and PASTE will no longer be affected by Separator or Pattern you set.
  • Be able to disable Emoji input.

Screenshot


demo1 demo2

demo3

Gradle

Support:

groovy
    dependencies{
        //e.g. 'com.xw.repo:xedittext:[email protected]'
        implementation 'com.xw.repo:xedittext:${LATEST_VERSION}@aar'
    }

AndroidX:

groovy
    dependencies{
        //e.g. 'com.xw.repo:xedittext-androidx:[email protected]'
        implementation 'com.xw.repo:xedittext-androidx:${LATEST_VERSION}@aar'
    }

Usage

  

<com.xw.repo.xedittext android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="clear drawable"></com.xw.repo.xedittext>

<com.xw.repo.xedittext android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="default password input" android:inputtype="textPassword"></com.xw.repo.xedittext>

<com.xw.repo.xedittext android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="pwd input, custom drawables" android:inputtype="textPassword" don set gravity to center center_horizontal right or end otherwise the cleardrawable will not appear.> app:x_clearDrawable="@mipmap/ic_clear" app:x_hidePwdDrawable="@mipmap/ic_hide" app:x_showPwdDrawable="@mipmap/ic_show"/>

<com.xw.repo.xedittext android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="the pattern to separate the content" app:x_pattern="3,4,4" app:x_separator=" "></com.xw.repo.xedittext> </com.xw.repo.xedittext>

Need to listen to the focus state? Call

.setOnXTextChangeListener()
instead of
.setOnTextChangeListener()

Check the sample for more details.

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.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.