A clearable EditText which can be easy to clear your input.
Add the ClearableEditText dependency to your build.gradle.
dependencies {
compile 'com.zterry.clearableedittext:ClearableEditText:1.0.2'
}
You should just put the EditText in the container of ClearableEditText. And That's all.
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/activity_main"
android:layout_width="match_parent"
android:padding="16dp"
android:layout_height="match_parent">
<com.zterry.ClearableEditText
android:layout_width="match_parent"
android:layout_height="wrap_content">
<EditText
android:layout_width="match_parent"
android:text="@string/hello_world"
android:layout_height="match_parent" />
</com.zterry.ClearableEditText>
</android.support.constraint.ConstraintLayout>
Name: ZTerry Liu
E-mail: [email protected]
Subject: ClearableEditText