[Fix]域控制器未开启不让输入车速

This commit is contained in:
chenfufeng
2022-01-20 19:34:53 +08:00
parent 5c4578d8af
commit c96dd9f2fa
2 changed files with 15 additions and 9 deletions

View File

@@ -82,16 +82,22 @@ class AutoPilotAndCheckView @JvmOverloads constructor(
clickListener?.go2CheckPage()
}
etInputSpeed.setOnTouchListener { v, _ ->
if (etInputSpeed.hasFocusable()) {
if (keyBoardUtil == null) {
keyBoardUtil = KeyBoardUtil(sKeyBoardView, etInputSpeed)
if (!connectStatus) {
ToastUtils.showShort("设置车速失败,请启动域控制器")
keyBoardUtil?.hideKeyboard()
return@setOnTouchListener true
} else {
if (etInputSpeed.hasFocusable()) {
if (keyBoardUtil == null) {
keyBoardUtil = KeyBoardUtil(sKeyBoardView, etInputSpeed)
}
keyBoardUtil?.showKeyboard()
}
keyBoardUtil?.showKeyboard()
if (!etInputSpeed.hasFocus()) {
etInputSpeed.requestFocus()
}
return@setOnTouchListener false
}
if (!etInputSpeed.hasFocus()) {
etInputSpeed.requestFocus()
}
return@setOnTouchListener false
}
// // 比如需要设置默认速度
// val speed = "30"