From f5b6da69e30e99c4a4785fee186d582c71e9fa31 Mon Sep 17 00:00:00 2001 From: xuxinchao Date: Thu, 1 Dec 2022 16:02:14 +0800 Subject: [PATCH] =?UTF-8?q?[2.13.0]=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 --- .../core/function/hmi/ui/MoGoHmiFragment.kt | 1 + .../hmi/ui/msgbox/DriverMsgBoxListView.kt | 141 ++++++++++-------- .../res/layout/item_msg_box_ipc_report.xml | 2 +- .../main/res/layout/item_msg_box_notice.xml | 2 +- .../res/layout/item_msg_box_operation.xml | 5 +- .../src/main/res/layout/item_msg_box_v2x.xml | 2 +- .../res/layout/item_msg_bubble_operation.xml | 2 +- .../res/layout/item_msg_bubble_report.xml | 2 +- .../layout/layout_driver_msg_box_bubble.xml | 2 +- .../res/layout/layout_driver_msg_box_list.xml | 2 +- 10 files changed, 87 insertions(+), 74 deletions(-) diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoHmiFragment.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoHmiFragment.kt index ae553ffc6a..869e4c865a 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoHmiFragment.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoHmiFragment.kt @@ -301,6 +301,7 @@ class MoGoHmiFragment : MvpFragment(), cbMsgBoxDriver.setOnCheckedChangeListener { _, isChecked -> if(isChecked){ viewDriverMsgBoxList.visibility = View.VISIBLE + viewDriverMsgBoxList.notifyData() viewDriverMsgBoxBubble.visibility = View.GONE CallerHmiManager.updateDriverMsgBoxTipView(false) }else{ 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 66566845c0..f2f7d666e4 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 @@ -36,75 +36,25 @@ class DriverMsgBoxListView @JvmOverloads constructor( initView() } + private var noticeList: ArrayList ?= null + private var ipcReportList: ArrayList ?= null + private var badCaseList: ArrayList ?= null + private var driverMsgBoxListAdapter: DriverMsgBoxListAdapter ?=null + private fun initView() { - val driverMsgBoxListAdapter= DriverMsgBoxListAdapter(context as Activity) + driverMsgBoxListAdapter= DriverMsgBoxListAdapter(context as Activity) rvMsgBoxList.adapter = driverMsgBoxListAdapter rvMsgBoxList.layoutManager = LinearLayoutManager(context) //获取通知消息列表 - val noticeList: ArrayList? = CallerMsgBoxManager.getCachedNotifyData() as ArrayList? - noticeList?.addAll(MsgBoxConfig.noticeList) + noticeList= CallerMsgBoxManager.getCachedNotifyData() as ArrayList? + noticeList?.reversed() //获取车辆系统信息列表 - val ipcReportList: ArrayList? = CallerMsgBoxManager.getCachedSysInfoData() as ArrayList? - ipcReportList?.addAll(MsgBoxConfig.systemInfoList) + ipcReportList = CallerMsgBoxManager.getCachedSysInfoData() as ArrayList? + ipcReportList?.reversed() //获取录包信息列表 - val badCaseList: ArrayList? = CallerMsgBoxManager.getCachedRecordBagData() as ArrayList? - badCaseList?.addAll(MsgBoxConfig.recordBagList) - - //获取当前Tab选择 - when(MsgBoxConfig.getUserRecord()){ - 0 ->{ - tvMsgNotice.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.VISIBLE - viewIpcReportDivider.visibility = View.GONE - viewBadCaseDivider.visibility = View.GONE - if(noticeList==null){ - rvMsgBoxList.visibility = View.GONE - }else{ - driverMsgBoxListAdapter.setData(noticeList) - rvMsgBoxList.visibility = View.VISIBLE - rvMsgBoxList.scrollToPosition(0) - } - } - 1 ->{ - tvMsgNotice.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 - viewIpcReportDivider.visibility = View.VISIBLE - viewBadCaseDivider.visibility = View.GONE - if(ipcReportList == null){ - rvMsgBoxList.visibility = View.GONE - }else{ - driverMsgBoxListAdapter.setData(ipcReportList.reversed()) - rvMsgBoxList.visibility = View.VISIBLE - rvMsgBoxList.scrollToPosition(0) - } - } - 2 ->{ - tvMsgNotice.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 - viewIpcReportDivider.visibility = View.GONE - viewBadCaseDivider.visibility = View.VISIBLE - if(badCaseList == null){ - rvMsgBoxList.visibility = View.GONE - }else{ - driverMsgBoxListAdapter.setData(badCaseList.reversed()) - rvMsgBoxList.visibility = View.VISIBLE - rvMsgBoxList.scrollToPosition(0) - } - } - } - - - - - - + badCaseList = CallerMsgBoxManager.getCachedRecordBagData() as ArrayList? + badCaseList?.reversed() //通知 tvMsgNotice.setOnClickListener { @@ -118,7 +68,7 @@ class DriverMsgBoxListView @JvmOverloads constructor( if(noticeList==null){ rvMsgBoxList.visibility = View.GONE }else{ - driverMsgBoxListAdapter.setData(noticeList.reversed()) + driverMsgBoxListAdapter?.setData(noticeList!!) rvMsgBoxList.visibility = View.VISIBLE rvMsgBoxList.scrollToPosition(0) } @@ -136,7 +86,7 @@ class DriverMsgBoxListView @JvmOverloads constructor( if(ipcReportList == null){ rvMsgBoxList.visibility = View.GONE }else{ - driverMsgBoxListAdapter.setData(ipcReportList.reversed()) + driverMsgBoxListAdapter?.setData(ipcReportList!!) rvMsgBoxList.visibility = View.VISIBLE rvMsgBoxList.scrollToPosition(0) } @@ -154,7 +104,7 @@ class DriverMsgBoxListView @JvmOverloads constructor( if(badCaseList == null){ rvMsgBoxList.visibility = View.GONE }else{ - driverMsgBoxListAdapter.setData(badCaseList.reversed()) + driverMsgBoxListAdapter?.setData(badCaseList!!) rvMsgBoxList.visibility = View.VISIBLE rvMsgBoxList.scrollToPosition(0) } @@ -162,4 +112,65 @@ class DriverMsgBoxListView @JvmOverloads constructor( } + fun notifyData(){ + val localNoticeList = MsgBoxConfig.noticeList.reversed() + noticeList?.addAll(0,localNoticeList) + val localSysInfoList = MsgBoxConfig.systemInfoList.reversed() + ipcReportList?.addAll(0,localSysInfoList) + val localRecordList = MsgBoxConfig.recordBagList.reversed() + badCaseList?.addAll(0,localRecordList) + + //获取当前Tab选择 + when(MsgBoxConfig.getUserRecord()){ + 0 ->{ + tvMsgNotice.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.VISIBLE + viewIpcReportDivider.visibility = View.GONE + viewBadCaseDivider.visibility = View.GONE + if(noticeList==null){ + rvMsgBoxList.visibility = View.GONE + }else{ + driverMsgBoxListAdapter?.setData(noticeList!!) + rvMsgBoxList.visibility = View.VISIBLE + rvMsgBoxList.scrollToPosition(0) + } + } + 1 ->{ + tvMsgNotice.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 + viewIpcReportDivider.visibility = View.VISIBLE + viewBadCaseDivider.visibility = View.GONE + if(ipcReportList == null){ + rvMsgBoxList.visibility = View.GONE + }else{ + driverMsgBoxListAdapter?.setData(ipcReportList!!) + rvMsgBoxList.visibility = View.VISIBLE + rvMsgBoxList.scrollToPosition(0) + } + } + 2 ->{ + tvMsgNotice.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 + viewIpcReportDivider.visibility = View.GONE + viewBadCaseDivider.visibility = View.VISIBLE + if(badCaseList == null){ + rvMsgBoxList.visibility = View.GONE + }else{ + driverMsgBoxListAdapter?.setData(badCaseList!!) + rvMsgBoxList.visibility = View.VISIBLE + rvMsgBoxList.scrollToPosition(0) + } + } + } + + } + + + } \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_box_ipc_report.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_box_ipc_report.xml index 9d45f5fa4d..e8b8e20594 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_box_ipc_report.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_box_ipc_report.xml @@ -3,7 +3,7 @@ android:layout_width="804px" android:layout_height="wrap_content" xmlns:app="http://schemas.android.com/apk/res-auto" - android:background="#1B2966" + android:background="#1A2344" app:roundLayoutRadius="24px" android:layout_gravity="center_horizontal" android:layout_marginStart="30px" diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_box_notice.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_box_notice.xml index 1ec5a50a3d..01f7a31bb5 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_box_notice.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_box_notice.xml @@ -3,7 +3,7 @@ android:layout_width="804px" android:layout_height="160px" xmlns:app="http://schemas.android.com/apk/res-auto" - android:background="#1B2966" + android:background="#1A2344" app:roundLayoutRadius="24px" android:layout_gravity="center_horizontal" android:layout_marginStart="30px" diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_box_operation.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_box_operation.xml index 8eb878c3d8..fef87734b7 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_box_operation.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_box_operation.xml @@ -3,7 +3,7 @@ android:layout_width="804px" android:layout_height="wrap_content" xmlns:app="http://schemas.android.com/apk/res-auto" - android:background="#1B2966" + android:background="#1A2344" app:roundLayoutRadius="24px" android:layout_gravity="center_horizontal" android:layout_marginStart="30px" @@ -119,7 +119,8 @@ app:layout_constraintLeft_toLeftOf="@id/ivOperationImageOpen" app:layout_constraintRight_toRightOf="@id/tvOperationStatusSelect" android:gravity="start" - android:layout_margin="20px" + android:layout_marginTop="15px" + android:layout_marginBottom="15px" android:textColor="#B3FFFFFF" android:textSize="28px" android:visibility="gone" diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_box_v2x.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_box_v2x.xml index 552ad98197..8c81479dc8 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_box_v2x.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_box_v2x.xml @@ -3,7 +3,7 @@ android:layout_width="804px" android:layout_height="160px" xmlns:app="http://schemas.android.com/apk/res-auto" - android:background="#1B2966" + android:background="#1A2344" app:roundLayoutRadius="24px" android:layout_gravity="center_horizontal" android:layout_marginStart="30px" diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_bubble_operation.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_bubble_operation.xml index cf5281b473..f05c473d7e 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_bubble_operation.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_bubble_operation.xml @@ -3,7 +3,7 @@ android:layout_width="804px" android:layout_height="160px" xmlns:app="http://schemas.android.com/apk/res-auto" - android:background="#1B2966" + android:background="#1A2344" app:roundLayoutRadius="24px" android:layout_gravity="center_horizontal" android:layout_marginStart="30px" diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_bubble_report.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_bubble_report.xml index 1737bbf3af..ef88df2f4e 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_bubble_report.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_bubble_report.xml @@ -3,7 +3,7 @@ android:layout_width="804px" android:layout_height="160px" xmlns:app="http://schemas.android.com/apk/res-auto" - android:background="#1B2966" + android:background="#1A2344" app:roundLayoutRadius="24px" android:layout_gravity="center_horizontal" android:layout_marginStart="30px" diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_driver_msg_box_bubble.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_driver_msg_box_bubble.xml index 967b30a914..d19a8b43e1 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_driver_msg_box_bubble.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_driver_msg_box_bubble.xml @@ -3,7 +3,7 @@ android:layout_width="864px" android:layout_height="wrap_content" xmlns:app="http://schemas.android.com/apk/res-auto" - android:background="#3C4783" + android:background="#2E3868" app:roundLayoutRadius="40px">