[6.4.4] increase the autopilot statistics status notice in msgbox

This commit is contained in:
EmArrow
2024-06-04 18:31:22 +08:00
parent 78ad824b9e
commit b01178831d
8 changed files with 253 additions and 3 deletions

View File

@@ -46,7 +46,8 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A
private val fm: Int = 6
private val ssm: Int = 7
private val autopilot: Int = 8
private val none: Int = 9
private val fsm: Int = 9
private val none: Int = 10
private var changeViewListener: ChangeViewListener?=null
@@ -103,6 +104,10 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A
val view = LayoutInflater.from(parent.context).inflate(R.layout.item_msg_bubble_autopilot,parent,false)
return BubbleAutopilotHolder(view)
}
fsm -> {
val view = LayoutInflater.from(parent.context).inflate(R.layout.item_msg_bubble_fsm,parent,false)
return BubbleFSMHolder(view)
}
else -> {
val view = LayoutInflater.from(parent.context).inflate(R.layout.item_msg_bubble_v2x,parent,false)
return BubbleV2XHolder(view)
@@ -308,6 +313,16 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A
holder.tvAutopilotTime.text = TimeUtils.millis2String(autopilotMsg.timestamp,getHourMinFormat())
}
}
//FSM消息
is BubbleFSMHolder ->{
data?.let {
val fsmMsg = it[position].msgBoxBean.bean as FSMMsg
holder.tvFSMTitle.text = fsmMsg.title
holder.tvFSMContent.text = fsmMsg.content
holder.tvFSMTime.text = TimeUtils.millis2String(fsmMsg.timestamp,getHourMinFormat())
}
}
}
val msgBoxBean: MsgBoxCountDownBean = data!![position]
@@ -361,6 +376,8 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A
ssm
}else if(data!![position].msgBoxBean.type == MsgBoxType.AUTOPILOT){
autopilot
}else if(data!![position].msgBoxBean.type == MsgBoxType.FSM){
fsm
} else {
v2x
}
@@ -445,6 +462,14 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A
var tvAutopilotContent: TextView = itemView.findViewById(R.id.tvAutopilotContent)
}
//FSM状态消息(现阶段提示启动自驾失败消息过渡阶段提示未来展示fsm消息提醒)
class BubbleFSMHolder(itemView: View): RecyclerView.ViewHolder(itemView){
var ivFSMImage: ImageView = itemView.findViewById(R.id.ivFSMImage)
var tvFSMTitle: TextView = itemView.findViewById(R.id.tvFSMTitle)
var tvFSMTime: TextView = itemView.findViewById(R.id.tvFSMTime)
var tvFSMContent: TextView = itemView.findViewById(R.id.tvFSMContent)
}
fun setChangeListener(listener: ChangeViewListener){
changeViewListener = listener
}

View File

@@ -48,6 +48,7 @@ class DriverMsgBoxListAdapter(private val activity: Activity) :
private val summary: Int = 8 //汇总消息
private val ssm: Int = 9 //SSM连接消息
private val autopilot = 20 //工控机连接消息
private val fsm = 21 //fsm消息
private val none = -1
@@ -131,6 +132,11 @@ class DriverMsgBoxListAdapter(private val activity: Activity) :
.inflate(R.layout.item_msg_box_autopilot,parent,false)
return MsgBoxAutopilot(view)
}
fsm -> {
val view = LayoutInflater.from(parent.context)
.inflate(R.layout.item_msg_box_fsm,parent,false)
return MsgBoxFSM(view)
}
else -> {
val view = LayoutInflater.from(parent.context)
.inflate(R.layout.item_msg_box_v2x, parent, false)
@@ -696,6 +702,15 @@ class DriverMsgBoxListAdapter(private val activity: Activity) :
holder.tvAutopilotTime.text = TimeUtils.millis2String(autopilotMsg.timestamp,getHourMinFormat())
}
}
//fsm消息
is MsgBoxFSM ->{
data?.let {
val fsmMsg = it[position].bean as FSMMsg
holder.tvFSMTitle.text = fsmMsg.title
holder.tvFSMContent.text = fsmMsg.content
holder.tvFSMTime.text = TimeUtils.millis2String(fsmMsg.timestamp,getHourMinFormat())
}
}
}
}
@@ -736,6 +751,8 @@ class DriverMsgBoxListAdapter(private val activity: Activity) :
ssm
} else if(data!![position].type == MsgBoxType.AUTOPILOT){
autopilot
} else if(data!![position].type == MsgBoxType.FSM){
fsm
} else if(data!![position].type == MsgBoxType.V2X || data!![position].type == MsgBoxType.OBU){
v2x
} else {
@@ -852,4 +869,12 @@ class DriverMsgBoxListAdapter(private val activity: Activity) :
var tvAutopilotContent: TextView = itemView.findViewById(R.id.tvAutopilotContent)
}
//fsm状态
class MsgBoxFSM(itemView: View) : RecyclerView.ViewHolder(itemView){
var ivFSMImage: ImageView = itemView.findViewById(R.id.ivFSMImage)
var tvFSMTitle: TextView = itemView.findViewById(R.id.tvFSMTitle)
var tvFSMTime: TextView = itemView.findViewById(R.id.tvFSMTime)
var tvFSMContent: TextView = itemView.findViewById(R.id.tvFSMContent)
}
}

View File

@@ -0,0 +1,62 @@
<?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="@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/ivFSMImage"
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_warning_take_over"
/>
<TextView
android:id="@+id/tvFSMTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toTopOf="@id/tvFSMContent"
app:layout_constraintLeft_toRightOf="@id/ivFSMImage"
android:layout_marginStart="@dimen/dp_15"
android:textColor="#FFFFFFFF"
android:textSize="@dimen/dp_32"
/>
<TextView
android:id="@+id/tvFSMTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="@id/tvFSMTitle"
app:layout_constraintBottom_toBottomOf="@id/tvFSMTitle"
app:layout_constraintRight_toRightOf="parent"
android:layout_marginEnd="25dp"
android:textColor="#80FFFFFF"
android:textSize="24dp"
/>
<TextView
android:id="@+id/tvFSMContent"
android:layout_width="0dp"
android:layout_height="wrap_content"
app:layout_constraintTop_toBottomOf="@id/tvFSMTitle"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="@id/tvFSMTitle"
app:layout_constraintRight_toRightOf="@id/tvFSMTime"
android:textColor="#B3FFFFFF"
android:textSize="@dimen/dp_28"
android:maxLines="2"
android:ellipsize="end"
/>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -0,0 +1,62 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/clFSMLayout"
android:layout_width="@dimen/dp_804"
android:layout_height="@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/ivFSMImage"
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_warning_take_over"
/>
<TextView
android:id="@+id/tvFSMTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toTopOf="@id/tvFSMContent"
app:layout_constraintLeft_toRightOf="@id/ivFSMImage"
android:layout_marginStart="@dimen/dp_15"
android:textColor="#FFFFFFFF"
android:textSize="@dimen/dp_32"
/>
<TextView
android:id="@+id/tvFSMTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="@id/tvFSMTitle"
app:layout_constraintBottom_toBottomOf="@id/tvFSMTitle"
app:layout_constraintRight_toRightOf="parent"
android:layout_marginEnd="25dp"
android:textColor="#80FFFFFF"
android:textSize="24dp"
/>
<TextView
android:id="@+id/tvFSMContent"
android:layout_width="0dp"
android:layout_height="wrap_content"
app:layout_constraintTop_toBottomOf="@id/tvFSMTitle"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="@id/tvFSMTitle"
app:layout_constraintRight_toRightOf="@id/tvFSMTime"
android:textColor="#B3FFFFFF"
android:textSize="@dimen/dp_28"
android:maxLines="2"
android:ellipsize="end"
/>
</androidx.constraintlayout.widget.ConstraintLayout>