feat: 航班号大写,过滤字母数字之外的字符
This commit is contained in:
@@ -8,6 +8,7 @@ import androidx.core.widget.doOnTextChanged
|
|||||||
import androidx.databinding.BindingAdapter
|
import androidx.databinding.BindingAdapter
|
||||||
import androidx.databinding.InverseBindingAdapter
|
import androidx.databinding.InverseBindingAdapter
|
||||||
import androidx.databinding.InverseBindingListener
|
import androidx.databinding.InverseBindingListener
|
||||||
|
import com.lukouguoji.module_base.ktx.UpperCaseAlphanumericInputFilter
|
||||||
import dev.utils.app.EditTextUtils
|
import dev.utils.app.EditTextUtils
|
||||||
import dev.utils.app.info.KeyValue
|
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())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -46,7 +46,8 @@
|
|||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
hint='@{"请输入航班号"}'
|
hint='@{"请输入航班号"}'
|
||||||
type="@{SearchLayoutType.INPUT}"
|
type="@{SearchLayoutType.INPUT}"
|
||||||
value="@={viewModel.flightNo}" />
|
value="@={viewModel.flightNo}"
|
||||||
|
setUpperCaseAlphanumeric="@{true}" />
|
||||||
|
|
||||||
<!-- 目的站 -->
|
<!-- 目的站 -->
|
||||||
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
|
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
|
||||||
|
|||||||
@@ -44,6 +44,7 @@
|
|||||||
hint='@{"请输入航班号"}'
|
hint='@{"请输入航班号"}'
|
||||||
type="@{SearchLayoutType.INPUT}"
|
type="@{SearchLayoutType.INPUT}"
|
||||||
value="@={viewModel.flightNo}"
|
value="@={viewModel.flightNo}"
|
||||||
|
setUpperCaseAlphanumeric="@{true}"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1" />
|
android:layout_weight="1" />
|
||||||
|
|||||||
@@ -46,7 +46,8 @@
|
|||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
hint='@{"请输入航班号"}'
|
hint='@{"请输入航班号"}'
|
||||||
type="@{SearchLayoutType.INPUT}"
|
type="@{SearchLayoutType.INPUT}"
|
||||||
value="@={viewModel.flightNo}" />
|
value="@={viewModel.flightNo}"
|
||||||
|
setUpperCaseAlphanumeric="@{true}" />
|
||||||
|
|
||||||
<!-- 择代理 -->
|
<!-- 择代理 -->
|
||||||
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
|
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
|
||||||
|
|||||||
@@ -46,7 +46,8 @@
|
|||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
hint='@{"请输入航班号"}'
|
hint='@{"请输入航班号"}'
|
||||||
type="@{SearchLayoutType.INPUT}"
|
type="@{SearchLayoutType.INPUT}"
|
||||||
value="@={viewModel.flightNo}" />
|
value="@={viewModel.flightNo}"
|
||||||
|
setUpperCaseAlphanumeric="@{true}" />
|
||||||
|
|
||||||
<!-- ULD编号 -->
|
<!-- ULD编号 -->
|
||||||
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
|
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
|
||||||
|
|||||||
Reference in New Issue
Block a user