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 9b9166f286..b8b18d6aa7 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 @@ -268,6 +268,7 @@ class MoGoHmiFragment : MvpFragment(), if(isChecked){ viewPassengerMsgBoxList.visibility = View.VISIBLE viewPassengerMsgBoxBubble.visibility = View.GONE + viewPassengerMsgBoxList.notifyData() }else{ viewPassengerMsgBoxList.visibility = View.GONE viewPassengerMsgBoxBubble.visibility = View.VISIBLE 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 132c596908..bc557a33ca 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 @@ -69,12 +69,16 @@ class DriverMsgBoxBubbleView @JvmOverloads constructor( override fun onDataChanged(category: MsgCategory, msgBoxBean: MsgBoxBean) { UiThreadHandler.post { CallerHmiManager.updateDriverMsgBoxTipView(true) - if(category == MsgCategory.NOTICE){ - MsgBoxConfig.noticeList.add(msgBoxBean) - }else if(category == MsgCategory.SYS_INFO){ - MsgBoxConfig.systemInfoList.add(msgBoxBean) - }else if(category == MsgCategory.RECORD_BAG){ - MsgBoxConfig.recordBagList.add(msgBoxBean) + when (category) { + MsgCategory.NOTICE -> { + MsgBoxConfig.noticeList.add(msgBoxBean) + } + MsgCategory.SYS_INFO -> { + MsgBoxConfig.systemInfoList.add(msgBoxBean) + } + MsgCategory.RECORD_BAG -> { + MsgBoxConfig.recordBagList.add(msgBoxBean) + } } if(category == MsgCategory.RECORD_BAG){ //弹出被动录包弹窗 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 582a899c72..ea7f8bab64 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 @@ -17,6 +17,7 @@ import com.mogo.eagle.core.function.api.msgbox.IMsgBoxListener import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxListenerManager import com.mogo.eagle.core.function.hmi.R import com.mogo.eagle.core.function.hmi.ui.msgbox.adapter.PassengerMsgBoxBubbleAdapter +import com.mogo.eagle.core.function.msgbox.MsgBoxConfig import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils import com.mogo.eagle.core.utilcode.util.BarUtils import com.mogo.eagle.core.utilcode.util.UiThreadHandler @@ -44,13 +45,11 @@ class PassengerMsgBoxBubbleView @JvmOverloads constructor( private fun initView(){ val linearLayoutManager = LinearLayoutManager(context) linearLayoutManager.orientation = LinearLayoutManager.VERTICAL - linearLayoutManager.stackFromEnd = true - linearLayoutManager.reverseLayout = true +// linearLayoutManager.stackFromEnd = true +// linearLayoutManager.reverseLayout = true passengerMsgBoxBubbleAdapter = PassengerMsgBoxBubbleAdapter(context as Activity) rvPassengerBubbleList.adapter = passengerMsgBoxBubbleAdapter rvPassengerBubbleList.layoutManager = linearLayoutManager - -// setData() } override fun onDataChanged(category: MsgCategory, msgBoxList: MsgBoxBean) { @@ -60,22 +59,12 @@ class PassengerMsgBoxBubbleView @JvmOverloads constructor( || msgBoxList.type == MsgBoxType.OBU){ dataList.add(msgBoxList) passengerMsgBoxBubbleAdapter?.setData(dataList) + MsgBoxConfig.noticeList.add(msgBoxList) } } } } -// fun setData(){ -// val list :ArrayList = ArrayList() -// val one = MsgBoxBean(MsgBoxType.OPERATION, OperationMsg(System.currentTimeMillis(),"测试")) -// val two = MsgBoxBean(MsgBoxType.OPERATION, OperationMsg(System.currentTimeMillis(),"测试")) -// val three = MsgBoxBean(MsgBoxType.OPERATION, OperationMsg(System.currentTimeMillis(),"测试")) -// list.add(one) -// list.add(two) -// list.add(three) -// passengerMsgBoxBubbleAdapter?.setData(list) -// } - override fun onAttachedToWindow() { super.onAttachedToWindow() if(AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode) && diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/PassengerMsgBoxListView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/PassengerMsgBoxListView.kt index da5e6580b6..9b231d917b 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/PassengerMsgBoxListView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/PassengerMsgBoxListView.kt @@ -13,6 +13,7 @@ import com.mogo.eagle.core.data.msgbox.V2XMsg 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.adapter.PassengerMsgBoxListAdapter +import com.mogo.eagle.core.function.msgbox.MsgBoxConfig import com.mogo.eagle.core.utilcode.util.ResourceUtils.getDrawable import kotlinx.android.synthetic.main.layout_passenger_msg_box_list.view.* @@ -28,6 +29,7 @@ class PassengerMsgBoxListView @JvmOverloads constructor( ) : ConstraintLayout(context, attrs, defStyleAttr){ var passengerMsgBoxListAdapter: PassengerMsgBoxListAdapter ?= null + private var noticeList: ArrayList ?= null init{ LayoutInflater.from(context).inflate(R.layout.layout_passenger_msg_box_list, this, true) @@ -44,23 +46,20 @@ class PassengerMsgBoxListView @JvmOverloads constructor( rvPassengerList.layoutManager = linearLayoutManager rvPassengerList.addItemDecoration(divider) //获取通知消息列表 - val noticeList: List? = CallerMsgBoxManager.getCachedNotifyData() + noticeList= CallerMsgBoxManager.getCachedNotifyData() as ArrayList? + noticeList?.reversed() noticeList?.let { - passengerMsgBoxListAdapter?.setData(it.reversed()) + passengerMsgBoxListAdapter?.setData(it) } -// setData() } - fun setData(){ - val list :ArrayList = ArrayList() - val one = MsgBoxBean(MsgBoxType.V2X, V2XMsg("","ceshiyixa")) - val two = MsgBoxBean(MsgBoxType.OPERATION, V2XMsg("","ceshiyixa1")) - val three = MsgBoxBean(MsgBoxType.OPERATION, V2XMsg("","ceshiyixa2")) - list.add(one) - list.add(two) - list.add(three) - passengerMsgBoxListAdapter?.setData(list) + fun notifyData(){ + val localNoticeList = MsgBoxConfig.noticeList.reversed() + noticeList?.addAll(0,localNoticeList) + noticeList?.let { + passengerMsgBoxListAdapter?.setData(it) + } } } \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/fragment_hmi.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/fragment_hmi.xml index c39b378c34..1017310fd2 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/fragment_hmi.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/fragment_hmi.xml @@ -244,7 +244,7 @@ \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_passenger_msg_list_v2x.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_passenger_msg_list_v2x.xml index 6dfe51625c..0e8088cae4 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_passenger_msg_list_v2x.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_passenger_msg_list_v2x.xml @@ -20,7 +20,7 @@ app:layout_constraintTop_toTopOf="parent" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintRight_toRightOf="parent" - android:textColor="#FFFFFFFF" + android:textColor="#99FFFFFF" android:textSize="26px" /> @@ -37,6 +37,8 @@ android:ellipsize="end" android:textColor="#FFFFFFFF" android:textSize="36px" + android:layout_marginStart="25px" + android:layout_marginEnd="25px" /> \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_passenger_msg_box_list.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_passenger_msg_box_list.xml index d85fde31aa..7c37044c4e 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_passenger_msg_box_list.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_passenger_msg_box_list.xml @@ -13,8 +13,8 @@ app:layout_constraintTop_toTopOf="parent" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="parent" - android:layout_marginStart="20px" - android:layout_marginEnd="20px" + android:layout_marginStart="30px" + android:layout_marginEnd="30px" /> \ No newline at end of file