[3.3.2]fix AutoPilotAndCheckView etInputSpeed setSelection IndexOutOfBoundsException

This commit is contained in:
xuxinchao
2023-07-11 17:59:04 +08:00
parent b8c9f7e3fb
commit 14214440ab

View File

@@ -113,7 +113,9 @@ internal class AutoPilotAndCheckView @JvmOverloads constructor(
}
etInputSpeed.setText(speedLimit.toString())
etInputSpeed.setSelection(speedLimit.toString().length)
try{
etInputSpeed.setSelection(speedLimit.toString().length)
}catch (_:Exception){}
}
}
@@ -161,7 +163,9 @@ internal class AutoPilotAndCheckView @JvmOverloads constructor(
return@setOnTouchListener true
}
etInputSpeed.isFocusableInTouchMode = true
etInputSpeed.setSelection(speedLimit.toString().length)
try {
etInputSpeed.setSelection(speedLimit.toString().length)
}catch (_:Exception){}
if (keyBoardUtil == null) {
keyBoardUtil = KeyBoardUtil(sKeyBoardView, etInputSpeed)
}
@@ -189,7 +193,9 @@ internal class AutoPilotAndCheckView @JvmOverloads constructor(
} else{
ToastUtils.showShort("车速不能再减了")
}
etInputSpeed.setSelection(speedLimit.toString().length)
try{
etInputSpeed.setSelection(speedLimit.toString().length)
}catch (_:Exception){}
}
ivSpeedAdd.setOnClickListener {
@@ -202,7 +208,9 @@ internal class AutoPilotAndCheckView @JvmOverloads constructor(
} else{
ToastUtils.showShort("车速不能再加了")
}
etInputSpeed.setSelection(speedLimit.toString().length)
try{
etInputSpeed.setSelection(speedLimit.toString().length)
}catch (_:Exception){}
}
//速度确认
@@ -223,7 +231,9 @@ internal class AutoPilotAndCheckView @JvmOverloads constructor(
ToastUtils.showShort("设置车速失败,请启动域控制器")
}
}
etInputSpeed.setSelection(speedLimit.toString().length)
try {
etInputSpeed.setSelection(speedLimit.toString().length)
}catch (_:Exception){}
}
initOchView()