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 557ed1de2e..5ed91e256f 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 @@ -51,12 +51,15 @@ class AutoPilotAndCheckView : FrameLayout, IMoGoAutopilotStatusListener { inputContent.toIntOrNull()?.let { speed -> when { !connectStatus -> { - ToastUtils.showShort("域控制器连接异常,请先启动") + ToastUtils.showShort("设置车速失败,请启动域控制器") + keyBoardUtil?.hideKeyboard() } speed > 60 -> { + // 设置失败键盘不消失,让用户直接修改 ToastUtils.showShort("超过最大限速值60,设置失败") } else -> { + keyBoardUtil?.hideKeyboard() // 设置自动驾驶速度 var isSuccess = CallerAutoPilotManager.setAutoPilotSpeed(speed) when { @@ -64,7 +67,7 @@ class AutoPilotAndCheckView : FrameLayout, IMoGoAutopilotStatusListener { ToastUtils.showShort("车速设置成功,立即生效") } else -> { - ToastUtils.showShort("车速设置失败,请稍后重试") + ToastUtils.showShort("设置车速失败,请启动域控制器") } } } diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/utils/KeyBoardUtil.java b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/utils/KeyBoardUtil.java index af17983435..8b826a2255 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/utils/KeyBoardUtil.java +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/utils/KeyBoardUtil.java @@ -80,7 +80,6 @@ public class KeyBoardUtil { } break; case Keyboard.KEYCODE_DONE: - keyboardView.setVisibility(View.GONE); if (actionListener != null) { actionListener.onComplete(editText.getText().toString()); } @@ -128,6 +127,10 @@ public class KeyBoardUtil { } } + public void hideKeyboard() { + keyboardView.setVisibility(View.GONE); + } + public interface ActionListener { void onComplete(String inputContent); }