[m1]消息盒子增加停车预告运营消息
This commit is contained in:
@@ -9,6 +9,7 @@ import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxType
|
||||
import com.mogo.eagle.core.data.msgbox.MsgCategory
|
||||
import com.mogo.eagle.core.data.msgbox.OperationMsg
|
||||
import com.mogo.eagle.core.function.api.datacenter.msgbox.IMsgBoxListener
|
||||
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxEventListenerManager
|
||||
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxListenerManager
|
||||
@@ -62,6 +63,16 @@ class MMsgBoxBubbleView @JvmOverloads constructor(
|
||||
mMsgBoxBubbleAdapter?.setData(dataList)
|
||||
}
|
||||
}
|
||||
if(msgBoxList.type == MsgBoxType.OPERATION){
|
||||
if((msgBoxList.bean as OperationMsg).type == 2){
|
||||
MsgBoxConfig.noticeList.add(msgBoxList)
|
||||
if(isShowData){
|
||||
CallerMsgBoxEventListenerManager.invokeUpdateTipListener(true)
|
||||
dataList.add(msgBoxList)
|
||||
mMsgBoxBubbleAdapter?.setData(dataList)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxType
|
||||
import com.mogo.eagle.core.data.msgbox.MsgCategory
|
||||
import com.mogo.eagle.core.data.msgbox.OperationMsg
|
||||
import com.mogo.eagle.core.function.api.datacenter.msgbox.IMsgBoxEventListener
|
||||
import com.mogo.eagle.core.function.api.datacenter.msgbox.IMsgBoxListener
|
||||
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxEventListenerManager
|
||||
@@ -64,6 +65,15 @@ class MMsgBoxListView @JvmOverloads constructor(
|
||||
mMsgBoxListAdapter?.setData(it)
|
||||
}
|
||||
}
|
||||
if(msgBoxList.type == MsgBoxType.OPERATION){
|
||||
if((msgBoxList.bean as OperationMsg).type == 2){
|
||||
noticeList?.add(0,msgBoxList)
|
||||
noticeList?.let {
|
||||
mMsgBoxListAdapter?.setData(it)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,6 +28,7 @@ class MMsgBoxBubbleAdapter(private val activity: Activity): RecyclerView.Adapter
|
||||
private val notice: Int = 1
|
||||
private val v2x: Int = 2
|
||||
private val summary: Int = 3
|
||||
private val operation: Int = 4
|
||||
|
||||
var countDownTimer: CountDownTimer?=null
|
||||
|
||||
@@ -49,6 +50,10 @@ class MMsgBoxBubbleAdapter(private val activity: Activity): RecyclerView.Adapter
|
||||
val view = LayoutInflater.from(parent.context).inflate(R.layout.item_m_msg_box_summary,parent,false)
|
||||
BubbleSummaryHolder(view)
|
||||
}
|
||||
operation -> {
|
||||
val view = LayoutInflater.from(parent.context).inflate(R.layout.item_m_msg_box_operation,parent,false)
|
||||
BubbleOperationHolder(view)
|
||||
}
|
||||
else -> {
|
||||
val view = LayoutInflater.from(parent.context).inflate(R.layout.item_m_msg_box_v2x,parent,false)
|
||||
BubbleV2XHolder(view)
|
||||
@@ -120,6 +125,13 @@ class MMsgBoxBubbleAdapter(private val activity: Activity): RecyclerView.Adapter
|
||||
}
|
||||
}
|
||||
}
|
||||
is BubbleOperationHolder ->{
|
||||
data?.let {
|
||||
val operationMsg = it[position].bean as OperationMsg
|
||||
holder.tvMOperationTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat())
|
||||
holder.tvMOperationContent.text = operationMsg.content
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
val msgBoxBean: MsgBoxBean = data!![position]
|
||||
@@ -146,6 +158,8 @@ class MMsgBoxBubbleAdapter(private val activity: Activity): RecyclerView.Adapter
|
||||
notice
|
||||
}else if(data!![position].type == MsgBoxType.V2X && data!![position].sourceType == DataSourceType.SUMMARY){
|
||||
summary
|
||||
}else if(data!![position].type == MsgBoxType.OPERATION){
|
||||
operation
|
||||
} else{
|
||||
v2x
|
||||
}
|
||||
@@ -175,4 +189,10 @@ class MMsgBoxBubbleAdapter(private val activity: Activity): RecyclerView.Adapter
|
||||
var tvMSummaryTime: TextView = itemView.findViewById(R.id.tvMSummaryTime)
|
||||
}
|
||||
|
||||
//通知消息
|
||||
class BubbleOperationHolder(itemView: View): RecyclerView.ViewHolder(itemView){
|
||||
var tvMOperationTime: TextView = itemView.findViewById(R.id.tvMOperationTime)
|
||||
var tvMOperationContent: TextView = itemView.findViewById(R.id.tvMOperationContent)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -9,10 +9,7 @@ import android.widget.TextView
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.mogo.eagle.core.data.enums.DataSourceType
|
||||
import com.mogo.eagle.core.data.enums.EventTypeEnumNew
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxType
|
||||
import com.mogo.eagle.core.data.msgbox.NoticeFrCloudMsg
|
||||
import com.mogo.eagle.core.data.msgbox.V2XMsg
|
||||
import com.mogo.eagle.core.data.msgbox.*
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
|
||||
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxEventListenerManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
@@ -28,6 +25,7 @@ class MMsgBoxListAdapter(private val activity: Activity): RecyclerView.Adapter<R
|
||||
private val notice: Int = 1
|
||||
private val v2x: Int = 2
|
||||
private val summary: Int = 3
|
||||
private val operation: Int = 4
|
||||
|
||||
fun setData(data: List<MsgBoxBean>){
|
||||
this.data = data
|
||||
@@ -44,6 +42,10 @@ class MMsgBoxListAdapter(private val activity: Activity): RecyclerView.Adapter<R
|
||||
val view = LayoutInflater.from(parent.context).inflate(R.layout.item_m_msg_list_summary,parent,false)
|
||||
ListSummaryHolder(view)
|
||||
}
|
||||
operation -> {
|
||||
val view = LayoutInflater.from(parent.context).inflate(R.layout.item_m_msg_list_operation,parent,false)
|
||||
ListOperationHolder(view)
|
||||
}
|
||||
else -> {
|
||||
val view = LayoutInflater.from(parent.context).inflate(R.layout.item_m_msg_list_v2x,parent,false)
|
||||
ListV2XHolder(view)
|
||||
@@ -111,6 +113,13 @@ class MMsgBoxListAdapter(private val activity: Activity): RecyclerView.Adapter<R
|
||||
}
|
||||
}
|
||||
}
|
||||
is ListOperationHolder -> {
|
||||
data?.let {
|
||||
val operationMsg = it[position].bean as OperationMsg
|
||||
holder.tvMOperationTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat())
|
||||
holder.tvMOperationContent.text = operationMsg.content
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -121,7 +130,9 @@ class MMsgBoxListAdapter(private val activity: Activity): RecyclerView.Adapter<R
|
||||
notice
|
||||
}else if(data!![position].type == MsgBoxType.V2X && data!![position].sourceType == DataSourceType.SUMMARY){
|
||||
summary
|
||||
} else{
|
||||
}else if(data!![position].type == MsgBoxType.OPERATION){
|
||||
operation
|
||||
}else{
|
||||
v2x
|
||||
}
|
||||
}
|
||||
@@ -149,4 +160,10 @@ class MMsgBoxListAdapter(private val activity: Activity): RecyclerView.Adapter<R
|
||||
var tvMSummaryTime: TextView = itemView.findViewById(R.id.tvMSummaryTime)
|
||||
}
|
||||
|
||||
//运营消息
|
||||
class ListOperationHolder(itemView: View): RecyclerView.ViewHolder(itemView){
|
||||
var tvMOperationTime: TextView = itemView.findViewById(R.id.tvMOperationTime)
|
||||
var tvMOperationContent: TextView = itemView.findViewById(R.id.tvMOperationContent)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<com.mogo.eagle.core.widget.RoundConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="450dp"
|
||||
android:layout_height="110dp"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:background="#FFFFFFFF"
|
||||
app:roundLayoutRadius="@dimen/dp_18"
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
android:layout_marginBottom="@dimen/dp_10">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivMOperationImage"
|
||||
android:layout_width="@dimen/dp_83"
|
||||
android:layout_height="@dimen/dp_83"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
android:layout_marginStart="@dimen/dp_13"
|
||||
android:src="@drawable/icon_msg_box_operation_stop"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvMOperationTime"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
android:textColor="#99203555"
|
||||
android:textSize="18dp"
|
||||
android:layout_marginEnd="@dimen/dp_20"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvMOperationContent"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toRightOf="@id/ivMOperationImage"
|
||||
app:layout_constraintRight_toLeftOf="@id/tvMOperationTime"
|
||||
android:gravity="start"
|
||||
android:textColor="#FF203555"
|
||||
android:textSize="20dp"
|
||||
android:layout_marginStart="@dimen/dp_13"
|
||||
android:layout_marginEnd="@dimen/dp_13"
|
||||
/>
|
||||
|
||||
|
||||
|
||||
</com.mogo.eagle.core.widget.RoundConstraintLayout>
|
||||
@@ -0,0 +1,46 @@
|
||||
<?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="@dimen/dp_100"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivMOperationImage"
|
||||
android:layout_width="@dimen/dp_68"
|
||||
android:layout_height="@dimen/dp_68"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
android:layout_marginStart="@dimen/dp_16"
|
||||
android:src="@drawable/icon_msg_box_operation_stop"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvMOperationTime"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
android:textColor="#FF4A5B76"
|
||||
android:textSize="@dimen/dp_18"
|
||||
android:layout_marginEnd="@dimen/dp_10"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvMOperationContent"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toRightOf="@id/ivMOperationImage"
|
||||
app:layout_constraintRight_toLeftOf="@id/tvMOperationTime"
|
||||
android:gravity="start"
|
||||
android:textColor="#FF203555"
|
||||
android:textSize="@dimen/dp_20"
|
||||
android:layout_marginStart="@dimen/dp_16"
|
||||
android:layout_marginEnd="@dimen/dp_16"
|
||||
/>
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
Reference in New Issue
Block a user