feat: 航班号大写,过滤字母数字之外的字符
This commit is contained in:
@@ -8,6 +8,7 @@ import androidx.core.widget.doOnTextChanged
|
||||
import androidx.databinding.BindingAdapter
|
||||
import androidx.databinding.InverseBindingAdapter
|
||||
import androidx.databinding.InverseBindingListener
|
||||
import com.lukouguoji.module_base.ktx.UpperCaseAlphanumericInputFilter
|
||||
import dev.utils.app.EditTextUtils
|
||||
import dev.utils.app.info.KeyValue
|
||||
|
||||
@@ -288,4 +289,30 @@ fun setSearchLayoutNewInputWaybill(layout: PadSearchLayoutNew, isWaybill: Boolea
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// 大写字母+数字输入限制 BindingAdapter
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/**
|
||||
* 为PadSearchLayout设置大写字母+数字输入限制
|
||||
* 自动转换小写为大写,过滤中文、特殊符号、空格
|
||||
*/
|
||||
@BindingAdapter("setUpperCaseAlphanumeric", requireAll = false)
|
||||
fun setUpperCaseAlphanumeric(layout: PadSearchLayout, enabled: Boolean) {
|
||||
if (enabled) {
|
||||
layout.et.filters = arrayOf(UpperCaseAlphanumericInputFilter())
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 为PadSearchLayoutNew设置大写字母+数字输入限制
|
||||
* 自动转换小写为大写,过滤中文、特殊符号、空格
|
||||
*/
|
||||
@BindingAdapter("setUpperCaseAlphanumeric", requireAll = false)
|
||||
fun setSearchLayoutNewUpperCaseAlphanumeric(layout: PadSearchLayoutNew, enabled: Boolean) {
|
||||
if (enabled) {
|
||||
layout.et.filters = arrayOf(UpperCaseAlphanumericInputFilter())
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user