Merge branch 'dev_robotaxi-d-app-module_2130_221116_2.13.0' into mutidev_robotaxi-d-app-module_2130_221116_2.13.0_multi_display

This commit is contained in:
donghongyu
2022-12-06 12:04:23 +08:00
23 changed files with 274 additions and 245 deletions

View File

@@ -270,7 +270,6 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
if(isChecked){
viewPassengerMsgBoxList.visibility = View.VISIBLE
viewPassengerMsgBoxBubble.visibility = View.GONE
viewPassengerMsgBoxList.notifyData()
viewPassengerMsgBoxBubble.isShowData(false)
CallerHmiManager.updatePassengerMsgBoxTipView(false)
}else{

View File

@@ -3,15 +3,24 @@ package com.mogo.eagle.core.function.hmi.ui.msgbox
import android.app.Activity
import android.content.Context
import android.util.AttributeSet
import android.util.Log
import android.view.LayoutInflater
import android.view.View
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.MsgCategory
import com.mogo.eagle.core.data.msgbox.OperationMsg
import com.mogo.eagle.core.function.api.msgbox.IMsgBoxListener
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxListenerManager
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.DriverMsgBoxListAdapter
import com.mogo.eagle.core.function.msgbox.MsgBoxConfig
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
import com.mogo.eagle.core.utilcode.util.TimeUtils
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
import kotlinx.android.synthetic.main.layout_driver_msg_box_list.view.*
/**
@@ -23,13 +32,13 @@ class DriverMsgBoxListView @JvmOverloads constructor(
context: Context,
attrs: AttributeSet? = null,
defStyleAttr: Int = 0
) : ConstraintLayout(context, attrs, defStyleAttr){
) : ConstraintLayout(context, attrs, defStyleAttr) , IMsgBoxListener {
init {
LayoutInflater.from(context).inflate(R.layout.layout_driver_msg_box_list, this, true)
initView()
}
private val TAG = "DriverMsgBoxListView"
private var noticeList: ArrayList<MsgBoxBean> ?= null
private var ipcReportList: ArrayList<MsgBoxBean> ?= null
private var badCaseList: ArrayList<MsgBoxBean> ?= null
@@ -42,10 +51,13 @@ class DriverMsgBoxListView @JvmOverloads constructor(
//获取通知消息列表
noticeList= CallerMsgBoxManager.getCachedNotifyData() as ArrayList<MsgBoxBean>?
noticeList = noticeList?.let { ArrayList(it.reversed()) }
//获取车辆系统信息列表
ipcReportList = CallerMsgBoxManager.getCachedSysInfoData() as ArrayList<MsgBoxBean>?
ipcReportList = ipcReportList?.let { ArrayList(it.reversed()) }
//获取录包信息列表
badCaseList = CallerMsgBoxManager.getCachedRecordBagData() as ArrayList<MsgBoxBean>?
badCaseList = badCaseList?.let { ArrayList(it.reversed()) }
//通知
tvMsgNotice.setOnClickListener {
tvMsgNotice.setTextColor(resources.getColor(R.color.msg_box_title_color))
@@ -103,14 +115,6 @@ 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 ->{
@@ -162,6 +166,35 @@ class DriverMsgBoxListView @JvmOverloads constructor(
}
override fun onDataChanged(category: MsgCategory, msgBoxList: MsgBoxBean) {
UiThreadHandler.post{
when (category) {
MsgCategory.NOTICE -> {
noticeList?.add(0,msgBoxList)
}
MsgCategory.SYS_INFO -> {
ipcReportList?.add(0,msgBoxList)
}
MsgCategory.RECORD_BAG -> {
badCaseList?.add(0,msgBoxList)
}
}
}
}
override fun onAttachedToWindow() {
super.onAttachedToWindow()
if(AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)){
CallerMsgBoxListenerManager.addListener(TAG,this)
}
}
override fun onDetachedFromWindow() {
super.onDetachedFromWindow()
if(AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)){
CallerMsgBoxListenerManager.removeListener(TAG)
}
}
}

View File

@@ -7,14 +7,18 @@ import android.view.LayoutInflater
import androidx.constraintlayout.widget.ConstraintLayout
import androidx.recyclerview.widget.DividerItemDecoration
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.MsgBoxType
import com.mogo.eagle.core.data.msgbox.V2XMsg
import com.mogo.eagle.core.data.msgbox.MsgCategory
import com.mogo.eagle.core.function.api.msgbox.IMsgBoxListener
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxListenerManager
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.mogo.AppIdentityModeUtils
import com.mogo.eagle.core.utilcode.util.ResourceUtils.getDrawable
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
import kotlinx.android.synthetic.main.layout_passenger_msg_box_list.view.*
/**
@@ -26,8 +30,9 @@ class PassengerMsgBoxListView @JvmOverloads constructor(
context: Context,
attrs: AttributeSet? = null,
defStyleAttr: Int = 0
) : ConstraintLayout(context, attrs, defStyleAttr){
) : ConstraintLayout(context, attrs, defStyleAttr), IMsgBoxListener {
private val TAG = "PassengerMsgBoxListView"
var passengerMsgBoxListAdapter: PassengerMsgBoxListAdapter ?= null
private var noticeList: ArrayList<MsgBoxBean> ?= null
@@ -47,18 +52,40 @@ class PassengerMsgBoxListView @JvmOverloads constructor(
rvPassengerList.addItemDecoration(divider)
//获取通知消息列表
noticeList= CallerMsgBoxManager.getCachedNotifyData() as ArrayList<MsgBoxBean>?
noticeList?.reversed()
noticeList = noticeList?.let { ArrayList(it.reversed()) }
noticeList?.let {
passengerMsgBoxListAdapter?.setData(it)
}
}
fun notifyData(){
val localNoticeList = MsgBoxConfig.noticeList.reversed()
noticeList?.addAll(0,localNoticeList)
noticeList?.let {
passengerMsgBoxListAdapter?.setData(it)
override fun onDataChanged(category: MsgCategory, msgBoxList: MsgBoxBean) {
UiThreadHandler.post{
if(category == MsgCategory.NOTICE){
if(msgBoxList.type == MsgBoxType.NOTICE || msgBoxList.type == MsgBoxType.V2X
|| msgBoxList.type == MsgBoxType.OBU){
noticeList?.add(0,msgBoxList)
noticeList?.let {
passengerMsgBoxListAdapter?.setData(it)
}
}
}
}
}
override fun onAttachedToWindow() {
super.onAttachedToWindow()
if(AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode) &&
AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode)){
CallerMsgBoxListenerManager.addListener(TAG,this)
}
}
override fun onDetachedFromWindow() {
super.onDetachedFromWindow()
if(AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode) &&
AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode)){
CallerMsgBoxListenerManager.removeListener(TAG)
}
}

View File

@@ -106,11 +106,6 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
return R.layout.module_main_activity_main;
}
@Override
protected void beforeSetContentView(Bundle savedInstanceState) {
init();
}
@Override
protected void initViews() {
injectStatusBar();
@@ -152,16 +147,6 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
decorView.addView(statusBarView, statusBarLP);
}
// 隐藏布局
protected void hideLayout() {
mFloatingLayout.setVisibility(View.GONE);
}
// 显示布局
protected void showLayout() {
mFloatingLayout.setVisibility(View.VISIBLE);
}
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
@@ -187,7 +172,6 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
AppLaunchTimeUtils.beginTimeCalculate(AppLaunchTimeUtils.HOT_START);
}
@Override
public void onWindowFocusChanged(boolean hasFocus) {
super.onWindowFocusChanged(hasFocus);
@@ -216,10 +200,6 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
}
}
private void init() {
MogoStatusManager.getInstance().setMainPageLaunchedStatus(TAG, true);
}
private void initConnectInfoRV() {
mConnAdapter = new ConnInfoAdapter(this, dataList);
mConnectInfoRV.setLayoutManager(new LinearLayoutManager(this));
@@ -464,7 +444,6 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
if (mapUIController != null) {
mapUIController.destroy();
}
MogoStatusManager.getInstance().setMainPageLaunchedStatus(TAG, false);
MogoStatusManager.getInstance().setMainPageIsBackgroundStatus(TAG, false);
CallerLogger.INSTANCE.d(M_HMI + TAG, "destroy.");

View File

@@ -23,7 +23,7 @@ import com.mogo.eagle.core.function.main.constants.MainConstants;
*/
public class MainPresenter extends Presenter<MainView> {
private Handler mMsgHandler = new Handler(Looper.getMainLooper()) {
private final Handler mMsgHandler = new Handler(Looper.getMainLooper()) {
@Override
public void handleMessage(Message msg) {
super.handleMessage(msg);