From 03060239c726fd20e22cb6383b348394b669b097 Mon Sep 17 00:00:00 2001 From: xuxinchao Date: Wed, 8 Nov 2023 18:40:33 +0800 Subject: [PATCH 1/2] =?UTF-8?q?[6.2.0]Taxi=E4=B9=98=E5=AE=A2=E7=AB=AF?= =?UTF-8?q?=E6=B6=88=E6=81=AF=E7=9B=92=E5=AD=90=E5=A2=9E=E5=8A=A0=E5=B0=8F?= =?UTF-8?q?=E6=99=BA=E8=AF=AD=E9=9F=B3=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/function/msgbox/MsgBoxConfig.kt | 3 + .../ui/msgbox/PassengerMsgBoxBubbleView.kt | 109 ++++++++++++++++-- .../adapter/PassengerMsgBoxBubbleAdapter.kt | 63 ++++++++-- .../layout/item_passenger_msg_box_voice.xml | 29 +++++ .../core/data/msgbox/MsgBoxCountDownBean.kt | 2 +- .../datacenter/msgbox/IMsgBoxEventListener.kt | 3 + .../CallerMsgBoxEventListenerManager.kt | 10 ++ 7 files changed, 201 insertions(+), 18 deletions(-) create mode 100644 core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_passenger_msg_box_voice.xml diff --git a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/msgbox/MsgBoxConfig.kt b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/msgbox/MsgBoxConfig.kt index e92e474d28..241ad69f8c 100644 --- a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/msgbox/MsgBoxConfig.kt +++ b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/msgbox/MsgBoxConfig.kt @@ -37,6 +37,9 @@ class MsgBoxConfig { //录包信息缓存列表 @JvmField var recordBagList: ArrayList = ArrayList() + //播放小智语音消息时的未播放消息缓存列表 + @JvmField + var unPlayList: ArrayList = ArrayList() } } \ 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/PassengerMsgBoxBubbleView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/PassengerMsgBoxBubbleView.kt index 5cbc439866..5f0323fd51 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 @@ -11,6 +11,8 @@ 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.data.msgbox.VoiceMsg +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.api.order.IOrderListener import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxEventListenerManager @@ -31,13 +33,17 @@ class PassengerMsgBoxBubbleView @JvmOverloads constructor( context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0 -) : ConstraintLayout(context, attrs, defStyleAttr), IMsgBoxListener, IOrderListener { +) : ConstraintLayout(context, attrs, defStyleAttr), IMsgBoxListener, IOrderListener, + IMsgBoxEventListener { private val TAG = "PassengerMsgBoxBubbleView" private val dataList :ArrayList = ArrayList() private var passengerMsgBoxBubbleAdapter: PassengerMsgBoxBubbleAdapter ?= null private var isShowData = true private var isShowSummary = false //是否展示汇总消息 + private var isCacheMsg = false //是否缓存消息 + private var voiceIsShowing = false //小智语音消息是否正在展示 + private var voiceMsgBean: MsgBoxCountDownBean ?= null //小智语音消息封装 init { LayoutInflater.from(context).inflate(R.layout.layout_passenger_msg_box_bubble, this, true) @@ -65,20 +71,95 @@ class PassengerMsgBoxBubbleView @JvmOverloads constructor( if(category == MsgCategory.NOTICE){ if(msgBoxList.type == MsgBoxType.NOTICE || msgBoxList.type == MsgBoxType.V2X || msgBoxList.type == MsgBoxType.OBU){ - if(msgBoxList.sourceType == DataSourceType.SUMMARY){ - //在一次订单中汇总消息只展示一次 - if(isShowSummary){ - operationalData(msgBoxList) - isShowSummary = false - } + if(isCacheMsg){ + //将消息缓存到未播放列表等待小智语音播放完成后取出播放 + MsgBoxConfig.unPlayList.add(msgBoxList) }else{ - operationalData(msgBoxList) + //实时播放消息 + notifyMsg(msgBoxList) } } } + if(category == MsgCategory.VOICE_INFO){ + if(msgBoxList.type == MsgBoxType.VOICE){ + executeVoiceInfo(msgBoxList) + } + } },UiThreadHandler.MODE.QUEUE) } + /** + * 小智语音消息执行 + */ + private fun executeVoiceInfo(msgBoxList: MsgBoxBean){ + val voiceMsg = msgBoxList.bean as VoiceMsg + if(voiceMsg.isWakeUp && !voiceMsg.isWakeUpEnd){ + //有其他消息时,将其他消息缓存进未播放列表 + voiceIsShowing = true + isCacheMsg = true + //开始展示消息 + if(voiceMsgBean == null){ + voiceMsgBean = MsgBoxCountDownBean(msgBoxList) + dataList.add(voiceMsgBean!!) + }else{ + dataList.remove(voiceMsgBean) + voiceMsgBean!!.msgBoxBean = msgBoxList + dataList.add(voiceMsgBean!!) + } + passengerMsgBoxBubbleAdapter?.setData(dataList) + } + if(!voiceMsg.isWakeUp && voiceMsg.isWakeUpEnd){ + //关闭消息展示 + dataList.remove(voiceMsgBean) + passengerMsgBoxBubbleAdapter?.setData(dataList) + //如果未播放列表中有未播放的消息则陆续展示消息,新来的消息继续放到未播放列表中, + //如果未播放消息列表为空,则立刻改变状态,即使播放新消息 + voiceIsShowing = false + handleCachedMsg() + } + + } + + /** + * 播放缓存消息 + */ + private fun handleCachedMsg(){ + if(MsgBoxConfig.unPlayList.isEmpty()){ + isCacheMsg = false + }else{ + //开始播放缓存未播放消息 + val iterator = MsgBoxConfig.unPlayList.iterator() + while(iterator.hasNext()){ + val msg = iterator.next() + if(passengerMsgBoxBubbleAdapter!!.getDataSize()<3){ + notifyMsg(msg) + iterator.remove() + } + } + if(MsgBoxConfig.unPlayList.isEmpty()){ + isCacheMsg = false + } + } + } + + /** + * 通知新消息展示 + */ + private fun notifyMsg(msgBoxList: MsgBoxBean){ + if(msgBoxList.sourceType == DataSourceType.SUMMARY){ + //在一次订单中汇总消息只展示一次 + if(isShowSummary){ + operationalData(msgBoxList) + isShowSummary = false + } + }else{ + operationalData(msgBoxList) + } + } + + /** + * 处理播放消息 + */ private fun operationalData(msgBoxList: MsgBoxBean){ MsgBoxConfig.noticeList.add(msgBoxList) if(isShowData){ @@ -93,16 +174,28 @@ class PassengerMsgBoxBubbleView @JvmOverloads constructor( super.onAttachedToWindow() CallerMsgBoxListenerManager.addListener(TAG,this) CallerOrderListenerManager.addListener(TAG,this) + CallerMsgBoxEventListenerManager.addListener(TAG,this) } override fun onDetachedFromWindow() { super.onDetachedFromWindow() CallerMsgBoxListenerManager.removeListener(TAG) CallerOrderListenerManager.removeListener(TAG) + CallerMsgBoxEventListenerManager.removeListener(TAG) } override fun onUpdateOrderStatus(inOrder: Boolean) { isShowSummary = inOrder } + /** + * 播放缓存消息 + */ + override fun onHandleCachedMsg() { + if(voiceIsShowing){ + return + } + handleCachedMsg() + } + } \ 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/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 7cf0289ddf..f2cd1a7db6 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 @@ -1,7 +1,9 @@ package com.mogo.eagle.core.function.hmi.ui.msgbox.adapter import android.app.Activity +import android.content.res.Resources import android.os.CountDownTimer +import android.view.Gravity import android.view.LayoutInflater import android.view.View import android.view.ViewGroup @@ -17,6 +19,7 @@ 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.function.hmi.ui.msgbox.PassengerMsgBoxBubbleView import com.mogo.eagle.core.utilcode.mogo.glide.transform.GlideRoundedCornersTransform import com.mogo.eagle.core.utilcode.util.TimeUtils import com.mogo.eagle.core.utilcode.util.TimeUtils.getHourMinFormat @@ -34,6 +37,7 @@ class PassengerMsgBoxBubbleAdapter(private val activity: Activity): RecyclerView private val notice: Int = 1 private val v2x: Int = 2 private val summary: Int = 3 + private val voice: Int = 4 fun setData(data: ArrayList){ this.data = data @@ -43,6 +47,17 @@ class PassengerMsgBoxBubbleAdapter(private val activity: Activity): RecyclerView notifyDataSetChanged() } + /** + * 获取列表数据个数 + */ + fun getDataSize(): Int{ + return if(data.isNullOrEmpty()){ + 0 + }else{ + data!!.size + } + } + override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder { return when (viewType) { notice -> { @@ -53,6 +68,11 @@ class PassengerMsgBoxBubbleAdapter(private val activity: Activity): RecyclerView val view = LayoutInflater.from(parent.context).inflate(R.layout.item_passenger_msg_box_summary,parent,false) BubbleSummaryHolder(view) } + //小智语音 + voice -> { + val view = LayoutInflater.from(parent.context).inflate(R.layout.item_passenger_msg_box_voice,parent,false) + BubbleVoiceHolder(view) + } else -> { val view = LayoutInflater.from(parent.context).inflate(R.layout.item_passenger_msg_box_v2x,parent,false) BubbleV2XHolder(view) @@ -108,23 +128,41 @@ class PassengerMsgBoxBubbleAdapter(private val activity: Activity): RecyclerView } } } + //小智语音消息 + is BubbleVoiceHolder -> { + data?.let { + val voiceMsg = it[position].msgBoxBean.bean as VoiceMsg + holder.tvPassengerVoiceContent.text = voiceMsg.msg + if(voiceMsg.isResp){ + //小智说的 + holder.tvPassengerVoiceContent.setTextColor(activity.resources.getColor(R.color.black)) + }else{ + //用户说的 + holder.tvPassengerVoiceContent.setTextColor(activity.resources.getColor(R.color.blue)) + } + } + } } val msgBoxBean: MsgBoxCountDownBean = data!![position] - msgBoxBean.countDownTimer =object: CountDownTimer(CallerMsgBoxManager.getDismissTime(),1000){ - override fun onTick(p0: Long) { + if(msgBoxBean.msgBoxBean.type != MsgBoxType.VOICE){ + msgBoxBean.countDownTimer =object: CountDownTimer(CallerMsgBoxManager.getDismissTime(),CallerMsgBoxManager.getDismissTime()){ + override fun onTick(p0: Long) { - } + } - override fun onFinish() { - data?.remove(msgBoxBean) - notifyDataSetChanged() + override fun onFinish() { + data?.remove(msgBoxBean) + notifyDataSetChanged() // notifyItemRemoved(index) // notifyItemRangeChanged(index,recordTypeEntity.size-index) - } + //通知消息盒子可以展示新的缓存消息 + CallerMsgBoxEventListenerManager.invokeHandleCachedMsg() + } + } + msgBoxBean.countDownTimer?.start() } - msgBoxBean.countDownTimer?.start() } override fun getItemCount() = data?.size ?: 0 @@ -134,7 +172,9 @@ class PassengerMsgBoxBubbleAdapter(private val activity: Activity): RecyclerView notice }else if(data!![position].msgBoxBean.type == MsgBoxType.V2X && data!![position].msgBoxBean.sourceType == DataSourceType.SUMMARY){ summary - } else{ + }else if(data!![position].msgBoxBean.type == MsgBoxType.VOICE){ + voice + }else{ v2x } } @@ -160,4 +200,9 @@ class PassengerMsgBoxBubbleAdapter(private val activity: Activity): RecyclerView var tvPassengerSummaryTime: TextView = itemView.findViewById(R.id.tvPassengerSummaryTime) } + //小智语音消息 + class BubbleVoiceHolder(itemView: View): RecyclerView.ViewHolder(itemView){ + var tvPassengerVoiceContent: TextView = itemView.findViewById(R.id.tvPassengerVoiceContent) + } + } \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_passenger_msg_box_voice.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_passenger_msg_box_voice.xml new file mode 100644 index 0000000000..e5d2460761 --- /dev/null +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_passenger_msg_box_voice.xml @@ -0,0 +1,29 @@ + + + + + + \ No newline at end of file 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 index a5fee017c9..af2c2becc2 100644 --- 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 @@ -2,6 +2,6 @@ package com.mogo.eagle.core.data.msgbox import android.os.CountDownTimer -class MsgBoxCountDownBean(val msgBoxBean: MsgBoxBean){ +class MsgBoxCountDownBean(var msgBoxBean: MsgBoxBean){ var countDownTimer: CountDownTimer ?= null } \ No newline at end of file diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/datacenter/msgbox/IMsgBoxEventListener.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/datacenter/msgbox/IMsgBoxEventListener.kt index e333b9afce..9a2c4061c3 100644 --- a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/datacenter/msgbox/IMsgBoxEventListener.kt +++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/datacenter/msgbox/IMsgBoxEventListener.kt @@ -22,4 +22,7 @@ interface IMsgBoxEventListener { //气泡态上报消息事件点击监听 fun onBubbleReportClickEvent(msgBoxBean: MsgBoxBean){} + + //通知播放缓存的未播放消息 + fun onHandleCachedMsg(){} } \ 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 index 60ae707c49..6532d6ff8d 100644 --- 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 @@ -61,5 +61,15 @@ object CallerMsgBoxEventListenerManager: CallerBase() { } } + /** + * 通知播放缓存的未播放消息 + */ + fun invokeHandleCachedMsg(){ + M_LISTENERS.forEach { + val listener = it.value + listener.onHandleCachedMsg() + } + } + } \ No newline at end of file From 7f834b1ff7e8523e89c06c24d545bd56ba959a8f Mon Sep 17 00:00:00 2001 From: xuxinchao Date: Wed, 8 Nov 2023 20:09:45 +0800 Subject: [PATCH 2/2] =?UTF-8?q?[6.2.0]=E5=8F=B8=E6=9C=BA=E7=AB=AF=E6=B6=88?= =?UTF-8?q?=E6=81=AF=E7=9B=92=E5=AD=90=E5=88=97=E8=A1=A8=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?FM=E4=BF=A1=E6=81=AFTitle?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hmi/ui/msgbox/DriverMsgBoxListView.kt | 67 +++++++++++++++++-- .../res/layout/layout_driver_msg_box_list.xml | 50 ++++++++++---- 2 files changed, 97 insertions(+), 20 deletions(-) diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/DriverMsgBoxListView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/DriverMsgBoxListView.kt index bdbb2573f6..2106591153 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/DriverMsgBoxListView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/DriverMsgBoxListView.kt @@ -45,9 +45,10 @@ class DriverMsgBoxListView @JvmOverloads constructor( initView() } private val TAG = "DriverMsgBoxListView" - private var noticeList: ArrayList ?= null - private var ipcReportList: ArrayList ?= null - private var badCaseList: ArrayList ?= null + private var noticeList: ArrayList ?= null //通知消息列表 + private var fmList: ArrayList ?= null //FM信息消息列表 + private var ipcReportList: ArrayList ?= null //车辆系统信息消息列表 + private var badCaseList: ArrayList ?= null//录包消息列表 private var driverMsgBoxListAdapter: DriverMsgBoxListAdapter ?=null private var linearLayoutManager: LinearLayoutManager ?= null @@ -71,9 +72,11 @@ class DriverMsgBoxListView @JvmOverloads constructor( //通知 tvMsgNotice.setOnClickListener { tvMsgNotice.setTextColor(resources.getColor(R.color.msg_box_title_color)) + tvMsgFm.setTextColor(resources.getColor(R.color.color_FFFFFF)) tvMsgIpcReport.setTextColor(resources.getColor(R.color.color_FFFFFF)) tvMsgBadCase.setTextColor(resources.getColor(R.color.color_FFFFFF)) viewNoticeDivider.visibility = View.VISIBLE + viewFmDivider.visibility = View.GONE viewIpcReportDivider.visibility = View.GONE viewBadCaseDivider.visibility = View.GONE MsgBoxConfig.setUserRecord(0) @@ -86,15 +89,36 @@ class DriverMsgBoxListView @JvmOverloads constructor( } } + //FM信息 + tvMsgFm.setOnClickListener { + tvMsgNotice.setTextColor(resources.getColor(R.color.color_FFFFFF)) + tvMsgFm.setTextColor(resources.getColor(R.color.msg_box_title_color)) + tvMsgIpcReport.setTextColor(resources.getColor(R.color.color_FFFFFF)) + tvMsgBadCase.setTextColor(resources.getColor(R.color.color_FFFFFF)) + viewNoticeDivider.visibility = View.GONE + viewFmDivider.visibility = View.VISIBLE + viewIpcReportDivider.visibility = View.GONE + viewBadCaseDivider.visibility = View.GONE + MsgBoxConfig.setUserRecord(1) + if(fmList == null){ + rvMsgBoxList.visibility = View.GONE + }else{ + driverMsgBoxListAdapter?.setData(fmList!!) + rvMsgBoxList.visibility = View.VISIBLE + rvMsgBoxList.scrollToPosition(0) + } + } //车辆系统信息 tvMsgIpcReport.setOnClickListener { tvMsgNotice.setTextColor(resources.getColor(R.color.color_FFFFFF)) + tvMsgFm.setTextColor(resources.getColor(R.color.color_FFFFFF)) tvMsgIpcReport.setTextColor(resources.getColor(R.color.msg_box_title_color)) tvMsgBadCase.setTextColor(resources.getColor(R.color.color_FFFFFF)) viewNoticeDivider.visibility = View.GONE + viewFmDivider.visibility = View.GONE viewIpcReportDivider.visibility = View.VISIBLE viewBadCaseDivider.visibility = View.GONE - MsgBoxConfig.setUserRecord(1) + MsgBoxConfig.setUserRecord(2) if(ipcReportList == null){ rvMsgBoxList.visibility = View.GONE }else{ @@ -107,12 +131,14 @@ class DriverMsgBoxListView @JvmOverloads constructor( //录包 tvMsgBadCase.setOnClickListener { tvMsgNotice.setTextColor(resources.getColor(R.color.color_FFFFFF)) + tvMsgFm.setTextColor(resources.getColor(R.color.color_FFFFFF)) tvMsgIpcReport.setTextColor(resources.getColor(R.color.color_FFFFFF)) tvMsgBadCase.setTextColor(resources.getColor(R.color.msg_box_title_color)) viewNoticeDivider.visibility = View.GONE + viewFmDivider.visibility = View.GONE viewIpcReportDivider.visibility = View.GONE viewBadCaseDivider.visibility = View.VISIBLE - MsgBoxConfig.setUserRecord(2) + MsgBoxConfig.setUserRecord(3) if(badCaseList == null){ rvMsgBoxList.visibility = View.GONE }else{ @@ -127,11 +153,14 @@ class DriverMsgBoxListView @JvmOverloads constructor( fun notifyData(){ //获取当前Tab选择 when(MsgBoxConfig.getUserRecord()){ + //通知消息 0 ->{ tvMsgNotice.setTextColor(resources.getColor(R.color.msg_box_title_color)) + tvMsgFm.setTextColor(resources.getColor(R.color.color_FFFFFF)) tvMsgIpcReport.setTextColor(resources.getColor(R.color.color_FFFFFF)) tvMsgBadCase.setTextColor(resources.getColor(R.color.color_FFFFFF)) viewNoticeDivider.visibility = View.VISIBLE + viewFmDivider.visibility = View.GONE viewIpcReportDivider.visibility = View.GONE viewBadCaseDivider.visibility = View.GONE if(noticeList==null){ @@ -142,11 +171,32 @@ class DriverMsgBoxListView @JvmOverloads constructor( rvMsgBoxList.scrollToPosition(0) } } - 1 ->{ + //FM消息 + 1->{ tvMsgNotice.setTextColor(resources.getColor(R.color.color_FFFFFF)) + tvMsgFm.setTextColor(resources.getColor(R.color.msg_box_title_color)) + tvMsgIpcReport.setTextColor(resources.getColor(R.color.color_FFFFFF)) + tvMsgBadCase.setTextColor(resources.getColor(R.color.color_FFFFFF)) + viewNoticeDivider.visibility = View.GONE + viewFmDivider.visibility = View.VISIBLE + viewIpcReportDivider.visibility = View.GONE + viewBadCaseDivider.visibility = View.GONE + if(fmList == null){ + rvMsgBoxList.visibility = View.GONE + }else{ + driverMsgBoxListAdapter?.setData(fmList!!) + rvMsgBoxList.visibility = View.VISIBLE + rvMsgBoxList.scrollToPosition(0) + } + } + //车辆系统信息消息 + 2 ->{ + tvMsgNotice.setTextColor(resources.getColor(R.color.color_FFFFFF)) + tvMsgFm.setTextColor(resources.getColor(R.color.color_FFFFFF)) tvMsgIpcReport.setTextColor(resources.getColor(R.color.msg_box_title_color)) tvMsgBadCase.setTextColor(resources.getColor(R.color.color_FFFFFF)) viewNoticeDivider.visibility = View.GONE + viewFmDivider.visibility = View.GONE viewIpcReportDivider.visibility = View.VISIBLE viewBadCaseDivider.visibility = View.GONE if(ipcReportList == null){ @@ -157,11 +207,14 @@ class DriverMsgBoxListView @JvmOverloads constructor( rvMsgBoxList.scrollToPosition(0) } } - 2 ->{ + //录包消息 + 3 ->{ tvMsgNotice.setTextColor(resources.getColor(R.color.color_FFFFFF)) + tvMsgFm.setTextColor(resources.getColor(R.color.color_FFFFFF)) tvMsgIpcReport.setTextColor(resources.getColor(R.color.color_FFFFFF)) tvMsgBadCase.setTextColor(resources.getColor(R.color.msg_box_title_color)) viewNoticeDivider.visibility = View.GONE + viewFmDivider.visibility = View.GONE viewIpcReportDivider.visibility = View.GONE viewBadCaseDivider.visibility = View.VISIBLE if(badCaseList == null){ diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_driver_msg_box_list.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_driver_msg_box_list.xml index aa8bb90aaa..82cc0ab41b 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_driver_msg_box_list.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_driver_msg_box_list.xml @@ -8,11 +8,11 @@ + + + + @@ -54,11 +78,11 @@