From 7b26c6a3a4fe270f3e6a4fbd8a1557349dfaa488 Mon Sep 17 00:00:00 2001 From: xuxinchao Date: Fri, 20 Sep 2024 17:39:58 +0800 Subject: [PATCH] =?UTF-8?q?[6.7.0]=E5=8E=BB=E9=99=A4=E5=8F=B8=E6=9C=BA?= =?UTF-8?q?=E7=AB=AF=E6=97=A7=E7=89=88=E6=B6=88=E6=81=AF=E7=9B=92=E5=AD=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../och/bus/fragment/BaseBusTabFragment.kt | 20 -- .../src/main/res/layout/bus_base_fragment.xml | 27 -- .../och/charter/base/CharterBaseFragment.kt | 26 -- .../main/res/layout/charter_base_fragment.xml | 27 -- .../fragment/BaseShuttleTabFragment.java | 24 -- .../main/res/layout/shuttle_base_fragment.xml | 27 -- .../mogo/och/taxi/ui/BaseTaxiTabFragment.java | 25 -- .../main/res/layout/taxi_base_fragment.xml | 27 -- .../taxi/ui/base/BaseTaxiTabFragment.kt | 18 - .../layout/unmanned_taxi_base_fragment.xml | 28 -- .../hmi/bone/tab/MsgBoxListTabView.kt | 338 ++++++++++++++++++ 11 files changed, 338 insertions(+), 249 deletions(-) create mode 100644 core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/bone/tab/MsgBoxListTabView.kt diff --git a/OCH/bus/driver/src/main/java/com/mogo/och/bus/fragment/BaseBusTabFragment.kt b/OCH/bus/driver/src/main/java/com/mogo/och/bus/fragment/BaseBusTabFragment.kt index 5f467cac09..837f9c4dfa 100644 --- a/OCH/bus/driver/src/main/java/com/mogo/och/bus/fragment/BaseBusTabFragment.kt +++ b/OCH/bus/driver/src/main/java/com/mogo/och/bus/fragment/BaseBusTabFragment.kt @@ -16,7 +16,6 @@ import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager.isCanStartAutopilot import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.getState import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager.attachAutopilotBeforeLaunchView -import com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxButtonView import com.mogo.eagle.core.utilcode.mogo.view.OnPreventFastClickListener import com.mogo.eagle.core.utilcode.util.UiThreadHandler import com.mogo.och.bus.R @@ -35,9 +34,6 @@ import kotlinx.android.synthetic.main.bus_base_fragment.module_mogo_och_autopilo import kotlinx.android.synthetic.main.bus_base_fragment.module_mogo_och_slide_panel import kotlinx.android.synthetic.main.bus_base_fragment.module_mogo_och_station_panel_container import kotlinx.android.synthetic.main.bus_base_fragment.smallMapView -import kotlinx.android.synthetic.main.bus_base_fragment.viewDriverMsgBoxBubble -import kotlinx.android.synthetic.main.bus_base_fragment.viewDriverMsgBoxButton -import kotlinx.android.synthetic.main.bus_base_fragment.viewDriverMsgBoxList import org.greenrobot.eventbus.EventBus /** @@ -84,22 +80,6 @@ abstract class BaseBusTabFragment?> : MvpFragment - - - - - - ?>() : MvpFragmen protected var smallMapView: SmallMapView? = null - //消息盒子 - private var viewDriverMsgBoxButton: DriverMsgBoxButtonView? = null - private var viewDriverMsgBoxList: DriverMsgBoxListView? = null - private var viewDriverMsgBoxBubble: DriverMsgBoxBubbleView? = null private var autopilotLoadingAnimator: ObjectAnimator? = null @@ -113,24 +105,6 @@ abstract class CharterBaseFragment?>() : MvpFragmen onArriveStation() } - //消息盒子 - viewDriverMsgBoxButton = findViewById(R.id.viewDriverMsgBoxButton) - viewDriverMsgBoxList = findViewById(R.id.viewDriverMsgBoxList) - viewDriverMsgBoxBubble = findViewById(R.id.viewDriverMsgBoxBubble) - viewDriverMsgBoxButton!!.setClickListener(object : ClickListener { - override fun showMsgBoxList(show: Boolean) { - if (show) { - viewDriverMsgBoxList!!.visibility = View.VISIBLE - viewDriverMsgBoxList!!.notifyData() - viewDriverMsgBoxBubble!!.visibility = View.GONE - viewDriverMsgBoxBubble!!.isShowData(false) - } else { - viewDriverMsgBoxList!!.visibility = View.GONE - viewDriverMsgBoxBubble!!.visibility = View.VISIBLE - viewDriverMsgBoxBubble!!.isShowData(true) - } - } - }) smallMapView = findViewById(R.id.smallMapView) ctvAutopilotStatus?.setOnLongClickListener { diff --git a/OCH/charter/driver/src/main/res/layout/charter_base_fragment.xml b/OCH/charter/driver/src/main/res/layout/charter_base_fragment.xml index 81fc4d1522..f3d5d7b9bf 100644 --- a/OCH/charter/driver/src/main/res/layout/charter_base_fragment.xml +++ b/OCH/charter/driver/src/main/res/layout/charter_base_fragment.xml @@ -124,33 +124,6 @@ android:visibility="invisible" app:layout_constraintTop_toBottomOf="@+id/viewLimitingVelocity"/> - - - - - - { - if(show){ - viewDriverMsgBoxList.setVisibility(View.VISIBLE); - viewDriverMsgBoxList.notifyData(); - viewDriverMsgBoxBubble.setVisibility(View.GONE); - viewDriverMsgBoxBubble.isShowData(false); - }else{ - viewDriverMsgBoxList.setVisibility(View.GONE); - viewDriverMsgBoxBubble.setVisibility(View.VISIBLE); - viewDriverMsgBoxBubble.isShowData(true); - } - }); smallMapView = findViewById(R.id.smallMapView); } diff --git a/OCH/shuttle/driver/src/main/res/layout/shuttle_base_fragment.xml b/OCH/shuttle/driver/src/main/res/layout/shuttle_base_fragment.xml index ff491ca0f7..e567cf5920 100644 --- a/OCH/shuttle/driver/src/main/res/layout/shuttle_base_fragment.xml +++ b/OCH/shuttle/driver/src/main/res/layout/shuttle_base_fragment.xml @@ -114,33 +114,6 @@ android:visibility="invisible" app:layout_constraintTop_toBottomOf="@+id/viewLimitingVelocity"/> - - - - - - { - if (show) { - viewDriverMsgBoxList.setVisibility(View.VISIBLE); - viewDriverMsgBoxList.notifyData(); - viewDriverMsgBoxBubble.setVisibility(View.GONE); - viewDriverMsgBoxBubble.isShowData(false); - } else { - viewDriverMsgBoxList.setVisibility(View.GONE); - viewDriverMsgBoxBubble.setVisibility(View.VISIBLE); - viewDriverMsgBoxBubble.isShowData(true); - } - }); smallMapView = findViewById(R.id.smallMapView); acivShowGuid = findViewById(R.id.aciv_show_guid); @@ -270,9 +248,6 @@ public abstract class BaseTaxiTabFragment - - - - - - > : MvpFragment - - -,. - - - - ?= null //通知消息列表 + private var fmList: ArrayList ?= ArrayList() //FM信息消息列表 + private var ipcReportList: ArrayList ?= null //车辆系统信息消息列表 + private var badCaseList: ArrayList ?= null//录包消息列表 + private var driverMsgBoxListAdapter: DriverMsgBoxListAdapter ?=null + private var linearLayoutManager: LinearLayoutManager ?= null + + private var isShowSummary = false //是否展示汇总消息 + + private fun initView() { + driverMsgBoxListAdapter= DriverMsgBoxListAdapter(context as Activity) + rvMsgBoxList.adapter = driverMsgBoxListAdapter + linearLayoutManager = LinearLayoutManager(context) + rvMsgBoxList.layoutManager = linearLayoutManager + + //获取通知消息列表 + noticeList= CallerMsgBoxManager.getCachedNotifyData() as ArrayList? + noticeList = noticeList?.let { ArrayList(it.reversed()) } + //获取车辆系统信息列表 + ipcReportList = CallerMsgBoxManager.getCachedSysInfoData() as ArrayList? + ipcReportList = ipcReportList?.let { ArrayList(it.reversed()) } + //获取录包信息列表 + badCaseList = CallerMsgBoxManager.getCachedRecordBagData() as ArrayList? + badCaseList = badCaseList?.let { ArrayList(it.reversed()) } + //通知 + tvMsgNotice.setOnClickListener { + tvMsgNotice.setTextColor(ContextCompat.getColor(context, R.color.msg_box_title_color)) + tvMsgFm.setTextColor(ContextCompat.getColor(context, R.color.color_FFFFFF)) + tvMsgIpcReport.setTextColor(ContextCompat.getColor(context, R.color.color_FFFFFF)) + tvMsgBadCase.setTextColor(ContextCompat.getColor(context, R.color.color_FFFFFF)) + tvMsgNotice.setBackgroundResource(R.drawable.bg_msg_box_title_selected) + tvMsgFm.background = null + tvMsgIpcReport.background = null + tvMsgBadCase.background = null + MsgBoxConfig.setUserRecord(0) + if(noticeList==null){ + rvMsgBoxList.visibility = View.GONE + }else{ + driverMsgBoxListAdapter?.setData(noticeList!!) + rvMsgBoxList.visibility = View.VISIBLE + rvMsgBoxList.scrollToPosition(0) + } + + } + //FM信息 + tvMsgFm.setOnClickListener { + tvMsgNotice.setTextColor(ContextCompat.getColor(context, R.color.color_FFFFFF)) + tvMsgFm.setTextColor(ContextCompat.getColor(context, R.color.msg_box_title_color)) + tvMsgIpcReport.setTextColor(ContextCompat.getColor(context, R.color.color_FFFFFF)) + tvMsgBadCase.setTextColor(ContextCompat.getColor(context, R.color.color_FFFFFF)) + tvMsgNotice.background = null + tvMsgFm.setBackgroundResource(R.drawable.bg_msg_box_title_selected) + tvMsgIpcReport.background = null + tvMsgBadCase.background = null + 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(ContextCompat.getColor(context, R.color.color_FFFFFF)) + tvMsgFm.setTextColor(ContextCompat.getColor(context, R.color.color_FFFFFF)) + tvMsgIpcReport.setTextColor(ContextCompat.getColor(context, R.color.msg_box_title_color)) + tvMsgBadCase.setTextColor(ContextCompat.getColor(context, R.color.color_FFFFFF)) + tvMsgNotice.background = null + tvMsgFm.background = null + tvMsgIpcReport.setBackgroundResource(R.drawable.bg_msg_box_title_selected) + tvMsgBadCase.background = null + MsgBoxConfig.setUserRecord(2) + if(ipcReportList == null){ + rvMsgBoxList.visibility = View.GONE + }else{ + driverMsgBoxListAdapter?.setData(ipcReportList!!) + rvMsgBoxList.visibility = View.VISIBLE + rvMsgBoxList.scrollToPosition(0) + } + + } + //录包 + tvMsgBadCase.setOnClickListener { + tvMsgNotice.setTextColor(ContextCompat.getColor(context, R.color.color_FFFFFF)) + tvMsgFm.setTextColor(ContextCompat.getColor(context, R.color.color_FFFFFF)) + tvMsgIpcReport.setTextColor(ContextCompat.getColor(context, R.color.color_FFFFFF)) + tvMsgBadCase.setTextColor(ContextCompat.getColor(context, R.color.msg_box_title_color)) + tvMsgNotice.background = null + tvMsgFm.background = null + tvMsgIpcReport.background = null + tvMsgBadCase.setBackgroundResource(R.drawable.bg_msg_box_title_selected) + MsgBoxConfig.setUserRecord(3) + if(badCaseList == null){ + rvMsgBoxList.visibility = View.GONE + }else{ + driverMsgBoxListAdapter?.setData(badCaseList!!) + rvMsgBoxList.visibility = View.VISIBLE + rvMsgBoxList.scrollToPosition(0) + } + } + + } + + fun notifyData(){ + //获取当前Tab选择 + when(MsgBoxConfig.getUserRecord()){ + //通知消息 + 0 ->{ + tvMsgNotice.setTextColor(ContextCompat.getColor(context, R.color.msg_box_title_color)) + tvMsgFm.setTextColor(ContextCompat.getColor(context, R.color.color_FFFFFF)) + tvMsgIpcReport.setTextColor(ContextCompat.getColor(context, R.color.color_FFFFFF)) + tvMsgBadCase.setTextColor(ContextCompat.getColor(context, R.color.color_FFFFFF)) + tvMsgNotice.setBackgroundResource(R.drawable.bg_msg_box_title_selected) + tvMsgFm.background = null + tvMsgIpcReport.background = null + tvMsgBadCase.background = null + if(noticeList==null){ + rvMsgBoxList.visibility = View.GONE + }else{ + driverMsgBoxListAdapter?.setData(noticeList!!) + rvMsgBoxList.visibility = View.VISIBLE + rvMsgBoxList.scrollToPosition(0) + } + } + //FM消息 + 1->{ + tvMsgNotice.setTextColor(ContextCompat.getColor(context, R.color.color_FFFFFF)) + tvMsgFm.setTextColor(ContextCompat.getColor(context, R.color.msg_box_title_color)) + tvMsgIpcReport.setTextColor(ContextCompat.getColor(context, R.color.color_FFFFFF)) + tvMsgBadCase.setTextColor(ContextCompat.getColor(context, R.color.color_FFFFFF)) + tvMsgNotice.background = null + tvMsgFm.setBackgroundResource(R.drawable.bg_msg_box_title_selected) + tvMsgIpcReport.background = null + tvMsgBadCase.background = null + if(fmList == null){ + rvMsgBoxList.visibility = View.GONE + }else{ + driverMsgBoxListAdapter?.setData(fmList!!) + rvMsgBoxList.visibility = View.VISIBLE + rvMsgBoxList.scrollToPosition(0) + } + } + //车辆系统信息消息 + 2 ->{ + tvMsgNotice.setTextColor(ContextCompat.getColor(context, R.color.color_FFFFFF)) + tvMsgFm.setTextColor(ContextCompat.getColor(context, R.color.color_FFFFFF)) + tvMsgIpcReport.setTextColor(ContextCompat.getColor(context, R.color.msg_box_title_color)) + tvMsgBadCase.setTextColor(ContextCompat.getColor(context, R.color.color_FFFFFF)) + tvMsgNotice.background = null + tvMsgFm.background = null + tvMsgIpcReport.setBackgroundResource(R.drawable.bg_msg_box_title_selected) + tvMsgBadCase.background = null + if(ipcReportList == null){ + rvMsgBoxList.visibility = View.GONE + }else{ + driverMsgBoxListAdapter?.setData(ipcReportList!!) + rvMsgBoxList.visibility = View.VISIBLE + rvMsgBoxList.scrollToPosition(0) + } + } + //录包消息 + 3 ->{ + tvMsgNotice.setTextColor(ContextCompat.getColor(context, R.color.color_FFFFFF)) + tvMsgFm.setTextColor(ContextCompat.getColor(context, R.color.color_FFFFFF)) + tvMsgIpcReport.setTextColor(ContextCompat.getColor(context, R.color.color_FFFFFF)) + tvMsgBadCase.setTextColor(ContextCompat.getColor(context, R.color.msg_box_title_color)) + tvMsgNotice.background = null + tvMsgFm.background = null + tvMsgIpcReport.background = null + tvMsgBadCase.setBackgroundResource(R.drawable.bg_msg_box_title_selected) + if(badCaseList == null){ + rvMsgBoxList.visibility = View.GONE + }else{ + driverMsgBoxListAdapter?.setData(badCaseList!!) + rvMsgBoxList.visibility = View.VISIBLE + rvMsgBoxList.scrollToPosition(0) + } + } + } + + } + + override fun onDataChanged(category: MsgCategory, msgBoxList: MsgBoxBean) { + UiThreadHandler.post({ + when (category) { + //通知 + MsgCategory.NOTICE -> { + if(msgBoxList.sourceType == DataSourceType.SUMMARY){ + //在一次订单中汇总消息只展示一次 + if(isShowSummary){ + noticeList?.add(0,msgBoxList) + if(MsgBoxConfig.getUserRecord() == 0){ + noticeList?.let { driverMsgBoxListAdapter?.setData(it) } + } + isShowSummary = false + } + }else{ + noticeList?.add(0,msgBoxList) + if(MsgBoxConfig.getUserRecord() == 0){ + noticeList?.let { driverMsgBoxListAdapter?.setData(it) } + } + } + } + //FM信息 + MsgCategory.FM_INFO -> { + fmList?.add(0,msgBoxList) + if(MsgBoxConfig.getUserRecord() == 1){ + fmList?.let { driverMsgBoxListAdapter?.setData(it) } + } + } + //系统信息 + MsgCategory.SYS_INFO -> { + ipcReportList?.add(0,msgBoxList) + if(MsgBoxConfig.getUserRecord() == 2){ + ipcReportList?.let { driverMsgBoxListAdapter?.setData(it) } + } + } + //录包 + MsgCategory.RECORD_BAG -> { + badCaseList?.add(0,msgBoxList) + if(MsgBoxConfig.getUserRecord() == 3){ + badCaseList?.let { driverMsgBoxListAdapter?.setData(it) } + } + } + else -> {} + } + },UiThreadHandler.MODE.QUEUE) + } + + override fun onAttachedToWindow() { + super.onAttachedToWindow() + CallerMsgBoxListenerManager.addListener(TAG,this) + CallerMsgBoxEventListenerManager.addListener(TAG,this) + CallerOrderListenerManager.addListener(TAG,this) + EventBus.getDefault().register(this) + } + + override fun onDetachedFromWindow() { + super.onDetachedFromWindow() + CallerMsgBoxListenerManager.removeListener(TAG) + CallerMsgBoxEventListenerManager.removeListener(TAG) + CallerOrderListenerManager.removeListener(TAG) + EventBus.getDefault().unregister(this) + } + + @Subscribe(threadMode = ThreadMode.MAIN) + fun notifyList(msgBoxList: MsgBoxBean){ + badCaseList?.let { + driverMsgBoxListAdapter?.notifyItemRemoved(it.indexOf(msgBoxList)) + it.remove(msgBoxList) + } + } + + override fun onSummaryClickEvent() { + + } + + override fun onUpdateTipEvent(isShow: Boolean) { + + } + + override fun onBubbleOperationClickEvent(msgBoxBean: MsgBoxBean) { + MsgBoxConfig.setUserRecord(0) + notifyData() + noticeList?.let { + rvMsgBoxList?.scrollToPosition(it.indexOf(msgBoxBean)) + } + } + + override fun onBubbleV2XClickEvent(msgBoxBean: MsgBoxBean) { + MsgBoxConfig.setUserRecord(0) + notifyData() + noticeList?.let { + rvMsgBoxList?.scrollToPosition(it.indexOf(msgBoxBean)) + } + } + + override fun onBubbleReportClickEvent(msgBoxBean: MsgBoxBean) { + MsgBoxConfig.setUserRecord(1) + notifyData() + ipcReportList?.let { + linearLayoutManager?.scrollToPositionWithOffset(it.indexOf(msgBoxBean),0) + driverMsgBoxListAdapter?.setReportShowData(msgBoxBean) + } + } + + override fun onUpdateOrderStatus(inOrder: Boolean) { + isShowSummary = inOrder + } +} \ No newline at end of file