Skip to content

zhouchupen/TextClearableEditText

Repository files navigation

TextClearableEditText

Android自定义带标题和可清除功能的EditText

Installing

Users of your library will need add the jitpack.io repository:

allprojects {
 repositories {
    jcenter()
    maven { url "https://jitpack.io" }
 }
}

and:

dependencies {
    compile 'com.github.zhouchupen:TextClearableEditText:v1.1'
}

Note: do not add the jitpack.io repository under buildscript

Adding a sample app

If you add a sample app to the same repo then your app needs to depend on the library. To do this in your app/build.gradle add a dependency in the form:

dependencies {
    compile project(':library')
}

where 'library' is the name of your library module.

Using

You may need this to use the edittext. Put this into your xml file:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <com.scnu.zhou.widget.TextClearableEditText
        android:id="@+id/et_user"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:title="用户名"
        app:hint="请输入用户名"
        app:lineColor="#97CC00"
        app:singleline="true"
        android:layout_marginTop="15dp">

    </com.scnu.zhou.widget.TextClearableEditText>

    <com.scnu.zhou.widget.TextClearableEditText
        android:id="@+id/et_password"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:title="密码"
        app:hint="请输入密码"
        app:lineColor="#97CC00"
        app:singleline="true"
        app:password="true"
        android:layout_marginTop="15dp">

    </com.scnu.zhou.widget.TextClearableEditText>

</LinearLayout>

where ‘lineColor’ is the color of the underline, and you can set 'password' as true to make the input type of edittext 'password'.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages