diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/bone/tab/adapter/MsgBoxTabAdapter.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/bone/tab/adapter/MsgBoxTabAdapter.kt index 8e3841c05e..df5ad368e8 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/bone/tab/adapter/MsgBoxTabAdapter.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/bone/tab/adapter/MsgBoxTabAdapter.kt @@ -46,6 +46,7 @@ class MsgBoxTabAdapter(private val activity: Activity) : private val ssm: Int = 9 //SSM连接消息 private val autopilot = 20 //工控机连接消息 private val fsm = 21 //fsm消息 + private val nde = 22 //NDE消息车龙 private val none = -1 @@ -143,6 +144,12 @@ class MsgBoxTabAdapter(private val activity: Activity) : .inflate(R.layout.item_tab_fsm,parent,false) return MsgBoxFSM(view) } + //NDE消息 + nde -> { + val view = LayoutInflater.from(parent.context) + .inflate(R.layout.item_tab_nde,parent,false) + return MsgBoxNDE(view) + } //V2X消息 else -> { val view = LayoutInflater.from(parent.context) @@ -542,6 +549,15 @@ class MsgBoxTabAdapter(private val activity: Activity) : holder.tvFSMTime.text = TimeUtils.millis2String(fsmMsg.timestamp,getHourMinFormat()) } } + //NDE车龙消息 + is MsgBoxNDE ->{ + data?.let { + val ndeMsg = it[position].bean as NDEMsg + holder.tvNdeTitle.text = ndeMsg.title + holder.tvNdeContent.text = ndeMsg.des + holder.tvNdeTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat()) + } + } } } @@ -584,6 +600,8 @@ class MsgBoxTabAdapter(private val activity: Activity) : autopilot } else if(data!![position].type == MsgBoxType.FSM){ fsm + } else if(data!![position].type == MsgBoxType.NDE){ + nde } else if(data!![position].type == MsgBoxType.V2X || data!![position].type == MsgBoxType.OBU){ v2x } else { @@ -692,4 +710,11 @@ class MsgBoxTabAdapter(private val activity: Activity) : var tvFSMContent: TextView = itemView.findViewById(R.id.tvFSMContent) } + //NDE车龙 + class MsgBoxNDE(itemView: View) : RecyclerView.ViewHolder(itemView){ + var tvNdeTitle: TextView = itemView.findViewById(R.id.tvNdeTitle) + var tvNdeTime: TextView = itemView.findViewById(R.id.tvNdeTime) + var tvNdeContent: TextView = itemView.findViewById(R.id.tvNdeContent) + } + } \ No newline at end of file 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 c2981cf00d..b418bbc97e 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 @@ -48,6 +48,7 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A private val autopilot: Int = 8 private val fsm: Int = 9 private val none: Int = 10 + private val nde: Int = 11 private var changeViewListener: ChangeViewListener?=null @@ -108,6 +109,10 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A val view = LayoutInflater.from(parent.context).inflate(R.layout.item_msg_bubble_fsm,parent,false) return BubbleFSMHolder(view) } + nde -> { + val view = LayoutInflater.from(parent.context).inflate(R.layout.item_msg_bubble_nde,parent,false) + return BubbleNDEHolder(view) + } else -> { val view = LayoutInflater.from(parent.context).inflate(R.layout.item_msg_bubble_v2x,parent,false) return BubbleV2XHolder(view) @@ -327,6 +332,15 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A holder.tvFSMTime.text = TimeUtils.millis2String(fsmMsg.timestamp,getHourMinFormat()) } } + //NDE消息 + is BubbleNDEHolder ->{ + data?.let { + val ndeMsg = it[position].msgBoxBean.bean as NDEMsg + holder.tvNDETitle.text = ndeMsg.title + holder.tvNDEContent.text = ndeMsg.des + holder.tvNDETime.text = TimeUtils.millis2String(it[position].msgBoxBean.timestamp,getHourMinFormat()) + } + } } val msgBoxBean: MsgBoxCountDownBean = data!![position] @@ -382,7 +396,10 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A autopilot }else if(data!![position].msgBoxBean.type == MsgBoxType.FSM){ fsm - } else { + }else if(data!![position].msgBoxBean.type == MsgBoxType.NDE){ + nde + } + else { v2x } } @@ -473,6 +490,13 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A var tvFSMContent: TextView = itemView.findViewById(R.id.tvFSMContent) } + //NDE车龙消息 + class BubbleNDEHolder(itemView: View): RecyclerView.ViewHolder(itemView){ + var tvNDETitle: TextView = itemView.findViewById(R.id.tvNDETitle) + var tvNDETime: TextView = itemView.findViewById(R.id.tvNDETime) + var tvNDEContent: TextView = itemView.findViewById(R.id.tvNDEContent) + } + 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 2974aad26c..b5037002c0 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 @@ -49,7 +49,7 @@ class DriverMsgBoxListAdapter(private val activity: Activity) : private val ssm: Int = 9 //SSM连接消息 private val autopilot = 20 //工控机连接消息 private val fsm = 21 //fsm消息 - + private val nde = 22 //NDE消息 private val none = -1 @@ -137,6 +137,11 @@ class DriverMsgBoxListAdapter(private val activity: Activity) : .inflate(R.layout.item_msg_box_fsm,parent,false) return MsgBoxFSM(view) } + nde ->{ + val view = LayoutInflater.from(parent.context) + .inflate(R.layout.item_msg_box_nde,parent,false) + return MsgBoxNde(view) + } else -> { val view = LayoutInflater.from(parent.context) .inflate(R.layout.item_msg_box_v2x, parent, false) @@ -711,6 +716,15 @@ class DriverMsgBoxListAdapter(private val activity: Activity) : holder.tvFSMTime.text = TimeUtils.millis2String(fsmMsg.timestamp,getHourMinFormat()) } } + //NDE消息 + is MsgBoxNde ->{ + data?.let { + val ndeMsg = it[position].bean as NDEMsg + holder.tvNDETitle.text = ndeMsg.title + holder.tvNDEContent.text = ndeMsg.des + holder.tvNDETime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat()) + } + } } } @@ -753,6 +767,8 @@ class DriverMsgBoxListAdapter(private val activity: Activity) : autopilot } else if(data!![position].type == MsgBoxType.FSM){ fsm + } else if(data!![position].type == MsgBoxType.NDE){ + nde } else if(data!![position].type == MsgBoxType.V2X || data!![position].type == MsgBoxType.OBU){ v2x } else { @@ -877,4 +893,11 @@ class DriverMsgBoxListAdapter(private val activity: Activity) : var tvFSMContent: TextView = itemView.findViewById(R.id.tvFSMContent) } + //NDE + class MsgBoxNde(itemView: View) : RecyclerView.ViewHolder(itemView){ + var tvNDETitle: TextView = itemView.findViewById(R.id.tvNDETitle) + var tvNDETime: TextView = itemView.findViewById(R.id.tvNDETime) + var tvNDEContent: TextView = itemView.findViewById(R.id.tvNDEContent) + } + } \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/MsgBoxToastAdapter.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/MsgBoxToastAdapter.kt index 35440e2897..765c8065c7 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/MsgBoxToastAdapter.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/MsgBoxToastAdapter.kt @@ -20,6 +20,7 @@ import com.mogo.eagle.core.data.msgbox.FSMMsg import com.mogo.eagle.core.data.msgbox.MsgBoxCountDownBean import com.mogo.eagle.core.data.msgbox.MsgBoxType import com.mogo.eagle.core.data.msgbox.MsgFmData +import com.mogo.eagle.core.data.msgbox.NDEMsg import com.mogo.eagle.core.data.msgbox.NoticeFrCloudMsg import com.mogo.eagle.core.data.msgbox.OperationMsg import com.mogo.eagle.core.data.msgbox.SSMMsg @@ -46,6 +47,7 @@ class MsgBoxToastAdapter(private val activity: Activity) : RecyclerView.Adapter< private val notice: Int = 1 private val v2x: Int = 2 private val report: Int = 3 + private val nde: Int = 4 fun setData(data: ArrayList){ @@ -66,6 +68,10 @@ class MsgBoxToastAdapter(private val activity: Activity) : RecyclerView.Adapter< val view = LayoutInflater.from(parent.context).inflate(R.layout.item_msg_bubble_notice,parent,false) BubbleNoticeHolder(view) } + nde -> { + val view = LayoutInflater.from(parent.context).inflate(R.layout.item_msg_toast_nde,parent,false) + BubbleNDEHolder(view) + } else -> { val view = LayoutInflater.from(parent.context).inflate(R.layout.item_msg_toast_v2x,parent,false) BubbleV2XHolder(view) @@ -132,6 +138,14 @@ class MsgBoxToastAdapter(private val activity: Activity) : RecyclerView.Adapter< } } } + //NDE消息 + is BubbleNDEHolder ->{ + data?.let { + val ndeMsg = it[position].msgBoxBean.bean as NDEMsg + holder.tvNdeTitle.text = ndeMsg.title + holder.tvNdeContent.text = ndeMsg.des + } + } //V2X消息 is BubbleV2XHolder -> { data?.let { @@ -306,6 +320,9 @@ class MsgBoxToastAdapter(private val activity: Activity) : RecyclerView.Adapter< MsgBoxType.NOTICE -> { notice } + MsgBoxType.NDE ->{ + nde + } else -> { v2x } @@ -344,4 +361,10 @@ class MsgBoxToastAdapter(private val activity: Activity) : RecyclerView.Adapter< var clV2XLayout: ConstraintLayout = itemView.findViewById(R.id.clV2XLayout) } + //NDE + class BubbleNDEHolder(itemView: View): RecyclerView.ViewHolder(itemView){ + var tvNdeTitle: TextView = itemView.findViewById(R.id.tvNdeTitle) + var tvNdeContent: TextView = itemView.findViewById(R.id.tvNdeContent) + } + } \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_box_nde.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_box_nde.xml new file mode 100644 index 0000000000..894b67f435 --- /dev/null +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_box_nde.xml @@ -0,0 +1,65 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_bubble_nde.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_bubble_nde.xml new file mode 100644 index 0000000000..de353aac66 --- /dev/null +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_bubble_nde.xml @@ -0,0 +1,65 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_toast_nde.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_toast_nde.xml new file mode 100644 index 0000000000..420454ab7e --- /dev/null +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_toast_nde.xml @@ -0,0 +1,45 @@ + + + + + + + + + + \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_tab_nde.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_tab_nde.xml new file mode 100644 index 0000000000..fdd976c7f6 --- /dev/null +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_tab_nde.xml @@ -0,0 +1,55 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/values/strings.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/values/strings.xml index 9e99cd8be8..fb0ef99aa8 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/values/strings.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/values/strings.xml @@ -206,6 +206,7 @@ 域控制器连接状态图标 FSM图标 V2X图标 + NDE图标 故障发生时间减少 故障发生时间增加 diff --git a/core/mogo-core-res/src/main/function-hmi-res/drawable-xhdpi/icon_nde.png b/core/mogo-core-res/src/main/function-hmi-res/drawable-xhdpi/icon_nde.png new file mode 100644 index 0000000000..bedbcedd07 Binary files /dev/null and b/core/mogo-core-res/src/main/function-hmi-res/drawable-xhdpi/icon_nde.png differ