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 960adf8bbf..72fc255bcd 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
@@ -37,6 +37,7 @@ class AutoPilotAndCheckView @JvmOverloads constructor(
private var clickListener: ClickListener? = null
private var keyBoardUtil: KeyBoardUtil? = null
private var connectStatus = false
+ private var lastTime = 0L
init {
LayoutInflater.from(context).inflate(R.layout.view_auto_pilot_check, this, true)
@@ -51,10 +52,6 @@ class AutoPilotAndCheckView @JvmOverloads constructor(
keyBoardUtil?.setActionListener { inputContent ->
inputContent.toIntOrNull()?.let { speed ->
when {
- !connectStatus -> {
- ToastUtils.showShort("设置车速失败,请启动域控制器")
- keyBoardUtil?.hideKeyboard()
- }
speed > 60 -> {
// 设置失败键盘不消失,让用户直接修改
ToastUtils.showShort("超过最大限速值60,设置失败")
@@ -90,22 +87,28 @@ class AutoPilotAndCheckView @JvmOverloads constructor(
ivDebugFeedback.onClick {
clickListener?.showFeedbackView()
}
- etInputSpeed.setOnTouchListener { v, _ ->
- if (!connectStatus) {
- ToastUtils.showShort("设置车速失败,请启动域控制器")
- keyBoardUtil?.hideKeyboard()
- return@setOnTouchListener true
- } else {
- llSpeedPosition.background = resources.getDrawable(R.drawable.pilot_speed_high_light_bg)
- if (etInputSpeed.hasFocusable()) {
+ etInputSpeed.setOnFocusChangeListener { v, hasFocus ->
+ when {
+ hasFocus -> {
+ llSpeedPosition.background = resources.getDrawable(R.drawable.pilot_speed_high_light_bg)
if (keyBoardUtil == null) {
keyBoardUtil = KeyBoardUtil(sKeyBoardView, etInputSpeed)
}
keyBoardUtil?.showKeyboard()
}
- if (!etInputSpeed.hasFocus()) {
- etInputSpeed.requestFocus()
- }
+ else -> llSpeedPosition.background = resources.getDrawable(R.drawable.pilot_speed_bg)
+ }
+ }
+ etInputSpeed.setOnTouchListener { v, event ->
+ var curTime = System.currentTimeMillis()
+ if (curTime - lastTime < 1000) {
+ return@setOnTouchListener true
+ }
+ if (!connectStatus) {
+ ToastUtils.showShort("设置车速失败,请启动域控制器")
+ keyBoardUtil?.hideKeyboard()
+ return@setOnTouchListener true
+ } else {
return@setOnTouchListener false
}
}
diff --git a/core/function-impl/mogo-core-function-main/src/main/AndroidManifest.xml b/core/function-impl/mogo-core-function-main/src/main/AndroidManifest.xml
index b068b0c04a..9ed171e1dc 100644
--- a/core/function-impl/mogo-core-function-main/src/main/AndroidManifest.xml
+++ b/core/function-impl/mogo-core-function-main/src/main/AndroidManifest.xml
@@ -9,6 +9,7 @@
+