[2.13.0]消息盒子
This commit is contained in:
@@ -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
|
||||
*/
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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,11 +81,12 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A
|
||||
}
|
||||
}else if(holder is BubbleNoticeHolder){
|
||||
data?.let {
|
||||
val noticeNormalData = it[position].bean
|
||||
if (noticeNormalData is 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(
|
||||
holder.tvNoticeContent.text = noticeNormalData?.content
|
||||
GlideApp.with(activity).load(noticeNormalData?.imageUrl).optionalTransform(
|
||||
GlideRoundedCornersTransform(
|
||||
20f,
|
||||
GlideRoundedCornersTransform.CornerType.ALL
|
||||
@@ -96,7 +94,25 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A
|
||||
).into(holder.ivNoticeImage)
|
||||
holder.tvNoticeCheck.setOnClickListener {
|
||||
//云公告
|
||||
CallerHmiManager.showNoticeNormalData(noticeNormalData)
|
||||
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)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -172,11 +172,12 @@ class DriverMsgBoxListAdapter(private val activity: Activity) : RecyclerView.Ada
|
||||
}
|
||||
}else if(holder is MsgBoxNotice){
|
||||
data?.let {
|
||||
val noticeNormalData = it[position].bean
|
||||
if (noticeNormalData is 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(
|
||||
holder.tvNoticeContent.text = noticeNormalData?.content
|
||||
GlideApp.with(activity).load(noticeNormalData?.imageUrl).optionalTransform(
|
||||
GlideRoundedCornersTransform(
|
||||
20f,
|
||||
GlideRoundedCornersTransform.CornerType.ALL
|
||||
@@ -184,9 +185,24 @@ class DriverMsgBoxListAdapter(private val activity: Activity) : RecyclerView.Ada
|
||||
).into(holder.ivNoticeImage)
|
||||
holder.tvNoticeCheck.setOnClickListener {
|
||||
//云公告
|
||||
CallerHmiManager.showNoticeNormalData(noticeNormalData)
|
||||
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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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){
|
||||
|
||||
Reference in New Issue
Block a user