diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/tools/AutoPilotAndCheckView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/tools/AutoPilotAndCheckView.kt index 578be323dd..9de8165171 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/tools/AutoPilotAndCheckView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/tools/AutoPilotAndCheckView.kt @@ -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()