CustomEditText
包含一些常用的基本功能
主要功能
1、是否顯示清除內容按鈕
2、輸入框中是否可以輸入表情
3、控制可輸入文字的最大長度
4、設置輸入框的手機號形式
5、自定義輸入規則控制
6、設置輸入框爲密碼形式
7、是都顯示錯誤信息
使用方法
1、在你的build.gradle中加入:
dependencies {
compile 'com.yuanxueyuan.customedailog:customeditext:1.1.0'
}
2、xml中
<com.yuanxueyuan.customeditext.View.CustomEditText
android:id="@+id/edt"
android:layout_width="wrap_content"
android:layout_height="50dp"/>
3、使用
CustomEditText edt = findViewById(R.id.edt);
//是否顯示清除內容按鈕
edt.showCleanImg(true);
//是否可輸入表情
edt.setEmojiEnable(true);
//是否可輸入表情,並且顯示輸入長度
edt.setEmojiEnable(true,11);
//按照手機號的形式輸入
edt.setPhone();
//按照密碼形式輸入
edt.setPassword();//默認無小眼睛
//按照密碼的形式輸入,並且有小眼睛可以點擊顯示密碼明文
edt.setPassword(true);
//自定義輸入規則內容
edt.customInputTye("自己的正則表達式");
//顯示顫抖的錯誤信息
edt.showMessage("錯誤信息內容");
//顯示顫抖的錯誤信息,並且可以自定義錯誤圖標
edt.showMessage("錯誤信息內容",R.mipmap.eye_close);
git
https://github.com/YXY001/Dailog