From a4ff009c25df55d33532eca42891aa17637ac44c Mon Sep 17 00:00:00 2001 From: xuxinchao Date: Wed, 6 Aug 2025 19:20:16 +0800 Subject: [PATCH] =?UTF-8?q?[8.2.0]=E8=BF=90=E8=90=A5=E9=9D=A2=E6=9D=BF?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hmi/ui/operate/OperatePanelLayout.kt | 23 ++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/operate/OperatePanelLayout.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/operate/OperatePanelLayout.kt index 163e6bbb5d..b417e19fba 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/operate/OperatePanelLayout.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/operate/OperatePanelLayout.kt @@ -78,6 +78,7 @@ import kotlinx.android.synthetic.main.layout_operate_panel.view.iv_operate_panel import kotlinx.coroutines.launch import me.jessyan.autosize.utils.AutoSizeUtils import mogo.telematics.pad.MessagePad +import java.lang.Exception import java.util.concurrent.ConcurrentHashMap import java.util.concurrent.TimeUnit import kotlin.math.min @@ -434,6 +435,8 @@ class OperatePanelLayout : LinearLayout { return super.getDefaultVal(pref) } + private var lastToastTime: Long = 0L + override fun onAutopilotIpcConnectStatusChanged( status: AdasConstants.IpcConnectionStatus, reason: String? @@ -445,15 +448,19 @@ class OperatePanelLayout : LinearLayout { Log.i("xuxinchao","域控连接成功") setEnableStatus(true) }else{ - Log.i("xuxinchao","请等待与域控恢复连接后操作") //断连中,持续提示:请等待与域控恢复连接后操作;并且将所有开关置为不可用状态 - val customToastView = AppStateManager.currentActivity()?.layoutInflater?.inflate(R.layout.view_ipc_connect_status_toast,null) - val customToast = Toast(context?.applicationContext) - customToast.duration = Toast.LENGTH_LONG - customToast.view = customToastView - customToast.setGravity(Gravity.START,AutoSizeUtils.dp2px(context, 280f),0) - customToast.show() - + Log.i("xuxinchao","请等待与域控恢复连接后操作") + if(System.currentTimeMillis() - lastToastTime > 5000){ + try { + val customToastView = AppStateManager.currentActivity()?.layoutInflater?.inflate(R.layout.view_ipc_connect_status_toast,null) + val customToast = Toast(AppStateManager.currentActivity()?.applicationContext) + customToast.duration = Toast.LENGTH_SHORT + customToast.view = customToastView + customToast.setGravity(Gravity.START,AutoSizeUtils.dp2px(context, 280f),0) + customToast.show() + }catch (_: Exception){} + lastToastTime = System.currentTimeMillis() + } setEnableStatus(false) } }