[Update]调整自动驾驶交互
This commit is contained in:
@@ -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("设置车速失败,请启动域控制器")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user