From b91382d7c9976684582e92e53012f298db8bf6c7 Mon Sep 17 00:00:00 2001 From: xuxinchao Date: Mon, 16 Jan 2023 14:53:55 +0800 Subject: [PATCH 1/2] =?UTF-8?q?[2.13.2]=E6=B6=88=E6=81=AF=E7=9B=92?= =?UTF-8?q?=E5=AD=90=E5=85=A8=E7=A8=8B=E7=82=B9=E5=87=BB=E4=BA=8B=E4=BB=B6?= =?UTF-8?q?=E5=88=86=E5=8F=91=E7=BB=99=E4=B8=9A=E5=8A=A1=E4=BE=A7=E8=BF=9B?= =?UTF-8?q?=E8=A1=8C=E5=90=8E=E7=BB=AD=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../adapter/PassengerMsgBoxBubbleAdapter.kt | 4 +- .../adapter/PassengerMsgBoxListAdapter.kt | 4 +- .../api/msgbox/IMsgBoxEventListener.kt | 9 +++ .../CallerMsgBoxEventListenerManager.kt | 70 +++++++++++++++++++ 4 files changed, 85 insertions(+), 2 deletions(-) create mode 100644 core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/msgbox/IMsgBoxEventListener.kt create mode 100644 core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/msgbox/CallerMsgBoxEventListenerManager.kt diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/PassengerMsgBoxBubbleAdapter.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/PassengerMsgBoxBubbleAdapter.kt index 364411654e..db78cd9935 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/PassengerMsgBoxBubbleAdapter.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/PassengerMsgBoxBubbleAdapter.kt @@ -12,6 +12,7 @@ import com.mogo.eagle.core.data.enums.EventTypeEnumNew import com.mogo.eagle.core.data.msgbox.* import com.mogo.eagle.core.utilcode.mogo.glide.GlideApp import com.mogo.eagle.core.function.call.hmi.CallerHmiManager +import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxEventListenerManager import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager import com.mogo.eagle.core.function.hmi.R import com.mogo.eagle.core.utilcode.mogo.glide.transform.GlideRoundedCornersTransform @@ -112,7 +113,8 @@ class PassengerMsgBoxBubbleAdapter(private val activity: Activity): RecyclerView holder.tvPassengerSummaryContent.text = summaryMsg.content holder.tvPassengerSummaryCheck.setOnClickListener { //跳转全览模式 - CallerHmiManager.showSmallFragment() +// CallerHmiManager.showSmallFragment() + CallerMsgBoxEventListenerManager.invokeListener() } } } diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/PassengerMsgBoxListAdapter.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/PassengerMsgBoxListAdapter.kt index 18c9695682..8bb23e0ed6 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/PassengerMsgBoxListAdapter.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/PassengerMsgBoxListAdapter.kt @@ -10,6 +10,7 @@ import androidx.recyclerview.widget.RecyclerView import com.mogo.eagle.core.data.enums.EventTypeEnumNew import com.mogo.eagle.core.data.msgbox.* import com.mogo.eagle.core.function.call.hmi.CallerHmiManager +import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxEventListenerManager import com.mogo.eagle.core.function.hmi.R import com.mogo.eagle.core.utilcode.mogo.glide.GlideApp import com.mogo.eagle.core.utilcode.mogo.glide.transform.GlideRoundedCornersTransform @@ -104,7 +105,8 @@ class PassengerMsgBoxListAdapter(private val activity: Activity): RecyclerView.A holder.tvPassengerSummaryContent.text = summaryMsg.content holder.tvPassengerSummaryCheck.setOnClickListener { //跳转全览模式 - CallerHmiManager.showSmallFragment() +// CallerHmiManager.showSmallFragment() + CallerMsgBoxEventListenerManager.invokeListener() } } } diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/msgbox/IMsgBoxEventListener.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/msgbox/IMsgBoxEventListener.kt new file mode 100644 index 0000000000..cebfca9d9b --- /dev/null +++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/msgbox/IMsgBoxEventListener.kt @@ -0,0 +1,9 @@ +package com.mogo.eagle.core.function.api.msgbox +/** + * @author XuXinChao + * @date 2023/1/16 + * 消息盒子事件监听回调 + */ +interface IMsgBoxEventListener { + fun onSummaryClickEvent() +} \ No newline at end of file diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/msgbox/CallerMsgBoxEventListenerManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/msgbox/CallerMsgBoxEventListenerManager.kt new file mode 100644 index 0000000000..3696e0f471 --- /dev/null +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/msgbox/CallerMsgBoxEventListenerManager.kt @@ -0,0 +1,70 @@ +package com.mogo.eagle.core.function.call.msgbox + +import androidx.annotation.Nullable +import com.mogo.eagle.core.function.api.msgbox.IMsgBoxEventListener +import com.mogo.eagle.core.function.call.base.CallerBase +import java.util.concurrent.ConcurrentHashMap + +/** + * @author XuXinChao + * @date 2023/1/16 + * 消息盒子事件监听管理 + */ +object CallerMsgBoxEventListenerManager: CallerBase() { + + private val statusListeners: ConcurrentHashMap = + ConcurrentHashMap() + + /** + * 添加数据监听 + * @param tag 标记,用来注销监听使用 + * @param listener 监听回调 + */ + fun addListener(@Nullable tag: String,@Nullable listener: IMsgBoxEventListener){ + if (statusListeners.containsKey(tag)) { + return + } + statusListeners[tag] = listener + } + + /** + * 删除状态监听 + * @param tag 标记,用来注销监听使用 + */ + fun removeListener(@Nullable tag: String) { + if (!statusListeners.containsKey(tag)) { + return + } + statusListeners.remove(tag) + } + + /** + * 删除状态监听 + * @param listener 要删除的监听对象 + */ + fun removeListener(@Nullable listener: IMsgBoxEventListener){ + if (!statusListeners.containsValue(listener)) { + return + } + var tag = "" + statusListeners.forEach { + if (it.value == listener) { + tag = it.key + statusListeners.remove(it.key) + } + } + } + + /** + * 触发监听 + */ + fun invokeListener(){ + statusListeners.forEach { + val tag = it.key + val listener = it.value + listener.onSummaryClickEvent() + } + } + + +} \ No newline at end of file From 3131e42e15900c185aa54c2e88413f6ce91bdc0f Mon Sep 17 00:00:00 2001 From: renwj Date: Mon, 16 Jan 2023 14:57:06 +0800 Subject: [PATCH 2/2] =?UTF-8?q?[2.13.2]=E9=95=BF=E9=93=BE=E8=A7=A6?= =?UTF-8?q?=E5=8F=91=E7=9A=84=E9=81=93=E8=B7=AF=E6=8B=A5=E5=A0=B5=E5=92=8C?= =?UTF-8?q?=E9=9D=99=E6=AD=A2=E9=9A=9C=E7=A2=8D=E7=89=A9=E4=BA=8B=E4=BB=B6?= =?UTF-8?q?poiType=E5=8A=A01,=E7=94=A8=E4=BA=8E=E5=8C=BA=E5=88=86=E4=B8=8D?= =?UTF-8?q?=E5=90=8C=E7=9A=84=E6=9D=A5=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mogo/eagle/core/data/enums/EventTypeEnumNew.kt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/enums/EventTypeEnumNew.kt b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/enums/EventTypeEnumNew.kt index a876d30687..dd4418e8db 100644 --- a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/enums/EventTypeEnumNew.kt +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/enums/EventTypeEnumNew.kt @@ -453,23 +453,23 @@ enum class EventTypeEnumNew( ), TYPE_USECASE_ID_ACCIDENT( 244.toString(), - "事故", + "交通事故", poiTypeSrcVr = R.drawable.v2x_icon_jiaotongshigu_vr, - content = "前方%s米事故", - tts = "前方%s米事故" + content = "前方%s米交通事故", + tts = "前方%s米交通事故" ), //------------车内标牌 obu end --------------> TYPE_SOCKET_ROAD_CONGESTION( - "10007", - "道路拥堵", + "100071", + "交通拥堵", poiTypeSrcVr = R.drawable.v2x_icon_yongdu_vr, content = "前方%s米交通拥堵", tts = "前方%s米交通拥堵" ), TYPE_SOCKET_ROAD_JINGZHI( - "10025", + "100251", "前方%s米静止障碍物占道", poiTypeSrcVr = R.drawable.v2x_icon_jingzhi_zhangai, content = "前方%s米静止障碍物占道",