[2.13.0]消息盒子调整UI

This commit is contained in:
xuxinchao
2022-12-03 11:37:40 +08:00
parent 095c926fb6
commit 3fc46fbcfc
18 changed files with 162 additions and 53 deletions

View File

@@ -257,10 +257,12 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
viewDriverMsgBoxList.visibility = View.VISIBLE
viewDriverMsgBoxList.notifyData()
viewDriverMsgBoxBubble.visibility = View.GONE
viewDriverMsgBoxBubble.isShowData(false)
CallerHmiManager.updateDriverMsgBoxTipView(false)
}else{
viewDriverMsgBoxList.visibility = View.GONE
viewDriverMsgBoxBubble.visibility = View.VISIBLE
viewDriverMsgBoxBubble.isShowData(true)
}
}
@@ -269,9 +271,12 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
viewPassengerMsgBoxList.visibility = View.VISIBLE
viewPassengerMsgBoxBubble.visibility = View.GONE
viewPassengerMsgBoxList.notifyData()
viewPassengerMsgBoxBubble.isShowData(false)
CallerHmiManager.updatePassengerMsgBoxTipView(false)
}else{
viewPassengerMsgBoxList.visibility = View.GONE
viewPassengerMsgBoxBubble.visibility = View.VISIBLE
viewPassengerMsgBoxBubble.isShowData(true)
}
}
@@ -459,6 +464,14 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
}
}
override fun updatePassengerMsgBoxTipView(show: Boolean) {
if(show){
MsgBoxPTipView.visibility = View.VISIBLE
}else{
MsgBoxPTipView.visibility = View.GONE
}
}
/**
* 设置 红绿灯 代理View
*/

View File

@@ -46,6 +46,7 @@ class DriverMsgBoxBubbleView @JvmOverloads constructor(
private val TAG = "DriverMsgBoxBubbleView"
private val dataList :ArrayList<MsgBoxBean> = ArrayList()
private var isShowData = true
private fun initView() {
val linearLayoutManager = LinearLayoutManager(context)
@@ -65,10 +66,16 @@ class DriverMsgBoxBubbleView @JvmOverloads constructor(
rvBubbleList.layoutManager = linearLayoutManager
}
/**
* 是否展示接收消息,消息盒子打开状态下不再展示气泡消息
* @param show true 展示false 不展示
*/
fun isShowData(show: Boolean){
isShowData = show
}
override fun onDataChanged(category: MsgCategory, msgBoxBean: MsgBoxBean) {
UiThreadHandler.post {
CallerHmiManager.updateDriverMsgBoxTipView(true)
when (category) {
MsgCategory.NOTICE -> {
MsgBoxConfig.noticeList.add(msgBoxBean)
@@ -80,13 +87,16 @@ class DriverMsgBoxBubbleView @JvmOverloads constructor(
MsgBoxConfig.recordBagList.add(msgBoxBean)
}
}
if(category == MsgCategory.RECORD_BAG){
//弹出被动录包弹窗
CallerDevaToolsManager.onReceiveBadCaseRecord(msgBoxBean,context as Activity,true)
}else{
rvBubbleList.visibility = View.VISIBLE
dataList.add(msgBoxBean)
driverMsgBoxBubbleAdapter?.setData(dataList)
if(isShowData){
CallerHmiManager.updateDriverMsgBoxTipView(true)
if(category == MsgCategory.RECORD_BAG){
//弹出被动录包弹窗
CallerDevaToolsManager.onReceiveBadCaseRecord(msgBoxBean,context as Activity,true)
}else{
rvBubbleList.visibility = View.VISIBLE
dataList.add(msgBoxBean)
driverMsgBoxBubbleAdapter?.setData(dataList)
}
}
}
}

View File

@@ -14,6 +14,7 @@ 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.msgbox.IMsgBoxListener
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxListenerManager
import com.mogo.eagle.core.function.hmi.R
import com.mogo.eagle.core.function.hmi.ui.msgbox.adapter.PassengerMsgBoxBubbleAdapter
@@ -36,7 +37,9 @@ class PassengerMsgBoxBubbleView @JvmOverloads constructor(
private val TAG = "PassengerMsgBoxBubbleView"
private val dataList :ArrayList<MsgBoxBean> = ArrayList()
var passengerMsgBoxBubbleAdapter: PassengerMsgBoxBubbleAdapter ?= null
private var passengerMsgBoxBubbleAdapter: PassengerMsgBoxBubbleAdapter ?= null
private var isShowData = true
init {
LayoutInflater.from(context).inflate(R.layout.layout_passenger_msg_box_bubble, this, true)
initView()
@@ -52,14 +55,25 @@ class PassengerMsgBoxBubbleView @JvmOverloads constructor(
rvPassengerBubbleList.layoutManager = linearLayoutManager
}
/**
* 是否展示接收消息,消息盒子打开状态下不再展示气泡消息
* @param show true 展示false 不展示
*/
fun isShowData(show: Boolean){
isShowData = show
}
override fun onDataChanged(category: MsgCategory, msgBoxList: MsgBoxBean) {
UiThreadHandler.post {
if(category == MsgCategory.NOTICE){
if(msgBoxList.type == MsgBoxType.NOTICE || msgBoxList.type == MsgBoxType.V2X
|| msgBoxList.type == MsgBoxType.OBU){
dataList.add(msgBoxList)
passengerMsgBoxBubbleAdapter?.setData(dataList)
MsgBoxConfig.noticeList.add(msgBoxList)
if(isShowData){
CallerHmiManager.updatePassengerMsgBoxTipView(true)
dataList.add(msgBoxList)
passengerMsgBoxBubbleAdapter?.setData(dataList)
}
}
}
}

View File

@@ -107,6 +107,7 @@ class DriverMsgBoxListAdapter(private val activity: Activity) : RecyclerView.Ada
}
holder.tvReportTimeNormal.text = "时间:${TimeUtils.millis2String(it[position].timestamp)}"
holder.tvReportTimeOpen.text = "时间:${TimeUtils.millis2String(it[position].timestamp)}"
holder.tvReportTime.text =TimeUtils.millis2String(it[position].timestamp,getHourMinFormat())
var resultStr = "类型:"
for (result in reportEntity.resultList){
resultStr = "${resultStr}${CallerAutoPilotManager.getReportResultDesc(result)}"
@@ -114,6 +115,11 @@ class DriverMsgBoxListAdapter(private val activity: Activity) : RecyclerView.Ada
holder.tvReportTypeNormal.text = resultStr
holder.tvReportTypeOpen.text = resultStr
holder.tvReportReasonOpen.text = "原因:${reportEntity.msg}"
var actionStr = ""
for (action in reportEntity.actionsList){
actionStr = "${actionStr}${CallerAutoPilotManager.getReportActionDesc(action)}"
}
holder.tvReportActionOpen.text = "建议操作:$actionStr"
holder.tvStatusSelect.setOnClickListener {
if(holder.tvReportLevelNormal.isVisible){
holder.tvStatusSelect.setCompoundDrawablesWithIntrinsicBounds(getDrawable(R.drawable.icon_msg_close),null,null,null)
@@ -127,6 +133,7 @@ class DriverMsgBoxListAdapter(private val activity: Activity) : RecyclerView.Ada
holder.tvReportTimeOpen.visibility = View.VISIBLE
holder.tvReportTypeOpen.visibility = View.VISIBLE
holder.tvReportReasonOpen.visibility = View.VISIBLE
holder.tvReportActionOpen.visibility = View.VISIBLE
}else{
holder.tvStatusSelect.setCompoundDrawablesWithIntrinsicBounds(getDrawable(R.drawable.icon_msg_open),null,null,null)
holder.ivReportImageNormal.visibility = View.VISIBLE
@@ -139,6 +146,7 @@ class DriverMsgBoxListAdapter(private val activity: Activity) : RecyclerView.Ada
holder.tvReportTimeOpen.visibility = View.GONE
holder.tvReportTypeOpen.visibility = View.GONE
holder.tvReportReasonOpen.visibility = View.GONE
holder.tvReportActionOpen.visibility = View.GONE
}
}
}
@@ -243,11 +251,13 @@ class DriverMsgBoxListAdapter(private val activity: Activity) : RecyclerView.Ada
var tvReportTimeNormal: TextView = itemView.findViewById(R.id.tvReportTimeNormal)
var tvReportTypeNormal: TextView = itemView.findViewById(R.id.tvReportTypeNormal)
var tvStatusSelect: TextView = itemView.findViewById(R.id.tvStatusSelect)
var tvReportTime: TextView = itemView.findViewById(R.id.tvReportTime)
var ivReportImageOpen: ImageView = itemView.findViewById(R.id.ivReportImageOpen)
var tvReportLevelOpen: TextView = itemView.findViewById(R.id.tvReportLevelOpen)
var tvReportTimeOpen: TextView = itemView.findViewById(R.id.tvReportTimeOpen)
var tvReportTypeOpen: TextView = itemView.findViewById(R.id.tvReportTypeOpen)
var tvReportReasonOpen: TextView = itemView.findViewById(R.id.tvReportReasonOpen)
var tvReportActionOpen: TextView = itemView.findViewById(R.id.tvReportActionOpen)
}
//运营平台

Binary file not shown.

After

Width:  |  Height:  |  Size: 122 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/icon_msg_box_p" android:state_checked="false" />
<item android:drawable="@drawable/icon_msg_box_p" android:state_checked="true" />
</selector>

View File

@@ -182,7 +182,7 @@
app:layout_goneMarginTop="40dp"
tools:visibility="gone" />
<!--消息盒子选择入口-->
<!--消息盒子司机端选择入口-->
<CheckBox
android:id="@+id/cbMsgBoxDriver"
android:layout_width="150dp"
@@ -195,20 +195,7 @@
android:background="@drawable/selector_msg_box"
android:visibility="gone"
/>
<CheckBox
android:id="@+id/cbMsgBoxPassenger"
android:layout_width="150dp"
android:layout_height="150dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
android:layout_marginStart="300dp"
android:layout_marginBottom="30px"
android:button="@null"
android:background="@drawable/selector_msg_box"
android:visibility="gone"
/>
<!--司机端消息提示-->
<View
android:id="@+id/MsgBoxTipView"
android:layout_width="8dp"
@@ -222,6 +209,34 @@
android:visibility="gone"
/>
<!--消息盒子乘客端选择入口-->
<CheckBox
android:id="@+id/cbMsgBoxPassenger"
android:layout_width="100dp"
android:layout_height="100dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
android:layout_marginStart="300dp"
android:layout_marginBottom="50dp"
android:button="@null"
android:background="@drawable/selector_msg_box_p"
android:visibility="gone"
/>
<!--乘客端消息提示-->
<View
android:id="@+id/MsgBoxPTipView"
android:layout_width="8dp"
android:layout_height="8dp"
android:background="@drawable/version_upgrade_tips_background"
android:translationZ="30dp"
app:layout_constraintCircle="@id/cbMsgBoxPassenger"
app:layout_constraintCircleAngle="40"
app:layout_constraintCircleRadius="32dp"
tools:ignore="MissingConstraints"
android:visibility="gone"
/>
<com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxListView
android:id="@+id/viewDriverMsgBoxList"
android:layout_width="864px"

View File

@@ -4,7 +4,7 @@
android:layout_width="804px"
android:layout_height="160px"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="#1B2966"
android:background="#1A2344"
app:roundLayoutRadius="24px"
android:layout_gravity="center_horizontal"
android:layout_marginStart="30px"
@@ -43,6 +43,7 @@
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="@id/ivBadCaseImage"
app:layout_constraintLeft_toRightOf="@id/ivBadCaseImage"
android:layout_marginBottom="5px"
android:layout_marginStart="25px"
android:textColor="#B3FFFFFF"
android:textSize="30px"
@@ -56,7 +57,7 @@
app:layout_constraintTop_toTopOf="@id/tvRecordTip"
android:textColor="#80FFFFFF"
android:textSize="24px"
android:layout_marginEnd="15px"
android:layout_marginEnd="25px"
/>
<TextView
@@ -66,7 +67,9 @@
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="@id/tvBagRecordTime"
app:layout_constraintBottom_toBottomOf="@id/tvBagRecordTime"
android:layout_marginEnd="15px"
android:paddingEnd="25px"
android:paddingTop="10px"
android:paddingBottom="10px"
android:text="查看"
android:textColor="#FFFFFFFF"
android:textSize="30px"

View File

@@ -44,7 +44,7 @@
app:layout_constraintLeft_toLeftOf="@id/tvReportLevelNormal"
android:textColor="#B3FFFFFF"
android:textSize="28px"
android:layout_marginTop="10px"
android:layout_marginTop="5px"
/>
<TextView
@@ -55,7 +55,7 @@
app:layout_constraintLeft_toLeftOf="@id/tvReportTimeNormal"
app:layout_constraintRight_toRightOf="@id/tvStatusSelect"
app:layout_constraintBottom_toBottomOf="parent"
android:layout_marginTop="10px"
android:layout_marginTop="5px"
android:layout_marginBottom="10px"
android:textColor="#B3FFFFFF"
android:gravity="start"
@@ -84,6 +84,18 @@
android:paddingBottom="5px"
/>
<TextView
android:id="@+id/tvReportTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="@id/tvStatusSelect"
app:layout_constraintBottom_toBottomOf="@id/tvStatusSelect"
app:layout_constraintRight_toLeftOf="@id/tvStatusSelect"
android:layout_marginEnd="20px"
android:textColor="#80FFFFFF"
android:textSize="24px"
/>
<ImageView
android:id="@+id/ivReportImageOpen"
android:layout_width="44px"
@@ -114,7 +126,7 @@
android:layout_height="wrap_content"
app:layout_constraintTop_toBottomOf="@id/ivReportImageOpen"
app:layout_constraintLeft_toLeftOf="@id/ivReportImageOpen"
android:layout_marginTop="10px"
android:layout_marginTop="5px"
android:textColor="#B3FFFFFF"
android:textSize="28px"
android:visibility="gone"
@@ -126,7 +138,7 @@
android:layout_height="wrap_content"
app:layout_constraintTop_toBottomOf="@id/tvReportTimeOpen"
app:layout_constraintLeft_toLeftOf="@id/tvReportTimeOpen"
android:layout_marginTop="10px"
android:layout_marginTop="5px"
android:textColor="#B3FFFFFF"
android:textSize="28px"
android:visibility="gone"
@@ -139,9 +151,22 @@
app:layout_constraintTop_toBottomOf="@id/tvReportTypeOpen"
app:layout_constraintLeft_toLeftOf="@id/tvReportTypeOpen"
app:layout_constraintRight_toRightOf="@id/tvStatusSelect"
app:layout_constraintBottom_toBottomOf="parent"
android:gravity="start"
android:layout_marginTop="10px"
android:layout_marginTop="5px"
android:textColor="#B3FFFFFF"
android:textSize="28px"
android:visibility="gone"
/>
<TextView
android:id="@+id/tvReportActionOpen"
android:layout_width="0dp"
android:layout_height="wrap_content"
app:layout_constraintTop_toBottomOf="@id/tvReportReasonOpen"
app:layout_constraintLeft_toLeftOf="@id/tvReportReasonOpen"
app:layout_constraintRight_toRightOf="@id/tvStatusSelect"
app:layout_constraintBottom_toBottomOf="parent"
android:layout_marginTop="5px"
android:layout_marginBottom="10px"
android:textColor="#B3FFFFFF"
android:textSize="28px"

View File

@@ -29,7 +29,8 @@
android:id="@+id/tvOperationTitleNormal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="@id/ivOperationImageNormal"
app:layout_constraintTop_toTopOf="@id/tvOperationStatusSelect"
app:layout_constraintBottom_toBottomOf="@id/tvOperationStatusSelect"
app:layout_constraintLeft_toRightOf="@id/ivOperationImageNormal"
android:text="运营平台"
android:textColor="#FFFFFFFF"
@@ -44,7 +45,7 @@
app:layout_constraintTop_toBottomOf="@id/tvOperationTitleNormal"
app:layout_constraintLeft_toLeftOf="@id/tvOperationTitleNormal"
app:layout_constraintRight_toRightOf="@id/tvOperationStatusSelect"
android:layout_marginEnd="25px"
android:layout_marginTop="10px"
android:textColor="#B3FFFFFF"
android:gravity="start"
android:textSize="28px"
@@ -100,8 +101,8 @@
android:id="@+id/tvOperationTitleOpen"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="@id/ivOperationImageOpen"
app:layout_constraintBottom_toBottomOf="@id/ivOperationImageOpen"
app:layout_constraintTop_toTopOf="@id/tvOperationStatusSelect"
app:layout_constraintBottom_toBottomOf="@id/tvOperationStatusSelect"
app:layout_constraintLeft_toRightOf="@id/ivOperationImageOpen"
android:text="运营平台"
android:textColor="#FFFFFFFF"
@@ -119,7 +120,7 @@
app:layout_constraintLeft_toLeftOf="@id/ivOperationImageOpen"
app:layout_constraintRight_toRightOf="@id/tvOperationStatusSelect"
android:gravity="start"
android:layout_marginTop="15px"
android:layout_marginTop="10px"
android:layout_marginBottom="15px"
android:textColor="#B3FFFFFF"
android:textSize="28px"

View File

@@ -37,10 +37,9 @@
android:layout_height="wrap_content"
app:layout_constraintLeft_toRightOf="@id/ivV2XImage"
app:layout_constraintRight_toRightOf="@id/tvV2XTime"
app:layout_constraintTop_toBottomOf="@id/tvV2XTime"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
android:layout_marginStart="25px"
android:layout_marginBottom="25px"
android:textColor="#FFFFFFFF"
android:textSize="32px"
android:maxLines="1"

View File

@@ -42,7 +42,7 @@
app:layout_constraintTop_toTopOf="@id/tvBubbleOperationTitle"
app:layout_constraintBottom_toBottomOf="@id/tvBubbleOperationTitle"
app:layout_constraintRight_toRightOf="parent"
android:layout_marginEnd="20px"
android:layout_marginEnd="25px"
android:textColor="#80FFFFFF"
android:textSize="24px"
/>
@@ -54,7 +54,7 @@
app:layout_constraintLeft_toLeftOf="@id/tvBubbleOperationTitle"
app:layout_constraintRight_toRightOf="@id/tvBubbleOperationTime"
app:layout_constraintTop_toBottomOf="@id/tvBubbleOperationTitle"
android:layout_marginTop="20px"
android:layout_marginTop="10px"
android:gravity="start"
android:maxLines="2"
android:ellipsize="end"

View File

@@ -42,7 +42,7 @@
android:layout_height="wrap_content"
app:layout_constraintTop_toBottomOf="@id/tvBubbleReportTitle"
app:layout_constraintLeft_toLeftOf="@id/tvBubbleReportTitle"
android:layout_marginTop="10px"
android:layout_marginTop="5px"
android:textColor="#B3FFFFFF"
android:textSize="28px"
/>
@@ -53,7 +53,7 @@
android:layout_height="wrap_content"
app:layout_constraintTop_toBottomOf="@id/tvBubbleReportTime"
app:layout_constraintLeft_toLeftOf="@id/tvBubbleReportTime"
android:layout_marginTop="10px"
android:layout_marginTop="5px"
android:textColor="#B3FFFFFF"
android:textSize="28px"
/>

View File

@@ -10,8 +10,8 @@
android:id="@+id/rvBubbleList"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingTop="10px"
android:paddingBottom="10px"
android:paddingTop="15px"
android:paddingBottom="15px"
android:visibility="gone"
/>

View File

@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<com.mogo.eagle.core.widget.RoundConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="864px"
android:layout_height="746px"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="#2E3868"
app:roundLayoutRadius="40px">
android:background="@drawable/bg_msg_box"
>
<TextView
android:id="@+id/tvMsgNotice"
@@ -86,4 +86,4 @@
app:layout_constraintRight_toRightOf="parent"
/>
</com.mogo.eagle.core.widget.RoundConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>