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-01 15:20:13 +08:00
27 changed files with 391 additions and 195 deletions

View File

@@ -172,8 +172,6 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
private var reportListFloatWindow: ReportListFloatWindow? = null
private var ipcReportWindow: IPCReportWindow? = null
private var passengerMsgBoxBubbleView: PassengerMsgBoxBubbleView ?= null
private var adUpgradeDialog: AdUpgradeDialog? = null
private var lastSpeakJob: Job? = null
@@ -304,6 +302,7 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
if(isChecked){
viewDriverMsgBoxList.visibility = View.VISIBLE
viewDriverMsgBoxBubble.visibility = View.GONE
CallerHmiManager.updateDriverMsgBoxTipView(false)
}else{
viewDriverMsgBoxList.visibility = View.GONE
viewDriverMsgBoxBubble.visibility = View.VISIBLE
@@ -499,6 +498,14 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
statusBarView?.updateRightView(insert, tag, viewGroup)
}
override fun updateDriverMsgBoxTipView(show: Boolean) {
if(show){
MsgBoxTipView.visibility = View.VISIBLE
}else{
MsgBoxTipView.visibility = View.GONE
}
}
/**
* 设置 红绿灯 代理View
*/

View File

@@ -9,15 +9,19 @@ import android.widget.LinearLayout
import androidx.constraintlayout.widget.ConstraintLayout
import androidx.core.view.marginTop
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.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.devatools.CallerDevaToolsManager
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
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.DriverMsgBoxBubbleAdapter
import com.mogo.eagle.core.function.msgbox.MsgBoxConfig
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
import kotlinx.android.synthetic.main.layout_driver_msg_box_bubble.view.*
@@ -55,6 +59,14 @@ 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)
}
if(category == MsgCategory.RECORD_BAG){
//弹出被动录包弹窗
CallerDevaToolsManager.onReceiveBadCaseRecord(msgBoxBean,context as Activity,true)
@@ -67,12 +79,16 @@ class DriverMsgBoxBubbleView @JvmOverloads constructor(
override fun onAttachedToWindow() {
super.onAttachedToWindow()
CallerMsgBoxListenerManager.addListener(TAG,this)
if(AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)){
CallerMsgBoxListenerManager.addListener(TAG,this)
}
}
override fun onDetachedFromWindow() {
super.onDetachedFromWindow()
CallerMsgBoxListenerManager.removeListener(TAG)
if(AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)){
CallerMsgBoxListenerManager.removeListener(TAG)
}
}
// var i = 0

View File

@@ -17,6 +17,7 @@ import com.mogo.eagle.core.data.report.ReportEntity
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 kotlinx.android.synthetic.main.layout_driver_msg_box_list.view.*
/**
@@ -39,17 +40,72 @@ class DriverMsgBoxListView @JvmOverloads constructor(
val driverMsgBoxListAdapter= DriverMsgBoxListAdapter(context as Activity)
rvMsgBoxList.adapter = driverMsgBoxListAdapter
rvMsgBoxList.layoutManager = LinearLayoutManager(context)
//获取通知消息列表
val noticeList: List<MsgBoxBean>? = CallerMsgBoxManager.getCachedNotifyData()
if(noticeList==null){
rvMsgBoxList.visibility = View.GONE
}else{
driverMsgBoxListAdapter.setData(noticeList)
rvMsgBoxList.visibility = View.VISIBLE
rvMsgBoxList.scrollToPosition(0)
val noticeList: ArrayList<MsgBoxBean>? = CallerMsgBoxManager.getCachedNotifyData() as ArrayList<MsgBoxBean>?
noticeList?.addAll(MsgBoxConfig.noticeList)
//获取车辆系统信息列表
val ipcReportList: ArrayList<MsgBoxBean>? = CallerMsgBoxManager.getCachedSysInfoData() as ArrayList<MsgBoxBean>?
ipcReportList?.addAll(MsgBoxConfig.systemInfoList)
//获取录包信息列表
val badCaseList: ArrayList<MsgBoxBean>? = CallerMsgBoxManager.getCachedRecordBagData() as ArrayList<MsgBoxBean>?
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)
}
}
}
//通知
tvMsgNotice.setOnClickListener {
tvMsgNotice.setTextColor(resources.getColor(R.color.msg_box_title_color))
@@ -58,8 +114,7 @@ class DriverMsgBoxListView @JvmOverloads constructor(
viewNoticeDivider.visibility = View.VISIBLE
viewIpcReportDivider.visibility = View.GONE
viewBadCaseDivider.visibility = View.GONE
//获取通知消息列表
val noticeList: List<MsgBoxBean>? = CallerMsgBoxManager.getCachedNotifyData()
MsgBoxConfig.setUserRecord(0)
if(noticeList==null){
rvMsgBoxList.visibility = View.GONE
}else{
@@ -68,23 +123,6 @@ class DriverMsgBoxListView @JvmOverloads constructor(
rvMsgBoxList.scrollToPosition(0)
}
// val nList: ArrayList<MsgBoxBean> = ArrayList()
// val one = MsgBoxBean(MsgBoxType.OPERATION, OperationMsg(System.currentTimeMillis(),"通知1",2))
// val two = MsgBoxBean(MsgBoxType.OPERATION, OperationMsg(System.currentTimeMillis(),"通知2",2))
// val three = MsgBoxBean(MsgBoxType.OPERATION, OperationMsg(System.currentTimeMillis(),"通知3",2))
// val four = MsgBoxBean(MsgBoxType.OPERATION, OperationMsg(System.currentTimeMillis(),"通知4",2))
// val five = MsgBoxBean(MsgBoxType.OPERATION, OperationMsg(System.currentTimeMillis(),"通知5",2))
// val normalData = NoticeNormalData()
// normalData.content = "测试数据"
// val six = MsgBoxBean(MsgBoxType.NOTICE, normalData)
//
// nList.add(one)
// nList.add(two)
// nList.add(three)
// nList.add(four)
// nList.add(five)
// nList.add(six)
// driverMsgBoxListAdapter.setData(nList)
}
//车辆系统信息
tvMsgIpcReport.setOnClickListener {
@@ -94,9 +132,7 @@ class DriverMsgBoxListView @JvmOverloads constructor(
viewNoticeDivider.visibility = View.GONE
viewIpcReportDivider.visibility = View.VISIBLE
viewBadCaseDivider.visibility = View.GONE
//获取车辆系统信息列表
val ipcReportList: List<MsgBoxBean>? = CallerMsgBoxManager.getCachedSysInfoData()
MsgBoxConfig.setUserRecord(1)
if(ipcReportList == null){
rvMsgBoxList.visibility = View.GONE
}else{
@@ -105,37 +141,6 @@ class DriverMsgBoxListView @JvmOverloads constructor(
rvMsgBoxList.scrollToPosition(0)
}
// val ipcList: ArrayList<MsgBoxBean> = ArrayList()
// val resultList:ArrayList<String> = ArrayList()
// resultList.add("RESULT_AUTOPILOT_DISABLE")
// val result:ArrayList<String> = ArrayList()
// result.add("RESULT_AUTOPILOT_INFERIOR")
// val one = ReportEntity(System.currentTimeMillis().toString(),"","","自动驾驶失败1","code",
// resultList,resultList)
// val beanOne = MsgBoxBean(MsgBoxType.REPORT,one)
// beanOne.timestamp = System.currentTimeMillis()
// val two = ReportEntity(System.currentTimeMillis().toString(),"","","自动驾驶失败2","code",
// resultList,resultList)
// val beanTwo = MsgBoxBean(MsgBoxType.REPORT,two)
// beanTwo.timestamp = System.currentTimeMillis()
// val three = ReportEntity(System.currentTimeMillis().toString(),"","","自动驾驶失败3","code",
// resultList,resultList)
// val beanThree = MsgBoxBean(MsgBoxType.REPORT,three)
// beanThree.timestamp = System.currentTimeMillis()
// val four = ReportEntity(System.currentTimeMillis().toString(),"","","自动驾驶失败4","code",
// resultList,resultList)
// val beanFour = MsgBoxBean(MsgBoxType.REPORT,four)
// beanFour.timestamp = System.currentTimeMillis()
// val five = ReportEntity(System.currentTimeMillis().toString(),"","","自动驾驶失败5","code",
// result,result)
// val beanFive = MsgBoxBean(MsgBoxType.REPORT,five)
// beanFive.timestamp = System.currentTimeMillis()
// ipcList.add(beanOne)
// ipcList.add(beanTwo)
// ipcList.add(beanThree)
// ipcList.add(beanFour)
// ipcList.add(beanFive)
// driverMsgBoxListAdapter.setData(ipcList)
}
//录包
tvMsgBadCase.setOnClickListener {
@@ -145,9 +150,7 @@ class DriverMsgBoxListView @JvmOverloads constructor(
viewNoticeDivider.visibility = View.GONE
viewIpcReportDivider.visibility = View.GONE
viewBadCaseDivider.visibility = View.VISIBLE
//获取录包信息列表
val badCaseList: List<MsgBoxBean>? = CallerMsgBoxManager.getCachedRecordBagData()
MsgBoxConfig.setUserRecord(2)
if(badCaseList == null){
rvMsgBoxList.visibility = View.GONE
}else{
@@ -155,28 +158,8 @@ class DriverMsgBoxListView @JvmOverloads constructor(
rvMsgBoxList.visibility = View.VISIBLE
rvMsgBoxList.scrollToPosition(0)
}
// val list : ArrayList<MsgBoxBean> = ArrayList()
// val one = MsgBoxBean(MsgBoxType.RECORD, RecordBagMsg(3457774,1,235,2,"",""))
// one.timestamp = System.currentTimeMillis()
// val two = MsgBoxBean(MsgBoxType.RECORD, RecordBagMsg(3457774,1,235,2,"",""))
// two.timestamp = System.currentTimeMillis()
// val three = MsgBoxBean(MsgBoxType.RECORD, RecordBagMsg(3457774,1,235,2,"",""))
// three.timestamp = System.currentTimeMillis()
// val four = MsgBoxBean(MsgBoxType.RECORD, RecordBagMsg(3457774,1,235,2,"",""))
// four.timestamp = System.currentTimeMillis()
// val five = MsgBoxBean(MsgBoxType.RECORD, RecordBagMsg(3457774,1,235,2,"",""))
// five.timestamp = System.currentTimeMillis()
//
// list.add(one)
// list.add(two)
// list.add(three)
// list.add(four)
// list.add(five)
// driverMsgBoxListAdapter.setData(list)
}
}
}

View File

@@ -8,6 +8,7 @@ import android.util.DisplayMetrics
import android.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.MsgBoxType
import com.mogo.eagle.core.data.msgbox.MsgCategory
@@ -16,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.utilcode.mogo.AppIdentityModeUtils
import com.mogo.eagle.core.utilcode.util.BarUtils
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
import kotlinx.android.synthetic.main.layout_passenger_msg_box_bubble.view.*
@@ -76,12 +78,18 @@ class PassengerMsgBoxBubbleView @JvmOverloads constructor(
override fun onAttachedToWindow() {
super.onAttachedToWindow()
CallerMsgBoxListenerManager.addListener(TAG,this)
if(AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode) &&
AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode)){
CallerMsgBoxListenerManager.addListener(TAG,this)
}
}
override fun onDetachedFromWindow() {
super.onDetachedFromWindow()
CallerMsgBoxListenerManager.removeListener(TAG)
if(AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode) &&
AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode)){
CallerMsgBoxListenerManager.removeListener(TAG)
}
}
}

View File

@@ -9,10 +9,7 @@ import android.widget.ImageView
import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView
import com.mogo.eagle.core.data.enums.EventTypeEnum
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
import com.mogo.eagle.core.data.msgbox.MsgBoxType
import com.mogo.eagle.core.data.msgbox.OperationMsg
import com.mogo.eagle.core.data.msgbox.V2XMsg
import com.mogo.eagle.core.data.msgbox.*
import com.mogo.eagle.core.data.notice.NoticeNormalData
import com.mogo.eagle.core.data.report.ReportEntity
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager
@@ -84,18 +81,39 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A
}
}else if(holder is BubbleNoticeHolder){
data?.let {
val noticeNormalData = it[position].bean as NoticeNormalData
holder.tvNoticeTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat())
holder.tvNoticeContent.text = noticeNormalData.content
GlideApp.with(activity).load(noticeNormalData.imageUrl).optionalTransform(
GlideRoundedCornersTransform(
20f,
GlideRoundedCornersTransform.CornerType.ALL
)
).into(holder.ivNoticeImage)
holder.tvNoticeCheck.setOnClickListener {
//云公告
CallerHmiManager.showNoticeNormalData(noticeNormalData)
val noticeFrCloudMsg = it[position].bean as NoticeFrCloudMsg
if(noticeFrCloudMsg.type == 0){
val noticeNormalData = noticeFrCloudMsg.noticeNormalData
holder.tvNoticeTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat())
holder.tvNoticeContent.text = noticeNormalData?.content
GlideApp.with(activity).load(noticeNormalData?.imageUrl).optionalTransform(
GlideRoundedCornersTransform(
20f,
GlideRoundedCornersTransform.CornerType.ALL
)
).into(holder.ivNoticeImage)
holder.tvNoticeCheck.setOnClickListener {
//云公告
if (noticeNormalData != null) {
CallerHmiManager.showNoticeNormalData(noticeNormalData)
}
}
}else if(noticeFrCloudMsg.type == 1){
val noticeTrafficStylePushData = noticeFrCloudMsg.trafficPushData
holder.tvNoticeTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat())
holder.tvNoticeContent.text = noticeTrafficStylePushData?.content
GlideApp.with(activity).load(noticeTrafficStylePushData?.poiImgUrl).optionalTransform(
GlideRoundedCornersTransform(
20f,
GlideRoundedCornersTransform.CornerType.ALL
)
).into(holder.ivNoticeImage)
holder.tvNoticeCheck.setOnClickListener {
//云公告
if (noticeTrafficStylePushData != null) {
CallerHmiManager.showTrafficBanner(noticeTrafficStylePushData)
}
}
}
}
}else if(holder is BubbleV2XHolder){

View File

@@ -172,19 +172,37 @@ class DriverMsgBoxListAdapter(private val activity: Activity) : RecyclerView.Ada
}
}else if(holder is MsgBoxNotice){
data?.let {
val noticeNormalData = it[position].bean as NoticeNormalData
holder.tvNoticeTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat())
holder.tvNoticeContent.text = noticeNormalData.content
GlideApp.with(activity).load(noticeNormalData.imageUrl).optionalTransform(
GlideRoundedCornersTransform(
20f,
GlideRoundedCornersTransform.CornerType.ALL
)
).into(holder.ivNoticeImage)
holder.tvNoticeCheck.setOnClickListener {
//云公告
CallerHmiManager.showNoticeNormalData(noticeNormalData)
val noticeFrCloudMsg = it[position].bean as NoticeFrCloudMsg
if(noticeFrCloudMsg.type == 0){
val noticeNormalData = noticeFrCloudMsg.noticeNormalData
holder.tvNoticeTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat())
holder.tvNoticeContent.text = noticeNormalData?.content
GlideApp.with(activity).load(noticeNormalData?.imageUrl).optionalTransform(
GlideRoundedCornersTransform(
20f,
GlideRoundedCornersTransform.CornerType.ALL
)
).into(holder.ivNoticeImage)
holder.tvNoticeCheck.setOnClickListener {
//云公告
noticeNormalData?.let { it1 -> CallerHmiManager.showNoticeNormalData(it1) }
}
}else if(noticeFrCloudMsg.type == 1){
val noticeTrafficStylePushData = noticeFrCloudMsg.trafficPushData
holder.tvNoticeTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat())
holder.tvNoticeContent.text = noticeTrafficStylePushData?.content
GlideApp.with(activity).load(noticeTrafficStylePushData?.poiImgUrl).optionalTransform(
GlideRoundedCornersTransform(
20f,
GlideRoundedCornersTransform.CornerType.ALL
)
).into(holder.ivNoticeImage)
holder.tvNoticeCheck.setOnClickListener {
//云公告
noticeTrafficStylePushData?.let { it1 -> CallerHmiManager.showTrafficBanner(it1) }
}
}
}
}else if(holder is MsgBoxV2X){
data?.let {

View File

@@ -11,6 +11,7 @@ import androidx.recyclerview.widget.RecyclerView
import com.mogo.eagle.core.data.enums.EventTypeEnum
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
import com.mogo.eagle.core.data.msgbox.MsgBoxType
import com.mogo.eagle.core.data.msgbox.NoticeFrCloudMsg
import com.mogo.eagle.core.data.msgbox.V2XMsg
import com.mogo.eagle.core.utilcode.mogo.glide.GlideApp
import com.mogo.eagle.core.data.notice.NoticeNormalData
@@ -56,19 +57,37 @@ class PassengerMsgBoxBubbleAdapter(private val activity: Activity): RecyclerView
override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) {
if(holder is BubbleNoticeHolder){
data?.let {
val noticeNormalData = it[position].bean as NoticeNormalData
holder.tvPassengerNoticeTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat())
holder.tvPassengerNoticeContent.text = noticeNormalData.content
GlideApp.with(activity).load(noticeNormalData.imageUrl).optionalTransform(
GlideRoundedCornersTransform(
20f,
GlideRoundedCornersTransform.CornerType.ALL
)
).into(holder.ivPassengerNoticeImage)
holder.tvPassengerNoticeCheck.setOnClickListener {
//云公告
CallerHmiManager.showNoticeNormalData(noticeNormalData)
val noticeFrCloudMsg = it[position].bean as NoticeFrCloudMsg
if(noticeFrCloudMsg.type == 0){
val noticeNormalData = noticeFrCloudMsg.noticeNormalData
holder.tvPassengerNoticeTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat())
holder.tvPassengerNoticeContent.text = noticeNormalData?.content
GlideApp.with(activity).load(noticeNormalData?.imageUrl).optionalTransform(
GlideRoundedCornersTransform(
20f,
GlideRoundedCornersTransform.CornerType.ALL
)
).into(holder.ivPassengerNoticeImage)
holder.tvPassengerNoticeCheck.setOnClickListener {
//云公告
noticeNormalData?.let { it1 -> CallerHmiManager.showNoticeNormalData(it1) }
}
}else if(noticeFrCloudMsg.type == 1){
val noticeTrafficStylePushData = noticeFrCloudMsg.trafficPushData
holder.tvPassengerNoticeTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat())
holder.tvPassengerNoticeContent.text = noticeTrafficStylePushData?.content
GlideApp.with(activity).load(noticeTrafficStylePushData?.poiImgUrl).optionalTransform(
GlideRoundedCornersTransform(
20f,
GlideRoundedCornersTransform.CornerType.ALL
)
).into(holder.ivPassengerNoticeImage)
holder.tvPassengerNoticeCheck.setOnClickListener {
//云公告
noticeTrafficStylePushData?.let { it1 -> CallerHmiManager.showTrafficBanner(it1) }
}
}
}
}else if(holder is BubbleV2XHolder){
data?.let {

View File

@@ -10,6 +10,7 @@ import androidx.recyclerview.widget.RecyclerView
import com.mogo.eagle.core.data.enums.EventTypeEnum
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
import com.mogo.eagle.core.data.msgbox.MsgBoxType
import com.mogo.eagle.core.data.msgbox.NoticeFrCloudMsg
import com.mogo.eagle.core.data.msgbox.V2XMsg
import com.mogo.eagle.core.data.notice.NoticeNormalData
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
@@ -49,18 +50,35 @@ class PassengerMsgBoxListAdapter(private val activity: Activity): RecyclerView.A
override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) {
if(holder is ListNoticeHolder){
data?.let {
val noticeNormalData = it[position].bean as NoticeNormalData
holder.tvPassengerNoticeTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat())
holder.tvPassengerNoticeContent.text = noticeNormalData.content
GlideApp.with(activity).load(noticeNormalData.imageUrl).optionalTransform(
GlideRoundedCornersTransform(
20f,
GlideRoundedCornersTransform.CornerType.ALL
)
).into(holder.ivPassengerNoticeImage)
holder.tvPassengerNoticeCheck.setOnClickListener {
//云公告
CallerHmiManager.showNoticeNormalData(noticeNormalData)
val noticeFrCloudMsg = it[position].bean as NoticeFrCloudMsg
if(noticeFrCloudMsg.type == 0){
val noticeNormalData = noticeFrCloudMsg.noticeNormalData
holder.tvPassengerNoticeTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat())
holder.tvPassengerNoticeContent.text = noticeNormalData?.content
GlideApp.with(activity).load(noticeNormalData?.imageUrl).optionalTransform(
GlideRoundedCornersTransform(
20f,
GlideRoundedCornersTransform.CornerType.ALL
)
).into(holder.ivPassengerNoticeImage)
holder.tvPassengerNoticeCheck.setOnClickListener {
//云公告
noticeNormalData?.let { it1 -> CallerHmiManager.showNoticeNormalData(it1) }
}
}else if(noticeFrCloudMsg.type == 1){
val noticeTrafficStylePushData = noticeFrCloudMsg.trafficPushData
holder.tvPassengerNoticeTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat())
holder.tvPassengerNoticeContent.text = noticeTrafficStylePushData?.content
GlideApp.with(activity).load(noticeTrafficStylePushData?.poiImgUrl).optionalTransform(
GlideRoundedCornersTransform(
20f,
GlideRoundedCornersTransform.CornerType.ALL
)
).into(holder.ivPassengerNoticeImage)
holder.tvPassengerNoticeCheck.setOnClickListener {
//云公告
noticeTrafficStylePushData?.let { it1 -> CallerHmiManager.showTrafficBanner(it1) }
}
}
}
}else if(holder is ListV2XHolder){

View File

@@ -26,6 +26,7 @@ import com.mogo.commons.debug.DebugConfig
import com.mogo.eagle.core.data.app.AppConfigInfo
import com.mogo.eagle.core.data.autopilot.*
import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.data.config.HmiBuildConfig
import com.mogo.eagle.core.data.constants.MoGoConfig
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_BAG_RECORD
@@ -1136,6 +1137,13 @@ class DebugSettingView @JvmOverloads constructor(
}
}
/**
* 限速数据优先使用obu默认打开
*/
tbRoadLimitSpeed.setOnCheckedChangeListener { _, isChecked ->
HmiBuildConfig.isShowObuLimitSpeedView = !isChecked
}
/**
* 实时加速度面板控制
*/

View File

@@ -1379,6 +1379,17 @@
android:textOn="关闭云端弱势群体预警"
android:textSize="@dimen/dp_24" />
<ToggleButton
android:id="@+id/tbRoadLimitSpeed"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_columnWeight="1"
android:layout_margin="2dp"
android:gravity="center"
android:textOff="关闭路侧限速"
android:textOn="获取路侧限速"
android:textSize="@dimen/dp_24" />
<androidx.appcompat.widget.AppCompatEditText
android:id="@+id/etThreshold"
android:layout_width="wrap_content"

View File

@@ -73,6 +73,9 @@ object TrafficMarkerDrawer {
* 更新识别数据位置
*/
fun updateITrafficLocationInfo(trafficData: TrafficData) {
CallerLogger.d(TAG, "updateITrafficLocationInfo trafficData = $trafficData")
CallerLogger.d(TAG,
"trafficData.type = " + trafficData.type + "---trafficData.threatLevel = " + trafficData.threatLevel + "----FunctionBuildConfig.debugTrackerProvider = " + FunctionBuildConfig.debugTrackerProvider)
if (FunctionBuildConfig.debugTrackerProvider != 1) {
return
}
@@ -95,6 +98,9 @@ object TrafficMarkerDrawer {
* 更新识别数据颜色
*/
fun updateITrafficThreatLevelInfo(trafficData: TrafficData) {
CallerLogger.d(TAG, "updateITrafficThreatLevelInfo trafficData = $trafficData")
CallerLogger.d(TAG,
"trafficData.type = " + trafficData.type + "---trafficData.threatLevel = " + trafficData.threatLevel + "----FunctionBuildConfig.debugTrackerProvider = " + FunctionBuildConfig.debugTrackerProvider)
if (FunctionBuildConfig.debugTrackerProvider != 1) {
return
}

View File

@@ -260,11 +260,9 @@ public class AMapCustomView
public void showV2XEventMarkers(List<V2XEvent> v2XEvents) {
if (v2XEvents == null || v2XEvents.size() <= 0) return;
clearV2XMarkers();
ArrayList<MarkerOptions> markerOptionsList = new ArrayList<>();
for (V2XEvent event : v2XEvents) {
if (event.getType() != 10006) {
continue;
}
Center center = event.getCenter();
if (center != null) {
center.getLon();
@@ -272,7 +270,7 @@ public class AMapCustomView
LatLng latLng = new LatLng(center.getLat(),
center.getLon());
markerOption.position(latLng);
markerOption.icon(BitmapDescriptorFactory.fromResource(R.drawable.icon_warning_v2x_road_construction));
markerOption.icon(BitmapDescriptorFactory.fromResource(R.drawable.icon_small_v2x_road_construction));
markerOptionsList.add(markerOption);
}
}

View File

@@ -81,28 +81,28 @@ object DataManager {
}
}
private fun realSaveMsg(bean: MsgBoxBean) {
val type = bean.type
bean.timestamp = System.currentTimeMillis()
bean.bean2Json = GsonUtils.toJson(bean)
private fun realSaveMsg(msg: MsgBoxBean) {
val type = msg.type
msg.timestamp = System.currentTimeMillis()
msg.bean2Json = GsonUtils.toJson(msg.bean)
when (type) {
MsgBoxType.V2X, MsgBoxType.OBU, MsgBoxType.NOTICE, MsgBoxType.OPERATION -> {
synchronized(this) {
notifyList.add(bean)
notifyList.add(msg)
}
CallerMsgBoxListenerManager.invokeListener(MsgCategory.NOTICE, bean)
CallerMsgBoxListenerManager.invokeListener(MsgCategory.NOTICE, msg)
}
MsgBoxType.REPORT -> {
synchronized(this) {
sysInfoList.add(bean)
sysInfoList.add(msg)
}
CallerMsgBoxListenerManager.invokeListener(MsgCategory.SYS_INFO, bean)
CallerMsgBoxListenerManager.invokeListener(MsgCategory.SYS_INFO, msg)
}
MsgBoxType.RECORD -> {
synchronized(this) {
recordBagList.add(bean)
recordBagList.add(msg)
}
CallerMsgBoxListenerManager.invokeListener(MsgCategory.RECORD_BAG, bean)
CallerMsgBoxListenerManager.invokeListener(MsgCategory.RECORD_BAG, msg)
}
else -> {}
}
@@ -215,7 +215,7 @@ object DataManager {
MsgBoxType.NOTICE.ordinal -> {
return@map MsgBoxBean(
MsgBoxType.NOTICE,
GsonUtils.fromJson(json, NoticeNormalData::class.java)
GsonUtils.fromJson(json, NoticeFrCloudMsg::class.java)
).apply {
withContext(Dispatchers.Main) {
cacheNotifyList.add(this@apply)

View File

@@ -0,0 +1,42 @@
package com.mogo.eagle.core.function.msgbox
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
import com.mogo.eagle.core.utilcode.util.SPUtils
/**
* @author XuXinChao
* @description 消息盒子配置
* @since: 2022/12/1
*/
class MsgBoxConfig {
companion object{
//当前用户的Tab选择记录
private const val userRecord = "USER_RECORD"
/**
* 获取当前用户Tab选择记录
*/
fun getUserRecord(): Int{
return SPUtils.getInstance().getInt(userRecord,0)
}
/**
* 设置当前用户Tab选择记录
*/
fun setUserRecord(record: Int){
SPUtils.getInstance().put(userRecord,record)
}
//通知消息缓存列表
@JvmField
var noticeList: ArrayList<MsgBoxBean> = ArrayList()
//车辆系统信息缓存列表
@JvmField
var systemInfoList: ArrayList<MsgBoxBean> = ArrayList()
//录包信息缓存列表
@JvmField
var recordBagList: ArrayList<MsgBoxBean> = ArrayList()
}
}

View File

@@ -3,28 +3,31 @@ package com.mogo.eagle.core.function.obu.mogo
import android.content.Context
import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.data.config.HmiBuildConfig
import com.mogo.eagle.core.data.config.HmiBuildConfig.isShowObuLimitSpeedView
import com.mogo.eagle.core.data.enums.EventTypeEnumNew
import com.mogo.eagle.core.data.enums.EventTypeEnumWeaknessTraffic
import com.mogo.eagle.core.data.enums.V2iEventTypeEnum
import com.mogo.eagle.core.data.enums.WarningDirectionEnum
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.function.api.hmi.warning.IMoGoWarningStatusListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager.showLimitingVelocity
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager
import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager.Scene.Default
import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager.Scene.TooClose
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager
import com.mogo.eagle.core.function.call.obu.CallerObuListenerManager
import com.mogo.eagle.core.function.call.v2x.CallLimitingVelocityListenerManager.invokeOnLimitingVelocityChange
import com.mogo.eagle.core.function.obu.mogo.MogoObuConst.TAG_MOGO_OBU
import com.mogo.eagle.core.function.obu.mogo.utils.TrafficDataConvertUtilsNew
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_OBU
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr
import com.mogo.eagle.core.data.enums.EventTypeEnumNew
import com.mogo.eagle.core.data.enums.EventTypeEnumWeaknessTraffic
import com.mogo.eagle.core.data.enums.V2iEventTypeEnum
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.function.call.msgbox.CallerMsgBoxManager
import com.mogo.eagle.core.function.obu.mogo.MogoObuConst.TAG_MOGO_OBU
import com.mogo.eagle.core.function.obu.mogo.utils.TrafficDataConvertUtils
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
import com.mogo.support.obu.MogoObuManager
import com.mogo.support.obu.OnMogoObuListener
import com.mogo.support.obu.constants.MogoObuComType
@@ -487,8 +490,7 @@ class MogoPrivateObuNewManager private constructor() {
)
// 交通参与者类型 0x0:未知 UNKNOWN | 1机动车 2:非机动车 NON_MOTOR | 3:行人 PEDESTRIAN 4:obu
if (data != null && data.participant != null && (data.participant.ptcType == 1 || data.participant.ptcType == 3)) {
CallerLogger.d(
"$M_OBU${MogoObuConst.TAG_MOGO_OBU}",
CallerLogger.d("$M_OBU${TAG_MOGO_OBU}",
"onMogoObuRsmWarning ---status---> ${data.status}"
)
@@ -552,7 +554,9 @@ class MogoPrivateObuNewManager private constructor() {
// CallerMapUIServiceManager.getMarkerService()
// ?.updateITrafficInfo(it)
// }
TrafficDataConvertUtilsNew.cvxPtcThreatIndInfo2TrafficData(data)?.let {
CallerLogger.d("$M_OBU${TAG_MOGO_OBU}", "cvxPtcThreatIndInfo2TrafficData ---it---> $it")
CallerMapUIServiceManager.getMarkerService()
?.updateITrafficThreatLevelInfo(it)
}
@@ -585,21 +589,28 @@ class MogoPrivateObuNewManager private constructor() {
*/
override fun onMogoObuMapMath(data: MogoObuMapMathData?) {
super.onMogoObuMapMath(data)
if (data != null) {
CallerLogger.d(
"$M_OBU${TAG_MOGO_OBU}",
"onMogoObuMapMathstatus = ${data.status} --speedMaxLimit = ${Math.round((data.speedMaxLimit*3.6))}")
when (data.status) {
MogoObuConstants.STATUS.ADD -> { // 添加
CallerHmiManager.showLimitingVelocity(Math.round((data.speedMaxLimit*3.6)).toInt())
}
if(isShowObuLimitSpeedView) { //默认显示obu的限速
if (data != null) {
CallerLogger.d(
"$M_OBU${TAG_MOGO_OBU}",
"onMogoObuMapMathstatus = ${data.status} --speedMaxLimit = ${Math.round((data.speedMaxLimit*3.6))}")
when (data.status) {
MogoObuConstants.STATUS.ADD -> { // 添加
UiThreadHandler.post {
if(data.speedMaxLimit > 0) {
CallerHmiManager.showLimitingVelocity(Math.round((data.speedMaxLimit*3.6)).toInt())
}
}
}
MogoObuConstants.STATUS.UPDATE -> { // 更新
MogoObuConstants.STATUS.UPDATE -> { // 更新
}
}
MogoObuConstants.STATUS.DELETE -> { // 删除
CallerHmiManager.disableLimitingVelocity()
MogoObuConstants.STATUS.DELETE -> { // 删除
UiThreadHandler.post {
CallerHmiManager.disableLimitingVelocity()
}
}
}
}
}

View File

@@ -1,9 +1,11 @@
package com.mogo.eagle.core.function.v2x.speedlimit;
import static com.mogo.eagle.core.data.config.HmiBuildConfig.isShowObuLimitSpeedView;
import static com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.BIZ_SLW;
import static com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.V2I;
import android.location.Location;
import android.util.Log;
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager;
import com.mogo.eagle.core.function.call.v2x.CallLimitingVelocityListenerManager;
@@ -52,13 +54,15 @@ public class SpeedLimitDataManager implements IMogoCarLocationChangedListener2 {
@BizConfig(biz = V2I,dependentBizNode = "",bizNode = BIZ_SLW)
private void getSpeedLimit() {
int speedLimit = MogoMapUIController.getInstance().getLimitSpeed(mLocation.getLongitude(), mLocation.getLatitude(), mLocation.getBearing());
UiThreadHandler.post(() -> {
if (speedLimit > 0) {
CallerHmiManager.INSTANCE.showLimitingVelocity(speedLimit);
CallLimitingVelocityListenerManager.INSTANCE.invokeOnLimitingVelocityChange(speedLimit);
}
});
if (!isShowObuLimitSpeedView) {
int speedLimit = MogoMapUIController.getInstance().getLimitSpeed(mLocation.getLongitude(), mLocation.getLatitude(), mLocation.getBearing());
UiThreadHandler.post(() -> {
if (speedLimit > 0) {
CallerHmiManager.INSTANCE.showLimitingVelocity(speedLimit);
CallLimitingVelocityListenerManager.INSTANCE.invokeOnLimitingVelocityChange(speedLimit);
}
});
}
}
}