diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/DriverMsgBoxBubbleAdapter.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/DriverMsgBoxBubbleAdapter.kt index 86dc79f4ec..fc6ab08a14 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/DriverMsgBoxBubbleAdapter.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/DriverMsgBoxBubbleAdapter.kt @@ -43,6 +43,9 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A private val report: Int = 4 private val summary: Int = 5 private val fm: Int = 6 + private val ssm: Int = 7 + private val autopilot: Int = 8 + private val none: Int = 9 private var changeViewListener: ChangeViewListener?=null @@ -91,6 +94,14 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A val view = LayoutInflater.from(parent.context).inflate(R.layout.item_msg_bubble_fm,parent,false) return BubbleFmHolder(view) } + ssm -> { + val view = LayoutInflater.from(parent.context).inflate(R.layout.item_msg_bubble_ssm,parent,false) + return BubbleSsmHolder(view) + } + autopilot -> { + val view = LayoutInflater.from(parent.context).inflate(R.layout.item_msg_bubble_autopilot,parent,false) + return BubbleAutopilotHolder(view) + } else -> { val view = LayoutInflater.from(parent.context).inflate(R.layout.item_msg_bubble_v2x,parent,false) return BubbleV2XHolder(view) @@ -262,6 +273,24 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A } } } + //SSM连接消息 + is BubbleSsmHolder ->{ + data?.let { + val ssmMsg = it[position].msgBoxBean.bean as SSMMsg + holder.tvSsmTitle.text = ssmMsg.title + holder.tvSsmContent.text= ssmMsg.content + holder.tvSsmTime.text = TimeUtils.millis2String(ssmMsg.timestamp,getHourMinFormat()) + } + } + //域控制器连接消息 + is BubbleAutopilotHolder ->{ + data?.let { + val autopilotMsg = it[position].msgBoxBean.bean as AutopilotMsg + holder.tvAutopilotTitle.text = autopilotMsg.title + holder.tvAutopilotContent.text = autopilotMsg.content + holder.tvAutopilotTime.text = TimeUtils.millis2String(autopilotMsg.timestamp,getHourMinFormat()) + } + } } val msgBoxBean: MsgBoxCountDownBean = data!![position] @@ -311,7 +340,11 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A summary }else if(data!![position].msgBoxBean.type == MsgBoxType.FMINFO){ fm - } else{ + }else if(data!![position].msgBoxBean.type == MsgBoxType.SSMINFO){ + ssm + }else if(data!![position].msgBoxBean.type == MsgBoxType.AUTOPILOT){ + autopilot + } else { v2x } } @@ -378,6 +411,22 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A var tvBubbleFmTime: TextView = itemView.findViewById(R.id.tvBubbleFmTime) } + //SSM连接消息 + class BubbleSsmHolder(itemView: View): RecyclerView.ViewHolder(itemView){ + var ivSsmImage: ImageView = itemView.findViewById(R.id.ivSsmImage) + var tvSsmTitle: TextView = itemView.findViewById(R.id.tvSsmTitle) + var tvSsmTime: TextView = itemView.findViewById(R.id.tvSsmTime) + var tvSsmContent: TextView = itemView.findViewById(R.id.tvSsmContent) + } + + //域控制器连接状态消息 + class BubbleAutopilotHolder(itemView: View): RecyclerView.ViewHolder(itemView){ + var ivAutopilotImage: ImageView = itemView.findViewById(R.id.ivAutopilotImage) + var tvAutopilotTitle: TextView = itemView.findViewById(R.id.tvAutopilotTitle) + var tvAutopilotTime: TextView = itemView.findViewById(R.id.tvAutopilotTime) + var tvAutopilotContent: TextView = itemView.findViewById(R.id.tvAutopilotContent) + } + fun setChangeListener(listener: ChangeViewListener){ changeViewListener = listener } diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/DriverMsgBoxListAdapter.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/DriverMsgBoxListAdapter.kt index c269c4dd0f..a665a8dd12 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/DriverMsgBoxListAdapter.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/DriverMsgBoxListAdapter.kt @@ -45,7 +45,12 @@ class DriverMsgBoxListAdapter(private val activity: Activity) : private val fm: Int = 4 //FM信息 private val report: Int = 5 //系统信息 private val record: Int = 6 //录包 - private val summary: Int = 8 + private val summary: Int = 8 //汇总消息 + private val ssm: Int = 9 //SSM连接消息 + private val autopilot = 20 //工控机连接消息 + + private val none = -1 + //Error private val RESULT_AUTOPILOT_DISABLE = "RESULT_AUTOPILOT_DISABLE" @@ -116,6 +121,16 @@ class DriverMsgBoxListAdapter(private val activity: Activity) : .inflate(R.layout.item_msg_box_summary, parent, false) return MsgBoxSummary(view) } + ssm -> { + val view = LayoutInflater.from(parent.context) + .inflate(R.layout.item_msg_box_ssm,parent,false) + return MsgBoxSsm(view) + } + autopilot -> { + val view = LayoutInflater.from(parent.context) + .inflate(R.layout.item_msg_box_autopilot,parent,false) + return MsgBoxAutopilot(view) + } else -> { val view = LayoutInflater.from(parent.context) .inflate(R.layout.item_msg_box_v2x, parent, false) @@ -648,6 +663,7 @@ class DriverMsgBoxListAdapter(private val activity: Activity) : } } } + //汇总消息 is MsgBoxSummary -> { data?.let { val summaryMsg = it[position].bean as V2XMsg @@ -656,6 +672,24 @@ class DriverMsgBoxListAdapter(private val activity: Activity) : holder.tvSummaryContent.text = summaryMsg.content } } + //SSM连接状态消息 + is MsgBoxSsm -> { + data?.let { + val ssmMsg = it[position].bean as SSMMsg + holder.tvSsmTitle.text = ssmMsg.title + holder.tvSsmContent.text = ssmMsg.content + holder.tvSsmTime.text = TimeUtils.millis2String(ssmMsg.timestamp,getHourMinFormat()) + } + } + //域控制器连接状态消息 + is MsgBoxAutopilot ->{ + data?.let { + val autopilotMsg = it[position].bean as AutopilotMsg + holder.tvAutopilotTitle.text = autopilotMsg.title + holder.tvAutopilotContent.text = autopilotMsg.content + holder.tvAutopilotTime.text = TimeUtils.millis2String(autopilotMsg.timestamp,getHourMinFormat()) + } + } } } @@ -692,9 +726,14 @@ class DriverMsgBoxListAdapter(private val activity: Activity) : record } else if(data!![position].type == MsgBoxType.FMINFO){ fm - } - else { + } else if(data!![position].type == MsgBoxType.SSMINFO){ + ssm + } else if(data!![position].type == MsgBoxType.AUTOPILOT){ + autopilot + } else if(data!![position].type == MsgBoxType.V2X || data!![position].type == MsgBoxType.OBU){ v2x + } else { + none } } @@ -791,5 +830,20 @@ class DriverMsgBoxListAdapter(private val activity: Activity) : var tvSummaryTime: TextView = itemView.findViewById(R.id.tvSummaryTime) } + //SSM连接状态 + class MsgBoxSsm(itemView: View) : RecyclerView.ViewHolder(itemView){ + var ivSsmImage: ImageView = itemView.findViewById(R.id.ivSsmImage) + var tvSsmTitle: TextView = itemView.findViewById(R.id.tvSsmTitle) + var tvSsmTime: TextView = itemView.findViewById(R.id.tvSsmTime) + var tvSsmContent: TextView = itemView.findViewById(R.id.tvSsmContent) + } + + //域控制器连接状态 + class MsgBoxAutopilot(itemView: View) : RecyclerView.ViewHolder(itemView){ + var ivAutopilotImage: ImageView = itemView.findViewById(R.id.ivAutopilotImage) + var tvAutopilotTitle: TextView = itemView.findViewById(R.id.tvAutopilotTitle) + var tvAutopilotTime: TextView = itemView.findViewById(R.id.tvAutopilotTime) + var tvAutopilotContent: TextView = itemView.findViewById(R.id.tvAutopilotContent) + } } \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_box_autopilot.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_box_autopilot.xml new file mode 100644 index 0000000000..8718a6c212 --- /dev/null +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_box_autopilot.xml @@ -0,0 +1,62 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_box_ssm.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_box_ssm.xml new file mode 100644 index 0000000000..fb4d2d14fc --- /dev/null +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_box_ssm.xml @@ -0,0 +1,62 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_bubble_autopilot.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_bubble_autopilot.xml new file mode 100644 index 0000000000..9f0199eb80 --- /dev/null +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_bubble_autopilot.xml @@ -0,0 +1,62 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_bubble_ssm.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_bubble_ssm.xml new file mode 100644 index 0000000000..5aa40ef9ba --- /dev/null +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_bubble_ssm.xml @@ -0,0 +1,62 @@ + + + + + + + + + + + + \ No newline at end of file