|
@@ -124,6 +124,55 @@ class CrEditTextWidget @JvmOverloads constructor(
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * 设置是否为密码框
|
|
|
+ * @param isPassword Boolean
|
|
|
+ */
|
|
|
+ fun setIsPassword(isPassword:Boolean){
|
|
|
+ if(isPassword){
|
|
|
+ txtContent?.inputType = InputType.TYPE_TEXT_VARIATION_PASSWORD or InputType.TYPE_CLASS_TEXT
|
|
|
+ }else{
|
|
|
+ txtContent?.inputType = InputType.TYPE_CLASS_TEXT
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 设置文字颜色
|
|
|
+ * @param color Int 颜色
|
|
|
+ */
|
|
|
+ fun setContentColor(color:Int){
|
|
|
+ txtContent?.setTextColor(color)
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 设置提示文字颜色
|
|
|
+ * @param color Int 颜色
|
|
|
+ */
|
|
|
+ fun setContentHintColor(color:Int){
|
|
|
+ txtContent?.setHintTextColor(color)
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 设置字体图标
|
|
|
+ * @param icoName String 图标名称
|
|
|
+ */
|
|
|
+ fun setFontIcon(icoName:String){
|
|
|
+ leftICO?.visibility = VISIBLE
|
|
|
+ imageView?.visibility = GONE
|
|
|
+ FontManager.setTextView(context!!,leftICO!!,icoName);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 设置图片图标
|
|
|
+ * @param drawable Drawable 图标资源
|
|
|
+ */
|
|
|
+ fun setImageIcon(drawable: Drawable){
|
|
|
+ leftICO?.visibility = GONE
|
|
|
+ imageView?.visibility = VISIBLE
|
|
|
+ imageView?.setImageDrawable(drawable)
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
* 视图点击事件
|
|
|
* @param view View
|
|
|
*/
|