[6.9.0]消息盒子增加NDE车龙消息

This commit is contained in:
xuxinchao
2024-12-25 18:07:53 +08:00
parent 6dffb13c35
commit 61f9ec5f09
10 changed files with 328 additions and 2 deletions

View File

@@ -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)
}
}

View File

@@ -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
}

View File

@@ -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)
}
}

View File

@@ -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<MsgBoxCountDownBean>){
@@ -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)
}
}

View File

@@ -0,0 +1,65 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="@dimen/dp_804"
android:layout_height="wrap_content"
android:minHeight="@dimen/dp_160"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="@drawable/bg_msg_box_v2x"
android:layout_gravity="center_horizontal"
android:layout_marginStart="30dp"
android:layout_marginEnd="30dp"
android:layout_marginTop="7dp"
android:layout_marginBottom="7dp">
<ImageView
android:id="@+id/ivNDEImage"
android:layout_width="110dp"
android:layout_height="110dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
android:layout_margin="25dp"
android:src="@drawable/icon_nde"
/>
<TextView
android:id="@+id/tvNDETitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toTopOf="@id/tvNDEContent"
app:layout_constraintLeft_toRightOf="@id/ivNDEImage"
android:layout_marginStart="@dimen/dp_15"
android:textColor="#FFFFFFFF"
android:textSize="@dimen/sp_32"
android:layout_marginTop="@dimen/dp_5"
android:layout_marginBottom="@dimen/dp_5"
/>
<TextView
android:id="@+id/tvNDETime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="@id/tvNDETitle"
app:layout_constraintBottom_toBottomOf="@id/tvNDETitle"
app:layout_constraintRight_toRightOf="parent"
android:layout_marginEnd="25dp"
android:textColor="#80FFFFFF"
android:textSize="@dimen/sp_24"
/>
<TextView
android:id="@+id/tvNDEContent"
android:layout_width="0dp"
android:layout_height="wrap_content"
app:layout_constraintTop_toBottomOf="@id/tvNDETitle"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="@id/tvNDETitle"
app:layout_constraintRight_toRightOf="@id/tvNDETime"
android:textColor="#B3FFFFFF"
android:textSize="@dimen/sp_28"
android:layout_marginBottom="@dimen/dp_5"
android:layout_marginTop="@dimen/dp_5"
/>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -0,0 +1,65 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/clNDELayout"
android:layout_width="@dimen/dp_804"
android:layout_height="wrap_content"
android:minHeight="@dimen/dp_160"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="@drawable/bg_msg_box_v2x"
android:layout_gravity="center_horizontal"
android:layout_marginTop="7dp"
android:layout_marginBottom="7dp"
>
<ImageView
android:id="@+id/ivNDEImage"
android:layout_width="110dp"
android:layout_height="110dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
android:layout_margin="25dp"
android:src="@drawable/icon_nde"
/>
<TextView
android:id="@+id/tvNDETitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toTopOf="@id/tvNDEContent"
app:layout_constraintLeft_toRightOf="@id/ivNDEImage"
android:layout_marginStart="@dimen/dp_15"
android:textColor="#FFFFFFFF"
android:textSize="@dimen/sp_32"
android:layout_marginTop="@dimen/dp_5"
android:layout_marginBottom="@dimen/dp_5"
/>
<TextView
android:id="@+id/tvNDETime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="@id/tvNDETitle"
app:layout_constraintBottom_toBottomOf="@id/tvNDETitle"
app:layout_constraintRight_toRightOf="parent"
android:layout_marginEnd="25dp"
android:textColor="#80FFFFFF"
android:textSize="@dimen/sp_24"
/>
<TextView
android:id="@+id/tvNDEContent"
android:layout_width="0dp"
android:layout_height="wrap_content"
app:layout_constraintTop_toBottomOf="@id/tvNDETitle"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="@id/tvNDETitle"
app:layout_constraintRight_toRightOf="@id/tvNDETime"
android:textColor="#B3FFFFFF"
android:textSize="@dimen/sp_28"
android:layout_marginTop="@dimen/dp_5"
android:layout_marginBottom="@dimen/dp_5"
/>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -0,0 +1,45 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/clV2XLayout"
android:layout_width="@dimen/dp_694"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="@drawable/bg_msg_box_toast"
android:layout_gravity="center_horizontal"
>
<ImageView
android:id="@+id/ivNdeImage"
android:layout_width="@dimen/dp_120"
android:layout_height="@dimen/dp_120"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
android:src="@drawable/icon_nde"
android:contentDescription="@string/msg_box_toast_icon"
/>
<TextView
android:id="@+id/tvNdeTitle"
android:layout_width="@dimen/dp_0"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintLeft_toRightOf="@id/ivNdeImage"
app:layout_constraintRight_toRightOf="parent"
android:layout_marginStart="@dimen/dp_20"
android:textColor="#FFFFFFFF"
android:textSize="@dimen/sp_40"
/>
<TextView
android:id="@+id/tvNdeContent"
android:layout_width="@dimen/dp_0"
android:layout_height="wrap_content"
app:layout_constraintTop_toBottomOf="@id/tvNdeTitle"
app:layout_constraintLeft_toLeftOf="@id/tvNdeTitle"
app:layout_constraintRight_toRightOf="parent"
android:textColor="@color/white"
android:textSize="@dimen/sp_32"
android:layout_marginTop="@dimen/dp_6"
/>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -0,0 +1,55 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="@dimen/dp_180"
xmlns:app="http://schemas.android.com/apk/res-auto">
<ImageView
android:id="@+id/ivNdeImage"
android:layout_width="@dimen/dp_120"
android:layout_height="@dimen/dp_120"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
android:layout_marginTop="@dimen/dp_30"
android:contentDescription="@string/nde_icon"
android:src="@drawable/icon_nde"
/>
<TextView
android:id="@+id/tvNdeTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="@id/ivNdeImage"
app:layout_constraintLeft_toRightOf="@id/ivNdeImage"
android:layout_marginStart="@dimen/dp_30"
android:textSize="@dimen/sp_38"
android:textColor="@color/white"
android:textStyle="bold"
/>
<TextView
android:id="@+id/tvNdeTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="@id/tvNdeTitle"
app:layout_constraintBottom_toBottomOf="@id/tvNdeTitle"
app:layout_constraintRight_toRightOf="parent"
android:textSize="@dimen/sp_32"
android:textColor="#999999"
/>
<TextView
android:id="@+id/tvNdeContent"
android:layout_width="@dimen/dp_0"
android:layout_height="wrap_content"
app:layout_constraintTop_toBottomOf="@id/tvNdeTitle"
app:layout_constraintLeft_toLeftOf="@id/tvNdeTitle"
app:layout_constraintRight_toRightOf="@id/tvNdeTime"
android:textSize="@dimen/sp_32"
android:textColor="#CCCCCC"
android:layout_marginTop="@dimen/dp_15"
android:paddingBottom="@dimen/dp_30"
/>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -206,6 +206,7 @@
<string name="autopilot_icon">域控制器连接状态图标</string>
<string name="fsm_icon">FSM图标</string>
<string name="v2x_icon">V2X图标</string>
<string name="nde_icon">NDE图标</string>
<string name="fault_time_reduce">故障发生时间减少</string>
<string name="fault_time_add">故障发生时间增加</string>

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB