[dev_robobus-d_230322_3.0.0]车速设置光标处理

This commit is contained in:
xuxinchao
2023-04-10 12:11:02 +08:00
parent e56ccecc40
commit 56ff6e1bc4

View File

@@ -101,10 +101,14 @@ internal class AutoPilotAndCheckView @JvmOverloads constructor(
override fun onUpdate(inputContent: String?) {
if (inputContent != null) {
try {
speedLimit = inputContent.toInt()
if(speedLimit>60){
speedLimit = 60
ToastUtils.showShort("最大限速60")
if(inputContent.isEmpty()){
speedLimit = 0
}else{
speedLimit = inputContent.toInt()
if(speedLimit>60){
speedLimit = 60
ToastUtils.showShort("最大限速60")
}
}
}catch (t: Exception){
ToastUtils.showShort("最大限速60")
@@ -112,6 +116,7 @@ internal class AutoPilotAndCheckView @JvmOverloads constructor(
}
etInputSpeed.setText(speedLimit.toString())
etInputSpeed.setSelection(speedLimit.toString().length)
}
}