All Projects → Cielsk → clearable-edittext

Cielsk / clearable-edittext

Licence: other
Simple custom view for clearable EditText.

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to clearable-edittext

EasyMoney-Widgets
The widgets (EditText and TextView) for support of money requirements like currency, number formatting, comma formatting etc.
Stars: ✭ 91 (+56.9%)
Mutual labels:  custom-view, edittext
passport
A Kotlin-based Android view validation library with a simple DSL.
Stars: ✭ 31 (-46.55%)
Mutual labels:  edittext
Hyena
鬣狗快速开发库(2018年6月停止维护)
Stars: ✭ 21 (-63.79%)
Mutual labels:  edittext
flasto
A FLoating ASsistive TOuch library for android!
Stars: ✭ 15 (-74.14%)
Mutual labels:  custom-view
SquaresLoadingView
A SquaresLoadingView based on android.View, nicely rotation、easy to use.
Stars: ✭ 26 (-55.17%)
Mutual labels:  custom-view
SheenValidator
Android library to make form validation easier
Stars: ✭ 29 (-50%)
Mutual labels:  edittext
password-view
Android password animation
Stars: ✭ 43 (-25.86%)
Mutual labels:  custom-view
searchview
🔍 A beautiful searchview with animations.
Stars: ✭ 12 (-79.31%)
Mutual labels:  edittext
MarkDEditor
A WYSIWYG MarkDown editor for Android.
Stars: ✭ 76 (+31.03%)
Mutual labels:  custom-view
CodeView
Android Library to make it easy to create an Code editor or IDE that support any languages and themes, with auto complete, auto indenting, snippets and more features
Stars: ✭ 254 (+337.93%)
Mutual labels:  autocompletetextview
SkeletonPlaceholderView
A library for creating dynamic skeleton view
Stars: ✭ 25 (-56.9%)
Mutual labels:  custom-view
YuanaItemSettingView
Customizable Item Setting View Android
Stars: ✭ 15 (-74.14%)
Mutual labels:  custom-view
SoundLine
An Android custom view which offers an audio timeline controller as the SoundCloud Sound Wave
Stars: ✭ 53 (-8.62%)
Mutual labels:  custom-view
TextViewPlus
an android library for setting custom font in xml layout
Stars: ✭ 27 (-53.45%)
Mutual labels:  edittext
un-material-tab
(deprecated) Custom tab layout which can be used as a material TabLayout alternative and contains basic functionality which Google's TabLayout has.
Stars: ✭ 83 (+43.1%)
Mutual labels:  custom-view
Custom-Grid-View
Custom Drag and Drop Grid for Home Assistant
Stars: ✭ 103 (+77.59%)
Mutual labels:  custom-view
AACustomFont
[UNMAINTAINED] AACustomFont is a lightweight custom font binder in XML directly in TextView, Button, EditText, RadioButton, CheckBox tags. The library is aimed to avoid custom views for custom fonts in XML and to minimize the JAVA code for setting the TypeFaces for each view.
Stars: ✭ 76 (+31.03%)
Mutual labels:  custom-view
MenuPopupView
一款仿iOS长按菜单弹窗的自定义控件
Stars: ✭ 26 (-55.17%)
Mutual labels:  custom-view
RxLoading
RxJava library for showing a loading (i.e. progress bar) state while waiting for async data with minimal effort and advanced options.
Stars: ✭ 49 (-15.52%)
Mutual labels:  custom-view
double-avatar-view
Instagram-like double avatar view with cropping
Stars: ✭ 31 (-46.55%)
Mutual labels:  custom-view

clearable-edittext

Build Status

Simple custom view for clearable EditText.

Function

Usage

  • Add a icon in the right of EditText and its subclass:
    • AutoCompleteTextView
    • TextInputEditText
  • Clear texts when the icon is touched
  • Hide icon when EditText not focused
  • You can define your own icon drawable

Gradle Dependency

Step 1. Add it in your root build.gradle at the end of repositories:

allprojects {
  repositories {
    //... 
    
    maven { url 'https://jitpack.io' }
  }
}

Step 2. Add the dependency

dependencies {
  compile 'com.github.Cielsk:clearable-edittext:0.0.5'
}

The latest version is shown on JitPack badge.

Usage

By default, the clear icon is a black material design icon called 'content/ic_clear'.

Default Clearable EditText:

<com.cielyang.android.clearableedittext.ClearableEditText
  android:layout_width="match_parent"
  android:layout_height="wrap_content"
  />

Screenshot of demo: Default Icon

And you can define your own icon drawable by assigning drawable resource to app:clearIconDrawable:

Custom Clearable EditText:

<com.cielyang.android.clearableedittext.ClearableEditText
  android:layout_width="match_parent"
  android:layout_height="wrap_content"
  app:clearIconDrawable="@drawable/ic_clear_grey_500_24dp"
  app:clearIconDrawWhenFocused="false"
  />

Screenshot of demo: Custom Icon

You can use subclasses in the same way(just change the class name).

This library also supports some event listeners

OnTextClearedListener

This is called when the text is cleared

clearableEditText.setOnTextClearedListener(new OnTextClearedListener() {
    @Override
    public void onTextCleared() {
        // your code here
    }
});
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].