[2.13.0][fix]解决读取消息盒子历史信息的Bug
This commit is contained in:
@@ -84,18 +84,20 @@ 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 noticeNormalData = it[position].bean
|
||||
if (noticeNormalData is 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)
|
||||
}
|
||||
}
|
||||
}
|
||||
}else if(holder is BubbleV2XHolder){
|
||||
|
||||
@@ -172,18 +172,20 @@ 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 noticeNormalData = it[position].bean
|
||||
if (noticeNormalData is 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)
|
||||
}
|
||||
}
|
||||
}
|
||||
}else if(holder is MsgBoxV2X){
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user