From ab22a6f6a3e48a81cd5a10c1ed351ed01363a5c0 Mon Sep 17 00:00:00 2001 From: xuxinchao Date: Tue, 7 Mar 2023 14:45:18 +0800 Subject: [PATCH 1/9] =?UTF-8?q?[m1]=E6=B6=88=E6=81=AF=E7=9B=92=E5=AD=90?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=81=9C=E8=BD=A6=E9=A2=84=E5=91=8A=E8=BF=90?= =?UTF-8?q?=E8=90=A5=E6=B6=88=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hmi/ui/msgbox/MMsgBoxBubbleView.kt | 11 ++++ .../function/hmi/ui/msgbox/MMsgBoxListView.kt | 10 ++++ .../ui/msgbox/adapter/MMsgBoxBubbleAdapter.kt | 20 ++++++++ .../ui/msgbox/adapter/MMsgBoxListAdapter.kt | 27 ++++++++-- .../res/layout/item_m_msg_box_operation.xml | 51 +++++++++++++++++++ .../res/layout/item_m_msg_list_operation.xml | 46 +++++++++++++++++ 6 files changed, 160 insertions(+), 5 deletions(-) create mode 100644 core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_m_msg_box_operation.xml create mode 100644 core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_m_msg_list_operation.xml diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/MMsgBoxBubbleView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/MMsgBoxBubbleView.kt index 0c4c752c14..78f9002e4a 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/MMsgBoxBubbleView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/MMsgBoxBubbleView.kt @@ -9,6 +9,7 @@ import androidx.recyclerview.widget.LinearLayoutManager import com.mogo.eagle.core.data.msgbox.MsgBoxBean import com.mogo.eagle.core.data.msgbox.MsgBoxType import com.mogo.eagle.core.data.msgbox.MsgCategory +import com.mogo.eagle.core.data.msgbox.OperationMsg import com.mogo.eagle.core.function.api.datacenter.msgbox.IMsgBoxListener import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxEventListenerManager import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxListenerManager @@ -62,6 +63,16 @@ class MMsgBoxBubbleView @JvmOverloads constructor( mMsgBoxBubbleAdapter?.setData(dataList) } } + if(msgBoxList.type == MsgBoxType.OPERATION){ + if((msgBoxList.bean as OperationMsg).type == 2){ + MsgBoxConfig.noticeList.add(msgBoxList) + if(isShowData){ + CallerMsgBoxEventListenerManager.invokeUpdateTipListener(true) + dataList.add(msgBoxList) + mMsgBoxBubbleAdapter?.setData(dataList) + } + } + } } } } diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/MMsgBoxListView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/MMsgBoxListView.kt index 6b71ed67b8..e881c94369 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/MMsgBoxListView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/MMsgBoxListView.kt @@ -10,6 +10,7 @@ import androidx.recyclerview.widget.LinearLayoutManager import com.mogo.eagle.core.data.msgbox.MsgBoxBean import com.mogo.eagle.core.data.msgbox.MsgBoxType import com.mogo.eagle.core.data.msgbox.MsgCategory +import com.mogo.eagle.core.data.msgbox.OperationMsg import com.mogo.eagle.core.function.api.datacenter.msgbox.IMsgBoxEventListener import com.mogo.eagle.core.function.api.datacenter.msgbox.IMsgBoxListener import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxEventListenerManager @@ -64,6 +65,15 @@ class MMsgBoxListView @JvmOverloads constructor( mMsgBoxListAdapter?.setData(it) } } + if(msgBoxList.type == MsgBoxType.OPERATION){ + if((msgBoxList.bean as OperationMsg).type == 2){ + noticeList?.add(0,msgBoxList) + noticeList?.let { + mMsgBoxListAdapter?.setData(it) + } + } + } + } } } diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/MMsgBoxBubbleAdapter.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/MMsgBoxBubbleAdapter.kt index 057bdf0cb6..a679403300 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/MMsgBoxBubbleAdapter.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/MMsgBoxBubbleAdapter.kt @@ -28,6 +28,7 @@ class MMsgBoxBubbleAdapter(private val activity: Activity): RecyclerView.Adapter private val notice: Int = 1 private val v2x: Int = 2 private val summary: Int = 3 + private val operation: Int = 4 var countDownTimer: CountDownTimer?=null @@ -49,6 +50,10 @@ class MMsgBoxBubbleAdapter(private val activity: Activity): RecyclerView.Adapter val view = LayoutInflater.from(parent.context).inflate(R.layout.item_m_msg_box_summary,parent,false) BubbleSummaryHolder(view) } + operation -> { + val view = LayoutInflater.from(parent.context).inflate(R.layout.item_m_msg_box_operation,parent,false) + BubbleOperationHolder(view) + } else -> { val view = LayoutInflater.from(parent.context).inflate(R.layout.item_m_msg_box_v2x,parent,false) BubbleV2XHolder(view) @@ -120,6 +125,13 @@ class MMsgBoxBubbleAdapter(private val activity: Activity): RecyclerView.Adapter } } } + is BubbleOperationHolder ->{ + data?.let { + val operationMsg = it[position].bean as OperationMsg + holder.tvMOperationTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat()) + holder.tvMOperationContent.text = operationMsg.content + } + } } val msgBoxBean: MsgBoxBean = data!![position] @@ -146,6 +158,8 @@ class MMsgBoxBubbleAdapter(private val activity: Activity): RecyclerView.Adapter notice }else if(data!![position].type == MsgBoxType.V2X && data!![position].sourceType == DataSourceType.SUMMARY){ summary + }else if(data!![position].type == MsgBoxType.OPERATION){ + operation } else{ v2x } @@ -175,4 +189,10 @@ class MMsgBoxBubbleAdapter(private val activity: Activity): RecyclerView.Adapter var tvMSummaryTime: TextView = itemView.findViewById(R.id.tvMSummaryTime) } + //通知消息 + class BubbleOperationHolder(itemView: View): RecyclerView.ViewHolder(itemView){ + var tvMOperationTime: TextView = itemView.findViewById(R.id.tvMOperationTime) + var tvMOperationContent: TextView = itemView.findViewById(R.id.tvMOperationContent) + } + } \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/MMsgBoxListAdapter.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/MMsgBoxListAdapter.kt index 9e44371868..9b2c0c0e9d 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/MMsgBoxListAdapter.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/MMsgBoxListAdapter.kt @@ -9,10 +9,7 @@ import android.widget.TextView import androidx.recyclerview.widget.RecyclerView import com.mogo.eagle.core.data.enums.DataSourceType import com.mogo.eagle.core.data.enums.EventTypeEnumNew -import com.mogo.eagle.core.data.msgbox.MsgBoxBean -import com.mogo.eagle.core.data.msgbox.MsgBoxType -import com.mogo.eagle.core.data.msgbox.NoticeFrCloudMsg -import com.mogo.eagle.core.data.msgbox.V2XMsg +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 @@ -28,6 +25,7 @@ class MMsgBoxListAdapter(private val activity: Activity): RecyclerView.Adapter){ this.data = data @@ -44,6 +42,10 @@ class MMsgBoxListAdapter(private val activity: Activity): RecyclerView.Adapter { + val view = LayoutInflater.from(parent.context).inflate(R.layout.item_m_msg_list_operation,parent,false) + ListOperationHolder(view) + } else -> { val view = LayoutInflater.from(parent.context).inflate(R.layout.item_m_msg_list_v2x,parent,false) ListV2XHolder(view) @@ -111,6 +113,13 @@ class MMsgBoxListAdapter(private val activity: Activity): RecyclerView.Adapter { + data?.let { + val operationMsg = it[position].bean as OperationMsg + holder.tvMOperationTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat()) + holder.tvMOperationContent.text = operationMsg.content + } + } } } @@ -121,7 +130,9 @@ class MMsgBoxListAdapter(private val activity: Activity): RecyclerView.Adapter + + + + + + + + + + + \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_m_msg_list_operation.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_m_msg_list_operation.xml new file mode 100644 index 0000000000..d2a3127cbc --- /dev/null +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_m_msg_list_operation.xml @@ -0,0 +1,46 @@ + + + + + + + + + + + \ No newline at end of file From 5d05f0fdedb4c5e838a9ec648ab27eff476f478a Mon Sep 17 00:00:00 2001 From: xuxinchao Date: Wed, 8 Mar 2023 18:51:52 +0800 Subject: [PATCH 2/9] =?UTF-8?q?[opt-3.0]fix=E6=B6=88=E6=81=AF=E7=9B=92?= =?UTF-8?q?=E5=AD=90=E8=BD=A6=E8=BE=86=E7=B3=BB=E7=BB=9F=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E9=97=AA=E7=83=81=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../report/IPCReportManager.kt | 4 +- .../msgbox/adapter/DriverMsgBoxListAdapter.kt | 48 ++++++++++++++++++- .../core/data/deva/report/ReportEntity.kt | 3 +- 3 files changed, 50 insertions(+), 5 deletions(-) diff --git a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/report/IPCReportManager.kt b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/report/IPCReportManager.kt index d338f02da8..aa995725a5 100644 --- a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/report/IPCReportManager.kt +++ b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/report/IPCReportManager.kt @@ -79,7 +79,7 @@ class IPCReportManager : IMoGoAutopilotStatusListener { || it.resultList.contains(RESULT_SHOW_WARNING) || it.resultList.contains(RESULT_REMOTEPILOT_INFERIOR)){ val reportEntity = ReportEntity(TimeUtils.millis2String(System.currentTimeMillis()), - it.src,it.level,it.msg,it.code,it.resultList,it.actionsList) + it.src,it.level,it.msg,it.code,it.resultList,it.actionsList,false) CallerMsgBoxManager.saveMsgBox(MsgBoxBean(MsgBoxType.REPORT, reportEntity)) } @@ -91,7 +91,7 @@ class IPCReportManager : IMoGoAutopilotStatusListener { ReportEntity( TimeUtils.millis2String(System.currentTimeMillis()), it.src, it.level, it.msg, it.code, it.resultList, it.actionsList - ) + ,false) ) reportListFloatWindow?.refreshData(reportList) diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/DriverMsgBoxListAdapter.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/DriverMsgBoxListAdapter.kt index 2bf6e3930d..6c27709cbf 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/DriverMsgBoxListAdapter.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/DriverMsgBoxListAdapter.kt @@ -163,8 +163,51 @@ class DriverMsgBoxListAdapter(private val activity: Activity) : "${actionStr}${CallerAutoPilotControlManager.getReportActionDesc(action)}" } holder.tvReportActionOpen.text = "建议操作:$actionStr" + holder.tvStatusSelect.tag = reportEntity + if(reportEntity.isShow){ + holder.tvStatusSelect.setCompoundDrawablesWithIntrinsicBounds( + getDrawable(R.drawable.icon_msg_close), + null, + null, + null + ) + holder.tvStatusSelect.text = "折叠" + holder.ivReportImageNormal.visibility = View.GONE + holder.tvReportLevelNormal.visibility = View.GONE + holder.tvReportTimeNormal.visibility = View.GONE + holder.tvReportTypeNormal.visibility = View.GONE + + holder.ivReportImageOpen.visibility = View.VISIBLE + holder.tvReportLevelOpen.visibility = View.VISIBLE + holder.tvReportTimeOpen.visibility = View.VISIBLE + holder.tvReportTypeOpen.visibility = View.VISIBLE + holder.tvReportReasonOpen.visibility = View.VISIBLE + holder.tvReportSrcOpen.visibility = View.VISIBLE + holder.tvReportActionOpen.visibility = View.VISIBLE + }else{ + holder.tvStatusSelect.setCompoundDrawablesWithIntrinsicBounds( + getDrawable(R.drawable.icon_msg_open), + null, + null, + null + ) + holder.tvStatusSelect.text = "展开" + holder.ivReportImageNormal.visibility = View.VISIBLE + holder.tvReportLevelNormal.visibility = View.VISIBLE + holder.tvReportTimeNormal.visibility = View.VISIBLE + holder.tvReportTypeNormal.visibility = View.VISIBLE + + holder.ivReportImageOpen.visibility = View.GONE + holder.tvReportLevelOpen.visibility = View.GONE + holder.tvReportTimeOpen.visibility = View.GONE + holder.tvReportTypeOpen.visibility = View.GONE + holder.tvReportReasonOpen.visibility = View.GONE + holder.tvReportSrcOpen.visibility = View.GONE + holder.tvReportActionOpen.visibility = View.GONE + } holder.tvStatusSelect.setOnClickListener { - if (holder.tvReportLevelNormal.isVisible) { + if (!reportEntity.isShow) { + reportEntity.isShow = true holder.tvStatusSelect.setCompoundDrawablesWithIntrinsicBounds( getDrawable(R.drawable.icon_msg_close), null, @@ -185,6 +228,7 @@ class DriverMsgBoxListAdapter(private val activity: Activity) : holder.tvReportSrcOpen.visibility = View.VISIBLE holder.tvReportActionOpen.visibility = View.VISIBLE } else { + reportEntity.isShow = false holder.tvStatusSelect.setCompoundDrawablesWithIntrinsicBounds( getDrawable(R.drawable.icon_msg_open), null, @@ -323,7 +367,7 @@ class DriverMsgBoxListAdapter(private val activity: Activity) : TimeUtils.millis2String(it[position].timestamp, getHourMinFormat()) holder.tvV2XContent.text = v2XMsg.content holder.ivV2XImage.setImageDrawable(activity.resources.getDrawable( - EventTypeEnumNew.getUpdateIconRes(v2XMsg.type)) + EventTypeEnumNew.getUpdateIconRes(v2XMsg.type)) ) } } diff --git a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/deva/report/ReportEntity.kt b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/deva/report/ReportEntity.kt index e36cd0d400..189da6ab83 100644 --- a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/deva/report/ReportEntity.kt +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/deva/report/ReportEntity.kt @@ -7,7 +7,7 @@ import java.io.Serializable * @description 工控机上报实例 * @since: 2022/4/13 */ -data class ReportEntity( +class ReportEntity( var time: String,//上报时间 var src: String,//消息来源 var level: String,//消息等级 error info @@ -17,6 +17,7 @@ data class ReportEntity( var actionsList: List,//试验性字段。消息发出者希望触发的动作,例如:触发短信报警,自动创建工单,要求pad弹框等 // var sec: Int,//秒 // var nsec: Int//纳秒 sec和nsec拼接起来是消息发送事件 + var isShow: Boolean ): Serializable { } \ No newline at end of file From 01d90428870af03452a997afe00b82174f8e9493 Mon Sep 17 00:00:00 2001 From: renwj Date: Wed, 8 Mar 2023 19:52:11 +0800 Subject: [PATCH 3/9] =?UTF-8?q?[dev=5Farch=5Fopt=5F3.0]=20=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3=E4=BA=91=E9=80=9A=E8=AF=9D=E7=AA=97=E5=8F=A3=E8=A2=AB?= =?UTF-8?q?=E9=81=AE=E6=8C=A1=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...hatting_launcher_calling_hawk_eye_view.xml | 2 - .../eagle/core/function/main/MainActivity.kt | 41 ++++++++++++++----- .../res/layout/module_main_activity_main.xml | 18 ++------ 3 files changed, 33 insertions(+), 28 deletions(-) diff --git a/core/function-impl/mogo-core-function-chat/src/main/res/layout/module_car_chatting_launcher_calling_hawk_eye_view.xml b/core/function-impl/mogo-core-function-chat/src/main/res/layout/module_car_chatting_launcher_calling_hawk_eye_view.xml index 13272210f3..311f50e690 100644 --- a/core/function-impl/mogo-core-function-chat/src/main/res/layout/module_car_chatting_launcher_calling_hawk_eye_view.xml +++ b/core/function-impl/mogo-core-function-chat/src/main/res/layout/module_car_chatting_launcher_calling_hawk_eye_view.xml @@ -13,7 +13,6 @@ android:id="@+id/module_carchatting_call_head" android:layout_width="@dimen/module_call_chat_calling_iv_hawk_eye_width_height" android:layout_height="@dimen/module_call_chat_calling_iv_hawk_eye_width_height" - android:scaleType="centerInside" android:src="@mipmap/module_carchatting_hawk_eye_default_head_img" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintStart_toStartOf="parent" @@ -25,7 +24,6 @@ android:layout_width="@dimen/module_call_chat_hawk_eye_circle_btn_size" android:layout_height="@dimen/module_call_chat_hawk_eye_circle_btn_size" android:layout_marginEnd="@dimen/module_call_chat_calling_iv_hawk_eye_margin_left_right" - android:scaleType="centerInside" android:src="@mipmap/module_carchatting_launcher_calling_hangup" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainActivity.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainActivity.kt index c7d20aea1f..c0ace51269 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainActivity.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainActivity.kt @@ -73,10 +73,10 @@ open class MainActivity : MvpActivity(), MainView, } override fun initViews() { + injectFloatView() injectStatusBar() window.setBackgroundDrawable(null) initConnectInfoRV() - FloatingViewHandler.init(module_main_id_floating_view) CallerHmiManager.init(this) //申请悬浮窗权限 @@ -90,23 +90,42 @@ open class MainActivity : MvpActivity(), MainView, } private fun injectStatusBar() { - val decorView = this.window.decorView as FrameLayout + val decorView = this.window.decorView as? FrameLayout ?: return val contentView = - (decorView.findViewById(android.R.id.content) as ViewGroup).getChildAt(0) + (decorView.findViewById(android.R.id.content) as? ViewGroup)?.getChildAt(0) ?: return contentView.fitsSystemWindows = false decorView.clipToPadding = false var statusBarView = decorView.findViewWithTag("status_bar") if (statusBarView == null) { statusBarView = statusBar - statusBarView.setTag("status_bar") + statusBarView.tag = "status_bar" + val params = FrameLayout.LayoutParams( + ViewGroup.LayoutParams.MATCH_PARENT, + ViewGroup.LayoutParams.WRAP_CONTENT, + ) + params.topMargin = 0 + params.gravity = Gravity.TOP + decorView.addView(statusBarView, params) + } + } + + private fun injectFloatView() { + val decorView = this.window.decorView as? FrameLayout ?: return + val contentView = + (decorView.findViewById(android.R.id.content) as? ViewGroup)?.getChildAt(0) ?: return + contentView.fitsSystemWindows = false + decorView.clipToPadding = false + var floatContainer = decorView.findViewWithTag("float_container") + if (floatContainer == null) { + floatContainer = FrameLayout(this) + floatContainer.tag = "float_container" + FloatingViewHandler.init(floatContainer) + val params = FrameLayout.LayoutParams( + ViewGroup.LayoutParams.MATCH_PARENT, + ViewGroup.LayoutParams.MATCH_PARENT, + ) + decorView.addView(floatContainer, params) } - val statusBarLP = FrameLayout.LayoutParams( - ViewGroup.LayoutParams.MATCH_PARENT, - ViewGroup.LayoutParams.WRAP_CONTENT, - ) - statusBarLP.topMargin = 0 - statusBarLP.gravity = Gravity.TOP - decorView.addView(statusBarView, statusBarLP) } /** diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/module_main_activity_main.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/module_main_activity_main.xml index 96184c4e54..0b1e1b60cd 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/module_main_activity_main.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/module_main_activity_main.xml @@ -6,23 +6,11 @@ android:background="@drawable/main_splash_bg" android:orientation="vertical"> + - - - - - - - - + android:layout_height="match_parent" /> Date: Wed, 8 Mar 2023 20:08:09 +0800 Subject: [PATCH 4/9] =?UTF-8?q?[opt-3.0]fix=E6=B6=88=E6=81=AF=E7=9B=92?= =?UTF-8?q?=E5=AD=90=E6=B0=94=E6=B3=A1=E6=B6=88=E6=81=AF=E5=81=B6=E7=8E=B0?= =?UTF-8?q?=E6=9C=AA=E5=8F=8A=E6=97=B6=E6=B6=88=E9=99=A4Bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hmi/ui/msgbox/DriverMsgBoxBubbleView.kt | 6 ++- .../function/hmi/ui/msgbox/MBoxBubbleView.kt | 6 ++- .../hmi/ui/msgbox/MMsgBoxBubbleView.kt | 31 +++++------ .../ui/msgbox/PassengerMsgBoxBubbleView.kt | 6 ++- .../adapter/DriverMsgBoxBubbleAdapter.kt | 53 +++++++++---------- .../ui/msgbox/adapter/MBoxBubbleAdapter.kt | 23 ++++---- .../ui/msgbox/adapter/MMsgBoxBubbleAdapter.kt | 35 ++++++------ .../adapter/PassengerMsgBoxBubbleAdapter.kt | 30 +++++------ .../hmi/ui/tools/AutoPilotAndCheckView.kt | 24 ++++++++- .../core/data/msgbox/MsgBoxCountDownBean.kt | 7 +++ 10 files changed, 122 insertions(+), 99 deletions(-) create mode 100644 core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/msgbox/MsgBoxCountDownBean.kt diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/DriverMsgBoxBubbleView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/DriverMsgBoxBubbleView.kt index dc08cb75f7..0bf5097f02 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/DriverMsgBoxBubbleView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/DriverMsgBoxBubbleView.kt @@ -9,6 +9,7 @@ import androidx.constraintlayout.widget.ConstraintLayout import androidx.recyclerview.widget.LinearLayoutManager import com.mogo.eagle.core.data.config.FunctionBuildConfig import com.mogo.eagle.core.data.msgbox.MsgBoxBean +import com.mogo.eagle.core.data.msgbox.MsgBoxCountDownBean import com.mogo.eagle.core.data.msgbox.MsgCategory import com.mogo.eagle.core.function.api.datacenter.msgbox.IMsgBoxListener import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager @@ -39,7 +40,7 @@ class DriverMsgBoxBubbleView @JvmOverloads constructor( var driverMsgBoxBubbleAdapter: DriverMsgBoxBubbleAdapter ?=null private val TAG = "DriverMsgBoxBubbleView" - private val dataList :ArrayList = ArrayList() + private val dataList :ArrayList = ArrayList() private var isShowData = true private fun initView() { @@ -92,7 +93,8 @@ class DriverMsgBoxBubbleView @JvmOverloads constructor( //todo 过滤MAP系统异常报警 } else{ clMsgBubbleLayout.visibility = View.VISIBLE - dataList.add(msgBoxBean) + val msgBoxCountDownBean = MsgBoxCountDownBean(msgBoxBean) + dataList.add(msgBoxCountDownBean) driverMsgBoxBubbleAdapter?.setData(dataList) } } diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/MBoxBubbleView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/MBoxBubbleView.kt index 30ff6c7f23..17151d727e 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/MBoxBubbleView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/MBoxBubbleView.kt @@ -7,6 +7,7 @@ import android.view.LayoutInflater import androidx.constraintlayout.widget.ConstraintLayout import androidx.recyclerview.widget.LinearLayoutManager import com.mogo.eagle.core.data.msgbox.MsgBoxBean +import com.mogo.eagle.core.data.msgbox.MsgBoxCountDownBean import com.mogo.eagle.core.data.msgbox.MsgBoxType import com.mogo.eagle.core.data.msgbox.MsgCategory import com.mogo.eagle.core.function.api.datacenter.msgbox.IMsgBoxListener @@ -25,7 +26,7 @@ class MBoxBubbleView @JvmOverloads constructor( ) : ConstraintLayout(context, attrs, defStyleAttr), IMsgBoxListener { private val TAG = "PassengerMsgBoxBubbleView" - private val dataList :ArrayList = ArrayList() + private val dataList :ArrayList = ArrayList() private var mBoxBubbleAdapter: MBoxBubbleAdapter?= null private var isShowData = true @@ -58,7 +59,8 @@ class MBoxBubbleView @JvmOverloads constructor( MsgBoxConfig.noticeList.add(msgBoxList) if(isShowData){ CallerMsgBoxEventListenerManager.invokeUpdateTipListener(true) - dataList.add(msgBoxList) + val msgBoxCountDownBean = MsgBoxCountDownBean(msgBoxList) + dataList.add(msgBoxCountDownBean) mBoxBubbleAdapter?.setData(dataList) } } diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/MMsgBoxBubbleView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/MMsgBoxBubbleView.kt index 78f9002e4a..e382698b28 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/MMsgBoxBubbleView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/MMsgBoxBubbleView.kt @@ -6,10 +6,7 @@ import android.util.AttributeSet import android.view.LayoutInflater import androidx.constraintlayout.widget.ConstraintLayout import androidx.recyclerview.widget.LinearLayoutManager -import com.mogo.eagle.core.data.msgbox.MsgBoxBean -import com.mogo.eagle.core.data.msgbox.MsgBoxType -import com.mogo.eagle.core.data.msgbox.MsgCategory -import com.mogo.eagle.core.data.msgbox.OperationMsg +import com.mogo.eagle.core.data.msgbox.* import com.mogo.eagle.core.function.api.datacenter.msgbox.IMsgBoxListener import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxEventListenerManager import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxListenerManager @@ -26,7 +23,7 @@ class MMsgBoxBubbleView @JvmOverloads constructor( ) : ConstraintLayout(context, attrs, defStyleAttr), IMsgBoxListener { private val TAG = "MMsgBoxBubbleView" - private val dataList :ArrayList = ArrayList() + private val dataList :ArrayList = ArrayList() private var mMsgBoxBubbleAdapter: MMsgBoxBubbleAdapter?= null private var isShowData = true @@ -56,27 +53,27 @@ class MMsgBoxBubbleView @JvmOverloads constructor( if(category == MsgCategory.NOTICE){ if(msgBoxList.type == MsgBoxType.NOTICE || msgBoxList.type == MsgBoxType.V2X || msgBoxList.type == MsgBoxType.OBU){ - MsgBoxConfig.noticeList.add(msgBoxList) - if(isShowData){ - CallerMsgBoxEventListenerManager.invokeUpdateTipListener(true) - dataList.add(msgBoxList) - mMsgBoxBubbleAdapter?.setData(dataList) - } + update(msgBoxList) } if(msgBoxList.type == MsgBoxType.OPERATION){ if((msgBoxList.bean as OperationMsg).type == 2){ - MsgBoxConfig.noticeList.add(msgBoxList) - if(isShowData){ - CallerMsgBoxEventListenerManager.invokeUpdateTipListener(true) - dataList.add(msgBoxList) - mMsgBoxBubbleAdapter?.setData(dataList) - } + update(msgBoxList) } } } } } + private fun update(msgBoxList: MsgBoxBean){ + MsgBoxConfig.noticeList.add(msgBoxList) + if(isShowData){ + CallerMsgBoxEventListenerManager.invokeUpdateTipListener(true) + val msgBoxCountDownBean = MsgBoxCountDownBean(msgBoxList) + dataList.add(msgBoxCountDownBean) + mMsgBoxBubbleAdapter?.setData(dataList) + } + } + override fun onAttachedToWindow() { super.onAttachedToWindow() CallerMsgBoxListenerManager.addListener(TAG,this) diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/PassengerMsgBoxBubbleView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/PassengerMsgBoxBubbleView.kt index 0112f09266..0ed1eb0622 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/PassengerMsgBoxBubbleView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/PassengerMsgBoxBubbleView.kt @@ -7,6 +7,7 @@ import android.view.* import androidx.constraintlayout.widget.ConstraintLayout import androidx.recyclerview.widget.LinearLayoutManager import com.mogo.eagle.core.data.msgbox.MsgBoxBean +import com.mogo.eagle.core.data.msgbox.MsgBoxCountDownBean import com.mogo.eagle.core.data.msgbox.MsgBoxType import com.mogo.eagle.core.data.msgbox.MsgCategory import com.mogo.eagle.core.function.api.datacenter.msgbox.IMsgBoxListener @@ -30,7 +31,7 @@ class PassengerMsgBoxBubbleView @JvmOverloads constructor( ) : ConstraintLayout(context, attrs, defStyleAttr), IMsgBoxListener { private val TAG = "PassengerMsgBoxBubbleView" - private val dataList :ArrayList = ArrayList() + private val dataList :ArrayList = ArrayList() private var passengerMsgBoxBubbleAdapter: PassengerMsgBoxBubbleAdapter ?= null private var isShowData = true @@ -63,7 +64,8 @@ class PassengerMsgBoxBubbleView @JvmOverloads constructor( MsgBoxConfig.noticeList.add(msgBoxList) if(isShowData){ CallerMsgBoxEventListenerManager.invokeUpdateTipListener(true) - dataList.add(msgBoxList) + val msgBoxCountDownBean = MsgBoxCountDownBean(msgBoxList) + dataList.add(msgBoxCountDownBean) passengerMsgBoxBubbleAdapter?.setData(dataList) } } diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/DriverMsgBoxBubbleAdapter.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/DriverMsgBoxBubbleAdapter.kt index 754c9a91a3..466e5bf5a6 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/DriverMsgBoxBubbleAdapter.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/DriverMsgBoxBubbleAdapter.kt @@ -30,7 +30,7 @@ import com.mogo.eagle.core.widget.RoundCanClickConstraintLayout */ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.Adapter(){ - private var data: ArrayList ?= null + private var data: ArrayList ?= null private val operation: Int = 1 private val operationReturn: Int = 10 @@ -40,10 +40,9 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A private val report: Int = 4 private val summary: Int = 5 - var countDownTimer: CountDownTimer?=null private var changeViewListener: ChangeViewListener?=null - fun setData(data: ArrayList){ + fun setData(data: ArrayList){ this.data = data if(data.size>4){ data.removeAt(0) @@ -90,9 +89,9 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A when (holder) { is BubbleOperationHolder -> { data?.let { - val msgBoxBean = it[position] + val msgBoxBean = it[position].msgBoxBean val operationMsg = msgBoxBean.bean as OperationMsg - holder.tvBubbleOperationTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat()) + holder.tvBubbleOperationTime.text = TimeUtils.millis2String(it[position].msgBoxBean.timestamp,getHourMinFormat()) holder.tvBubbleOperationContent.text = operationMsg.content holder.clBubbleOperationLayout.setOnClickListener { CallerMsgBoxEventListenerManager.invokeBubbleOperationListener(msgBoxBean) @@ -102,7 +101,7 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A //运营平台还车通知 is BubbleOperationReturnHolder -> { data?.let { - val operationReturnMsg = it[position].bean as OperationMsg + val operationReturnMsg = it[position].msgBoxBean.bean as OperationMsg holder.tvOperationReturnContent.text = operationReturnMsg.content holder.tvOperationReturnTime.text = TimeUtils.millis2String(operationReturnMsg.timestamp, getHourMinFormat()) @@ -111,17 +110,17 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A //运营平台靠边停车 is BubbleOperationStopHolder -> { data?.let { - val operationStopMsg = it[position].bean as OperationMsg + val operationStopMsg = it[position].msgBoxBean.bean as OperationMsg holder.tvOperationStopTime.text = TimeUtils.millis2String(operationStopMsg.timestamp, getHourMinFormat()) } } is BubbleReportHolder -> { data?.let { - val msgBoxBean = it[position] + val msgBoxBean = it[position].msgBoxBean val reportEntity = msgBoxBean.bean as ReportEntity - holder.tvBubbleReportTime.text = "时间:${TimeUtils.millis2String(it[position].timestamp)}" - holder.tvBubbleReceiveTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat()) + holder.tvBubbleReportTime.text = "时间:${TimeUtils.millis2String(it[position].msgBoxBean.timestamp)}" + holder.tvBubbleReceiveTime.text = TimeUtils.millis2String(it[position].msgBoxBean.timestamp,getHourMinFormat()) var resultStr = "类型:" for (result in reportEntity.resultList){ resultStr = "${resultStr}${CallerAutoPilotControlManager.getReportResultDesc(result)}" @@ -134,11 +133,11 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A } is BubbleNoticeHolder -> { data?.let { - val msgBoxBean = it[position].bean + val msgBoxBean = it[position].msgBoxBean.bean val noticeFrCloudMsg = msgBoxBean as NoticeFrCloudMsg if(noticeFrCloudMsg.type == 0){ val noticeNormalData = noticeFrCloudMsg.noticeNormalData - holder.tvNoticeTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat()) + holder.tvNoticeTime.text = TimeUtils.millis2String(it[position].msgBoxBean.timestamp,getHourMinFormat()) holder.tvNoticeContent.text = noticeNormalData?.content GlideApp.with(activity).load(noticeNormalData?.imageUrl).optionalTransform( GlideRoundedCornersTransform( @@ -154,7 +153,7 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A } }else if(noticeFrCloudMsg.type == 1){ val noticeTrafficStylePushData = noticeFrCloudMsg.trafficPushData - holder.tvNoticeTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat()) + holder.tvNoticeTime.text = TimeUtils.millis2String(it[position].msgBoxBean.timestamp,getHourMinFormat()) holder.tvNoticeContent.text = noticeTrafficStylePushData?.content GlideApp.with(activity).load(noticeTrafficStylePushData?.poiImgUrl).optionalTransform( GlideRoundedCornersTransform( @@ -173,9 +172,9 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A } is BubbleV2XHolder -> { data?.let { - val msgBoxBean = it[position] + val msgBoxBean = it[position].msgBoxBean val v2XMsg = msgBoxBean.bean as V2XMsg - holder.tvV2XTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat()) + holder.tvV2XTime.text = TimeUtils.millis2String(it[position].msgBoxBean.timestamp,getHourMinFormat()) holder.tvV2XContent.text = v2XMsg.content holder.ivV2XImage.setImageDrawable(activity.resources.getDrawable( EventTypeEnumNew.getUpdateIconRes(v2XMsg.type))) @@ -186,15 +185,15 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A } is BubbleSummaryHolder -> { data?.let { - val summaryMsg = it[position].bean as V2XMsg - holder.tvSummaryTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat()) + val summaryMsg = it[position].msgBoxBean.bean as V2XMsg + holder.tvSummaryTime.text = TimeUtils.millis2String(it[position].msgBoxBean.timestamp,getHourMinFormat()) holder.tvSummaryContent.text = summaryMsg.content } } } - val msgBoxBean: MsgBoxBean = data!![position] - countDownTimer =object: CountDownTimer(CallerMsgBoxManager.getDismissTime(),1000){ + val msgBoxBean: MsgBoxCountDownBean = data!![position] + msgBoxBean.countDownTimer =object: CountDownTimer(CallerMsgBoxManager.getDismissTime(),1000){ override fun onTick(p0: Long) { } @@ -203,34 +202,32 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A data?.remove(msgBoxBean) changeViewListener?.notifyView() notifyDataSetChanged() -// notifyItemRemoved(index) -// notifyItemRangeChanged(index,recordTypeEntity.size-index) } } - countDownTimer?.start() + msgBoxBean.countDownTimer?.start() } override fun getItemCount() = data?.size ?: 0 override fun getItemViewType(position: Int): Int { - return if(data!![position].type == MsgBoxType.OPERATION){ - if((data!![position].bean as OperationMsg).type == 0){ + return if(data!![position].msgBoxBean.type == MsgBoxType.OPERATION){ + if((data!![position].msgBoxBean.bean as OperationMsg).type == 0){ //运营平台还车通知 operationReturn - }else if((data!![position].bean as OperationMsg).type == 1){ + }else if((data!![position].msgBoxBean.bean as OperationMsg).type == 1){ //运营平台靠边停车 operationStop }else{ //普通运营平台 operation } - }else if(data!![position].type == MsgBoxType.REPORT){ + }else if(data!![position].msgBoxBean.type == MsgBoxType.REPORT){ report - }else if(data!![position].type == MsgBoxType.NOTICE){ + }else if(data!![position].msgBoxBean.type == MsgBoxType.NOTICE){ notice - }else if(data!![position].type == MsgBoxType.V2X && data!![position].sourceType == DataSourceType.SUMMARY){ + }else if(data!![position].msgBoxBean.type == MsgBoxType.V2X && data!![position].msgBoxBean.sourceType == DataSourceType.SUMMARY){ summary } else{ v2x diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/MBoxBubbleAdapter.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/MBoxBubbleAdapter.kt index 343289ebcd..c95913d7e7 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/MBoxBubbleAdapter.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/MBoxBubbleAdapter.kt @@ -17,14 +17,13 @@ import com.mogo.eagle.core.utilcode.util.TimeUtils.getHourMinFormat class MBoxBubbleAdapter(private val activity: Activity): RecyclerView.Adapter(){ - private var data: ArrayList ?= null + private var data: ArrayList ?= null private val notice: Int = 1 private val v2x: Int = 2 - var countDownTimer: CountDownTimer?=null - fun setData(data: ArrayList){ + fun setData(data: ArrayList){ this.data = data if(data.size>3){ data.removeAt(0) @@ -49,14 +48,14 @@ class MBoxBubbleAdapter(private val activity: Activity): RecyclerView.Adapter { data?.let { - val noticeFrCloudMsg = it[position].bean as NoticeFrCloudMsg + val noticeFrCloudMsg = it[position].msgBoxBean.bean as NoticeFrCloudMsg if(noticeFrCloudMsg.type == 0){ val noticeNormalData = noticeFrCloudMsg.noticeNormalData - holder.tvMNoticeTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat()) + holder.tvMNoticeTime.text = TimeUtils.millis2String(it[position].msgBoxBean.timestamp,getHourMinFormat()) holder.tvMNoticeContent.text = noticeNormalData?.content }else { val noticeTrafficStylePushData = noticeFrCloudMsg.trafficPushData - holder.tvMNoticeTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat()) + holder.tvMNoticeTime.text = TimeUtils.millis2String(it[position].msgBoxBean.timestamp,getHourMinFormat()) holder.tvMNoticeContent.text = noticeTrafficStylePushData?.content } @@ -65,8 +64,8 @@ class MBoxBubbleAdapter(private val activity: Activity): RecyclerView.Adapter { data?.let { val msgBoxBean = it[position] - val v2XMsg = msgBoxBean.bean as V2XMsg - holder.tvMV2XTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat()) + val v2XMsg = msgBoxBean.msgBoxBean.bean as V2XMsg + holder.tvMV2XTime.text = TimeUtils.millis2String(it[position].msgBoxBean.timestamp,getHourMinFormat()) holder.tvMV2XContent.text = v2XMsg.content holder.ivMV2XImage.setImageDrawable(activity.resources.getDrawable( EventTypeEnumNew.getUpdateIconRes(v2XMsg.type))) @@ -74,8 +73,8 @@ class MBoxBubbleAdapter(private val activity: Activity): RecyclerView.Adapter() { - private var data: ArrayList ?= null + private var data: ArrayList ?= null private val notice: Int = 1 private val v2x: Int = 2 private val summary: Int = 3 private val operation: Int = 4 - var countDownTimer: CountDownTimer?=null - fun setData(data: ArrayList){ + fun setData(data: ArrayList){ this.data = data if(data.size>3){ data.removeAt(0) @@ -65,10 +64,10 @@ class MMsgBoxBubbleAdapter(private val activity: Activity): RecyclerView.Adapter when (holder) { is BubbleNoticeHolder -> { data?.let { - val noticeFrCloudMsg = it[position].bean as NoticeFrCloudMsg + val noticeFrCloudMsg = it[position].msgBoxBean.bean as NoticeFrCloudMsg if(noticeFrCloudMsg.type == 0){ val noticeNormalData = noticeFrCloudMsg.noticeNormalData - holder.tvMNoticeTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat()) + holder.tvMNoticeTime.text = TimeUtils.millis2String(it[position].msgBoxBean.timestamp,getHourMinFormat()) holder.tvMNoticeContent.text = noticeNormalData?.content GlideApp.with(activity).load(noticeNormalData?.imageUrl).placeholder(R.drawable.icon_passenger_operation) .optionalTransform( @@ -83,7 +82,7 @@ class MMsgBoxBubbleAdapter(private val activity: Activity): RecyclerView.Adapter } }else if(noticeFrCloudMsg.type == 1){ val noticeTrafficStylePushData = noticeFrCloudMsg.trafficPushData - holder.tvMNoticeTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat()) + holder.tvMNoticeTime.text = TimeUtils.millis2String(it[position].msgBoxBean.timestamp,getHourMinFormat()) holder.tvMNoticeContent.text = noticeTrafficStylePushData?.content GlideApp.with(activity).load(noticeTrafficStylePushData?.poiImgUrl).placeholder(R.drawable.icon_passenger_operation) .optionalTransform( @@ -102,9 +101,9 @@ class MMsgBoxBubbleAdapter(private val activity: Activity): RecyclerView.Adapter } is BubbleV2XHolder -> { data?.let { - val msgBoxBean = it[position] + val msgBoxBean = it[position].msgBoxBean val v2XMsg = msgBoxBean.bean as V2XMsg - holder.tvMV2XTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat()) + holder.tvMV2XTime.text = TimeUtils.millis2String(it[position].msgBoxBean.timestamp,getHourMinFormat()) holder.tvMV2XContent.text = v2XMsg.content holder.ivMV2XImage.setImageDrawable(activity.resources.getDrawable( EventTypeEnumNew.getUpdateIconRes(v2XMsg.type))) @@ -115,8 +114,8 @@ class MMsgBoxBubbleAdapter(private val activity: Activity): RecyclerView.Adapter } is BubbleSummaryHolder -> { data?.let { - val summaryMsg= it[position].bean as V2XMsg - holder.tvMSummaryTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat()) + val summaryMsg= it[position].msgBoxBean.bean as V2XMsg + holder.tvMSummaryTime.text = TimeUtils.millis2String(it[position].msgBoxBean.timestamp,getHourMinFormat()) holder.tvMSummaryContent.text = summaryMsg.content holder.tvMSummaryCheck.setOnClickListener { //跳转全览模式 @@ -127,15 +126,15 @@ class MMsgBoxBubbleAdapter(private val activity: Activity): RecyclerView.Adapter } is BubbleOperationHolder ->{ data?.let { - val operationMsg = it[position].bean as OperationMsg - holder.tvMOperationTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat()) + val operationMsg = it[position].msgBoxBean.bean as OperationMsg + holder.tvMOperationTime.text = TimeUtils.millis2String(it[position].msgBoxBean.timestamp,getHourMinFormat()) holder.tvMOperationContent.text = operationMsg.content } } } - val msgBoxBean: MsgBoxBean = data!![position] - countDownTimer =object: CountDownTimer(CallerMsgBoxManager.getDismissTime(),1000){ + val msgBoxBean: MsgBoxCountDownBean = data!![position] + msgBoxBean.countDownTimer =object: CountDownTimer(CallerMsgBoxManager.getDismissTime(),1000){ override fun onTick(p0: Long) { } @@ -148,17 +147,17 @@ class MMsgBoxBubbleAdapter(private val activity: Activity): RecyclerView.Adapter } } - countDownTimer?.start() + msgBoxBean.countDownTimer?.start() } override fun getItemCount() = data?.size ?: 0 override fun getItemViewType(position: Int): Int { - return if(data!![position].type == MsgBoxType.NOTICE){ + return if(data!![position].msgBoxBean.type == MsgBoxType.NOTICE){ notice - }else if(data!![position].type == MsgBoxType.V2X && data!![position].sourceType == DataSourceType.SUMMARY){ + }else if(data!![position].msgBoxBean.type == MsgBoxType.V2X && data!![position].msgBoxBean.sourceType == DataSourceType.SUMMARY){ summary - }else if(data!![position].type == MsgBoxType.OPERATION){ + }else if(data!![position].msgBoxBean.type == MsgBoxType.OPERATION){ operation } else{ v2x 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 01c8b24ae1..5b5aca0a98 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 @@ -28,15 +28,13 @@ import com.mogo.eagle.core.widget.RoundCanClickConstraintLayout */ class PassengerMsgBoxBubbleAdapter(private val activity: Activity): RecyclerView.Adapter() { - private var data: ArrayList ?= null + private var data: ArrayList ?= null private val notice: Int = 1 private val v2x: Int = 2 private val summary: Int = 3 - var countDownTimer: CountDownTimer?=null - - fun setData(data: ArrayList){ + fun setData(data: ArrayList){ this.data = data if(data.size>3){ data.removeAt(0) @@ -65,10 +63,10 @@ class PassengerMsgBoxBubbleAdapter(private val activity: Activity): RecyclerView when (holder) { is BubbleNoticeHolder -> { data?.let { - val noticeFrCloudMsg = it[position].bean as NoticeFrCloudMsg + val noticeFrCloudMsg = it[position].msgBoxBean.bean as NoticeFrCloudMsg if(noticeFrCloudMsg.type == 0){ val noticeNormalData = noticeFrCloudMsg.noticeNormalData - holder.tvPassengerNoticeTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat()) + holder.tvPassengerNoticeTime.text = TimeUtils.millis2String(it[position].msgBoxBean.timestamp,getHourMinFormat()) holder.tvPassengerNoticeContent.text = noticeNormalData?.content GlideApp.with(activity).load(noticeNormalData?.imageUrl).optionalTransform( GlideRoundedCornersTransform( @@ -82,7 +80,7 @@ class PassengerMsgBoxBubbleAdapter(private val activity: Activity): RecyclerView } }else if(noticeFrCloudMsg.type == 1){ val noticeTrafficStylePushData = noticeFrCloudMsg.trafficPushData - holder.tvPassengerNoticeTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat()) + holder.tvPassengerNoticeTime.text = TimeUtils.millis2String(it[position].msgBoxBean.timestamp,getHourMinFormat()) holder.tvPassengerNoticeContent.text = noticeTrafficStylePushData?.content GlideApp.with(activity).load(noticeTrafficStylePushData?.poiImgUrl).optionalTransform( GlideRoundedCornersTransform( @@ -100,9 +98,9 @@ class PassengerMsgBoxBubbleAdapter(private val activity: Activity): RecyclerView } is BubbleV2XHolder -> { data?.let { - val msgBoxBean = it[position] + val msgBoxBean = it[position].msgBoxBean val v2XMsg = msgBoxBean.bean as V2XMsg - holder.tvPassengerV2XTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat()) + holder.tvPassengerV2XTime.text = TimeUtils.millis2String(it[position].msgBoxBean.timestamp,getHourMinFormat()) holder.tvPassengerV2XContent.text = v2XMsg.content holder.ivPassengerV2XImage.setImageDrawable(activity.resources.getDrawable( EventTypeEnumNew.getUpdateIconRes(v2XMsg.type))) @@ -113,8 +111,8 @@ class PassengerMsgBoxBubbleAdapter(private val activity: Activity): RecyclerView } is BubbleSummaryHolder -> { data?.let { - val summaryMsg= it[position].bean as V2XMsg - holder.tvPassengerSummaryTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat()) + val summaryMsg= it[position].msgBoxBean.bean as V2XMsg + holder.tvPassengerSummaryTime.text = TimeUtils.millis2String(it[position].msgBoxBean.timestamp,getHourMinFormat()) holder.tvPassengerSummaryContent.text = summaryMsg.content holder.tvPassengerSummaryCheck.setOnClickListener { //跳转全览模式 @@ -125,8 +123,8 @@ class PassengerMsgBoxBubbleAdapter(private val activity: Activity): RecyclerView } } - val msgBoxBean: MsgBoxBean = data!![position] - countDownTimer =object: CountDownTimer(CallerMsgBoxManager.getDismissTime(),1000){ + val msgBoxBean: MsgBoxCountDownBean = data!![position] + msgBoxBean.countDownTimer =object: CountDownTimer(CallerMsgBoxManager.getDismissTime(),1000){ override fun onTick(p0: Long) { } @@ -139,15 +137,15 @@ class PassengerMsgBoxBubbleAdapter(private val activity: Activity): RecyclerView } } - countDownTimer?.start() + msgBoxBean.countDownTimer?.start() } override fun getItemCount() = data?.size ?: 0 override fun getItemViewType(position: Int): Int { - return if(data!![position].type == MsgBoxType.NOTICE){ + return if(data!![position].msgBoxBean.type == MsgBoxType.NOTICE){ notice - }else if(data!![position].type == MsgBoxType.V2X && data!![position].sourceType == DataSourceType.SUMMARY){ + }else if(data!![position].msgBoxBean.type == MsgBoxType.V2X && data!![position].msgBoxBean.sourceType == DataSourceType.SUMMARY){ summary } else{ v2x 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 effcdf840c..a5a4a789a9 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 @@ -14,12 +14,17 @@ import com.mogo.commons.debug.DebugConfig import com.mogo.eagle.core.data.app.AppConfigInfo import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo import com.mogo.eagle.core.data.deva.bindingcar.IPCUpgradeStateInfo +import com.mogo.eagle.core.data.msgbox.MsgBoxBean +import com.mogo.eagle.core.data.msgbox.MsgBoxType +import com.mogo.eagle.core.data.msgbox.OperationMsg +import com.mogo.eagle.core.data.msgbox.V2XMsg import com.mogo.eagle.core.data.temp.EventLogout import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotCarConfigListener import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotCarConfigListenerManager +import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager import com.mogo.eagle.core.function.hmi.R import com.mogo.eagle.core.function.hmi.ui.utils.KeyBoardUtil import com.mogo.eagle.core.function.msgbox.MsgBoxConfig @@ -96,10 +101,25 @@ internal class AutoPilotAndCheckView @JvmOverloads constructor( clickListener?.onClose(it) } rlKillLayout.setOnClickListener { - killApp() +// killApp() + CallerMsgBoxManager.saveMsgBox( + MsgBoxBean( + MsgBoxType.V2X, + V2XMsg( + "1","测试V2X","" + ) + ) + ) } sopLayout.setOnClickListener { - clickListener?.showSOPSettingView() +// clickListener?.showSOPSettingView() + CallerMsgBoxManager.saveMsgBox( + MsgBoxBean( + MsgBoxType.OPERATION, + OperationMsg(System.currentTimeMillis(),"本次行程剩余5分钟,请知晓并通知乘客合理安排游玩时间") + ) + ) + } managerLayout.setOnClickListener { //录包管理页面 diff --git a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/msgbox/MsgBoxCountDownBean.kt b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/msgbox/MsgBoxCountDownBean.kt new file mode 100644 index 0000000000..a5fee017c9 --- /dev/null +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/msgbox/MsgBoxCountDownBean.kt @@ -0,0 +1,7 @@ +package com.mogo.eagle.core.data.msgbox + +import android.os.CountDownTimer + +class MsgBoxCountDownBean(val msgBoxBean: MsgBoxBean){ + var countDownTimer: CountDownTimer ?= null +} \ No newline at end of file From d1e2bf8022a5c32850d6403d2273e7b4bbd8bbde Mon Sep 17 00:00:00 2001 From: xuxinchao Date: Wed, 8 Mar 2023 20:11:41 +0800 Subject: [PATCH 5/9] =?UTF-8?q?[opt-3.0]=E5=8E=BB=E9=99=A4=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hmi/ui/tools/AutoPilotAndCheckView.kt | 24 ++----------------- 1 file changed, 2 insertions(+), 22 deletions(-) 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 a5a4a789a9..effcdf840c 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 @@ -14,17 +14,12 @@ import com.mogo.commons.debug.DebugConfig import com.mogo.eagle.core.data.app.AppConfigInfo import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo import com.mogo.eagle.core.data.deva.bindingcar.IPCUpgradeStateInfo -import com.mogo.eagle.core.data.msgbox.MsgBoxBean -import com.mogo.eagle.core.data.msgbox.MsgBoxType -import com.mogo.eagle.core.data.msgbox.OperationMsg -import com.mogo.eagle.core.data.msgbox.V2XMsg import com.mogo.eagle.core.data.temp.EventLogout import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotCarConfigListener import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotCarConfigListenerManager -import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager import com.mogo.eagle.core.function.hmi.R import com.mogo.eagle.core.function.hmi.ui.utils.KeyBoardUtil import com.mogo.eagle.core.function.msgbox.MsgBoxConfig @@ -101,25 +96,10 @@ internal class AutoPilotAndCheckView @JvmOverloads constructor( clickListener?.onClose(it) } rlKillLayout.setOnClickListener { -// killApp() - CallerMsgBoxManager.saveMsgBox( - MsgBoxBean( - MsgBoxType.V2X, - V2XMsg( - "1","测试V2X","" - ) - ) - ) + killApp() } sopLayout.setOnClickListener { -// clickListener?.showSOPSettingView() - CallerMsgBoxManager.saveMsgBox( - MsgBoxBean( - MsgBoxType.OPERATION, - OperationMsg(System.currentTimeMillis(),"本次行程剩余5分钟,请知晓并通知乘客合理安排游玩时间") - ) - ) - + clickListener?.showSOPSettingView() } managerLayout.setOnClickListener { //录包管理页面 From 06d64f5fe8166edb4911b41137d7aff053eb1ec4 Mon Sep 17 00:00:00 2001 From: xuxinchao Date: Thu, 9 Mar 2023 14:11:40 +0800 Subject: [PATCH 6/9] =?UTF-8?q?[m1]=E8=B0=83=E6=95=B4=E8=BF=90=E8=90=A5?= =?UTF-8?q?=E6=B6=88=E6=81=AF=E6=98=BE=E7=A4=BALogo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/res/layout/item_m_msg_box_operation.xml | 7 +++---- .../src/main/res/layout/item_m_msg_list_operation.xml | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_m_msg_box_operation.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_m_msg_box_operation.xml index d8d1747997..de8d8eae24 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_m_msg_box_operation.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_m_msg_box_operation.xml @@ -10,13 +10,12 @@ Date: Thu, 9 Mar 2023 16:04:40 +0800 Subject: [PATCH 7/9] [2.13.0-arch-opt] reset color of jiangshiche --- .../function/business/identify/TrackerSourceColorHelper.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/TrackerSourceColorHelper.kt b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/TrackerSourceColorHelper.kt index 13f0e013b1..b2400ffa9a 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/TrackerSourceColorHelper.kt +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/TrackerSourceColorHelper.kt @@ -65,10 +65,10 @@ object TrackerSourceColorHelper { //僵尸车 if(data.addAttribute == AdditionalAttribute.ATTR_ZOMBIE){ - color = "#AE7887FF" + color = "#AD7488FF" CallerMapUIServiceManager.getMapUIController()?.let { if(it.isDayMode){ - color = "#AD7488FF" + color = "#AE7887FF" } } } From 0349a4925a7a1a737a9950b74d13a01f763da263 Mon Sep 17 00:00:00 2001 From: chenfufeng Date: Thu, 9 Mar 2023 16:26:51 +0800 Subject: [PATCH 8/9] =?UTF-8?q?[Opt3.0]=E8=A7=A3=E5=86=B3=E4=B8=8B?= =?UTF-8?q?=E6=96=B0=E7=9A=84=E8=AE=A2=E5=8D=95=E5=AF=BC=E8=87=B4=E8=BD=A8?= =?UTF-8?q?=E8=BF=B9=E7=94=BB=E7=BA=BF=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/function/smp/MarkerDrawerManager.kt | 18 +++++++++--------- .../eagle/core/function/view/OverMapView.kt | 4 ++++ 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/MarkerDrawerManager.kt b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/MarkerDrawerManager.kt index 1c916ecbf7..1b8eb5302d 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/MarkerDrawerManager.kt +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/MarkerDrawerManager.kt @@ -22,9 +22,7 @@ object MarkerDrawerManager { fun onLocationChanged(planningPoints: List, locIndex: Int) } - private val routeWipeDisposable by lazy { - CompositeDisposable() - } + private var routeWipeDisposable: CompositeDisposable? = null // 自主画线的所有高德坐标系的轨迹点 val planningPoints by lazy { @@ -40,19 +38,22 @@ object MarkerDrawerManager { var callback: Callback? = null fun startLoopCalCarLocation() { + routeWipeDisposable = CompositeDisposable() getLoopCalCarObservable().delay(1000L, TimeUnit.MILLISECONDS, true) .subscribeOn(Schedulers.io()) .repeat() .retry() .observeOn(AndroidSchedulers.mainThread()) .subscribe().let { - routeWipeDisposable.add(it) + routeWipeDisposable?.add(it) } } fun stopLoopCalCarLocation() { - if (!routeWipeDisposable.isDisposed) { - routeWipeDisposable.dispose() + routeWipeDisposable?.let { + if (!it.isDisposed) { + it.dispose() + } } } @@ -103,7 +104,6 @@ object MarkerDrawerManager { var baseDiffDis = CoordinateUtils.calculateLineDistance( realLon, realLat, baseLatLng.longitude, baseLatLng.latitude ) // lon,lat, prelon, prelat -// val lastIndex = if (lastArrivedIndex >= 1 && lastArrivedIndex <= routePoints.size - 1) lastArrivedIndex else 1 for (i in 1 until routePoints.size) { val latLng = routePoints[i] val diff = CoordinateUtils.calculateLineDistance( @@ -111,8 +111,8 @@ object MarkerDrawerManager { ) if (baseDiffDis > diff) { baseDiffDis = diff - // 距离最近的时候判断是否走过 - if (DrivingDirectionUtils.getDegreeOfCar2Poi2(realLon, realLat, latLng.longitude, latLng.latitude, heading) >= 90) { + // 距离最近的时候判断是否走过,且车行驶是线性连续的1s不会跳点过多 + if (DrivingDirectionUtils.getDegreeOfCar2Poi2(realLon, realLat, latLng.longitude, latLng.latitude, heading) >= 90 && i - lastArrivedIndex < 3) { currentIndex = i } } diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/view/OverMapView.kt b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/view/OverMapView.kt index dd56a3045b..3cef39a6a1 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/view/OverMapView.kt +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/view/OverMapView.kt @@ -36,6 +36,7 @@ import com.mogo.eagle.core.function.smp.MakerWithCount import com.mogo.eagle.core.function.smp.MarkerDrawerManager import com.mogo.eagle.core.function.smp.MarkerDrawerManager.callback import com.mogo.eagle.core.function.smp.MarkerDrawerManager.coordinateConverterWgsToGcj +import com.mogo.eagle.core.function.smp.MarkerDrawerManager.lastArrivedIndex import com.mogo.eagle.core.function.smp.MarkerDrawerManager.lonLatHeading import com.mogo.eagle.core.function.smp.MarkerDrawerManager.planningPoints import com.mogo.eagle.core.function.smp.MarkerDrawerManager.startLoopCalCarLocation @@ -236,6 +237,9 @@ class OverMapView @JvmOverloads constructor( } mStartMarker?.isVisible = false mEndMarker?.isVisible = false + MarkerDrawerManager.stopLoopCalCarLocation() + planningPoints.clear() + lastArrivedIndex = -1 } @SuppressLint("UseCompatLoadingForDrawables") From bebcddee310ec0b29d2709e6ecc1caab1e2ae244 Mon Sep 17 00:00:00 2001 From: chenfufeng Date: Thu, 9 Mar 2023 16:27:11 +0800 Subject: [PATCH 9/9] =?UTF-8?q?[Opt3.0]=E5=86=85=E9=83=A8=E5=B0=81?= =?UTF-8?q?=E8=A3=85TTS=E5=9C=A8=E4=B8=BB=E7=BA=BF=E7=A8=8B=E4=B8=AD?= =?UTF-8?q?=E8=B0=83=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/mogo/tts/iflytek/IFlyTekTts.kt | 47 ++++++++++++++++--- 1 file changed, 41 insertions(+), 6 deletions(-) diff --git a/tts/tts-iflytek/src/main/java/com/mogo/tts/iflytek/IFlyTekTts.kt b/tts/tts-iflytek/src/main/java/com/mogo/tts/iflytek/IFlyTekTts.kt index f0752af30c..4dab0363b9 100644 --- a/tts/tts-iflytek/src/main/java/com/mogo/tts/iflytek/IFlyTekTts.kt +++ b/tts/tts-iflytek/src/main/java/com/mogo/tts/iflytek/IFlyTekTts.kt @@ -68,8 +68,15 @@ class IFlyTekTts : IMogoTTS, InitListener { } override fun release() { - ttsEngine?.stopSpeaking() - ttsEngine?.destroy() + if (Thread.currentThread() != Looper.getMainLooper().thread) { + UiThreadHandler.post { + ttsEngine?.stopSpeaking() + ttsEngine?.destroy() + } + } else { + ttsEngine?.stopSpeaking() + ttsEngine?.destroy() + } } override fun flush() { @@ -91,7 +98,16 @@ class IFlyTekTts : IMogoTTS, InitListener { override fun speakTTSVoiceWithLevel(tts: String?, level: Int, callBack: IMogoTTSCallback?) { if (tts.isNullOrEmpty()) return - speakMultiLangTTSWithLevel(MultiLangTtsEntity(listOf(LangTtsEntity(tts, LanguageType.CHINESE))), level, callBack) + speakMultiLangTTSWithLevel( + MultiLangTtsEntity( + listOf( + LangTtsEntity( + tts, + LanguageType.CHINESE + ) + ) + ), level, callBack + ) } override fun speakMultiLangTTSWithLevel( @@ -99,10 +115,19 @@ class IFlyTekTts : IMogoTTS, InitListener { level: Int, callBack: IMogoTTSCallback? ) { - if (callBack != null) { - speakVoiceMap[ttsEntity.toString()] = callBack + if (Thread.currentThread() != Looper.getMainLooper().thread) { + UiThreadHandler.post { + if (callBack != null) { + speakVoiceMap[ttsEntity.toString()] = callBack + } + speakMultiLangTTSWithLevel(ttsEntity, level) + } + } else { + if (callBack != null) { + speakVoiceMap[ttsEntity.toString()] = callBack + } + speakMultiLangTTSWithLevel(ttsEntity, level) } - speakMultiLangTTSWithLevel(ttsEntity, level) } override fun stopSpeakTts(text: String?) { @@ -110,6 +135,16 @@ class IFlyTekTts : IMogoTTS, InitListener { } override fun stopTts() { + if (Thread.currentThread() != Looper.getMainLooper().thread) { + UiThreadHandler.post { + realStop() + } + } else { + realStop() + } + } + + private fun realStop() { curTtsEntity?.let { val string = it.toString() if (speakVoiceMap.containsKey(string)) {