[opt-3.0]fix消息盒子车辆系统信息闪烁问题

This commit is contained in:
xuxinchao
2023-03-08 18:51:52 +08:00
parent ab22a6f6a3
commit 5d05f0fded
3 changed files with 50 additions and 5 deletions

View File

@@ -79,7 +79,7 @@ class IPCReportManager : IMoGoAutopilotStatusListener {
|| it.resultList.contains(RESULT_SHOW_WARNING)
|| it.resultList.contains(RESULT_REMOTEPILOT_INFERIOR)){
val reportEntity = ReportEntity(TimeUtils.millis2String(System.currentTimeMillis()),
it.src,it.level,it.msg,it.code,it.resultList,it.actionsList)
it.src,it.level,it.msg,it.code,it.resultList,it.actionsList,false)
CallerMsgBoxManager.saveMsgBox(MsgBoxBean(MsgBoxType.REPORT, reportEntity))
}
@@ -91,7 +91,7 @@ class IPCReportManager : IMoGoAutopilotStatusListener {
ReportEntity(
TimeUtils.millis2String(System.currentTimeMillis()),
it.src, it.level, it.msg, it.code, it.resultList, it.actionsList
)
,false)
)
reportListFloatWindow?.refreshData(reportList)

View File

@@ -163,8 +163,51 @@ class DriverMsgBoxListAdapter(private val activity: Activity) :
"${actionStr}${CallerAutoPilotControlManager.getReportActionDesc(action)}"
}
holder.tvReportActionOpen.text = "建议操作:$actionStr"
holder.tvStatusSelect.tag = reportEntity
if(reportEntity.isShow){
holder.tvStatusSelect.setCompoundDrawablesWithIntrinsicBounds(
getDrawable(R.drawable.icon_msg_close),
null,
null,
null
)
holder.tvStatusSelect.text = "折叠"
holder.ivReportImageNormal.visibility = View.GONE
holder.tvReportLevelNormal.visibility = View.GONE
holder.tvReportTimeNormal.visibility = View.GONE
holder.tvReportTypeNormal.visibility = View.GONE
holder.ivReportImageOpen.visibility = View.VISIBLE
holder.tvReportLevelOpen.visibility = View.VISIBLE
holder.tvReportTimeOpen.visibility = View.VISIBLE
holder.tvReportTypeOpen.visibility = View.VISIBLE
holder.tvReportReasonOpen.visibility = View.VISIBLE
holder.tvReportSrcOpen.visibility = View.VISIBLE
holder.tvReportActionOpen.visibility = View.VISIBLE
}else{
holder.tvStatusSelect.setCompoundDrawablesWithIntrinsicBounds(
getDrawable(R.drawable.icon_msg_open),
null,
null,
null
)
holder.tvStatusSelect.text = "展开"
holder.ivReportImageNormal.visibility = View.VISIBLE
holder.tvReportLevelNormal.visibility = View.VISIBLE
holder.tvReportTimeNormal.visibility = View.VISIBLE
holder.tvReportTypeNormal.visibility = View.VISIBLE
holder.ivReportImageOpen.visibility = View.GONE
holder.tvReportLevelOpen.visibility = View.GONE
holder.tvReportTimeOpen.visibility = View.GONE
holder.tvReportTypeOpen.visibility = View.GONE
holder.tvReportReasonOpen.visibility = View.GONE
holder.tvReportSrcOpen.visibility = View.GONE
holder.tvReportActionOpen.visibility = View.GONE
}
holder.tvStatusSelect.setOnClickListener {
if (holder.tvReportLevelNormal.isVisible) {
if (!reportEntity.isShow) {
reportEntity.isShow = true
holder.tvStatusSelect.setCompoundDrawablesWithIntrinsicBounds(
getDrawable(R.drawable.icon_msg_close),
null,
@@ -185,6 +228,7 @@ class DriverMsgBoxListAdapter(private val activity: Activity) :
holder.tvReportSrcOpen.visibility = View.VISIBLE
holder.tvReportActionOpen.visibility = View.VISIBLE
} else {
reportEntity.isShow = false
holder.tvStatusSelect.setCompoundDrawablesWithIntrinsicBounds(
getDrawable(R.drawable.icon_msg_open),
null,
@@ -323,7 +367,7 @@ class DriverMsgBoxListAdapter(private val activity: Activity) :
TimeUtils.millis2String(it[position].timestamp, getHourMinFormat())
holder.tvV2XContent.text = v2XMsg.content
holder.ivV2XImage.setImageDrawable(activity.resources.getDrawable(
EventTypeEnumNew.getUpdateIconRes(v2XMsg.type))
EventTypeEnumNew.getUpdateIconRes(v2XMsg.type))
)
}
}

View File

@@ -7,7 +7,7 @@ import java.io.Serializable
* @description 工控机上报实例
* @since: 2022/4/13
*/
data class ReportEntity(
class ReportEntity(
var time: String,//上报时间
var src: String,//消息来源
var level: String,//消息等级 error info
@@ -17,6 +17,7 @@ data class ReportEntity(
var actionsList: List<String>,//试验性字段。消息发出者希望触发的动作例如触发短信报警自动创建工单要求pad弹框等
// var sec: Int,//秒
// var nsec: Int//纳秒 sec和nsec拼接起来是消息发送事件
var isShow: Boolean
): Serializable {
}