[2.13.0]消息盒子乘客端UI调整
This commit is contained in:
@@ -268,6 +268,7 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
|
||||
if(isChecked){
|
||||
viewPassengerMsgBoxList.visibility = View.VISIBLE
|
||||
viewPassengerMsgBoxBubble.visibility = View.GONE
|
||||
viewPassengerMsgBoxList.notifyData()
|
||||
}else{
|
||||
viewPassengerMsgBoxList.visibility = View.GONE
|
||||
viewPassengerMsgBoxBubble.visibility = View.VISIBLE
|
||||
|
||||
@@ -69,12 +69,16 @@ class DriverMsgBoxBubbleView @JvmOverloads constructor(
|
||||
override fun onDataChanged(category: MsgCategory, msgBoxBean: MsgBoxBean) {
|
||||
UiThreadHandler.post {
|
||||
CallerHmiManager.updateDriverMsgBoxTipView(true)
|
||||
if(category == MsgCategory.NOTICE){
|
||||
MsgBoxConfig.noticeList.add(msgBoxBean)
|
||||
}else if(category == MsgCategory.SYS_INFO){
|
||||
MsgBoxConfig.systemInfoList.add(msgBoxBean)
|
||||
}else if(category == MsgCategory.RECORD_BAG){
|
||||
MsgBoxConfig.recordBagList.add(msgBoxBean)
|
||||
when (category) {
|
||||
MsgCategory.NOTICE -> {
|
||||
MsgBoxConfig.noticeList.add(msgBoxBean)
|
||||
}
|
||||
MsgCategory.SYS_INFO -> {
|
||||
MsgBoxConfig.systemInfoList.add(msgBoxBean)
|
||||
}
|
||||
MsgCategory.RECORD_BAG -> {
|
||||
MsgBoxConfig.recordBagList.add(msgBoxBean)
|
||||
}
|
||||
}
|
||||
if(category == MsgCategory.RECORD_BAG){
|
||||
//弹出被动录包弹窗
|
||||
|
||||
@@ -17,6 +17,7 @@ import com.mogo.eagle.core.function.api.msgbox.IMsgBoxListener
|
||||
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
|
||||
import com.mogo.eagle.core.function.msgbox.MsgBoxConfig
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
import com.mogo.eagle.core.utilcode.util.BarUtils
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
@@ -44,13 +45,11 @@ class PassengerMsgBoxBubbleView @JvmOverloads constructor(
|
||||
private fun initView(){
|
||||
val linearLayoutManager = LinearLayoutManager(context)
|
||||
linearLayoutManager.orientation = LinearLayoutManager.VERTICAL
|
||||
linearLayoutManager.stackFromEnd = true
|
||||
linearLayoutManager.reverseLayout = true
|
||||
// linearLayoutManager.stackFromEnd = true
|
||||
// linearLayoutManager.reverseLayout = true
|
||||
passengerMsgBoxBubbleAdapter = PassengerMsgBoxBubbleAdapter(context as Activity)
|
||||
rvPassengerBubbleList.adapter = passengerMsgBoxBubbleAdapter
|
||||
rvPassengerBubbleList.layoutManager = linearLayoutManager
|
||||
|
||||
// setData()
|
||||
}
|
||||
|
||||
override fun onDataChanged(category: MsgCategory, msgBoxList: MsgBoxBean) {
|
||||
@@ -60,22 +59,12 @@ class PassengerMsgBoxBubbleView @JvmOverloads constructor(
|
||||
|| msgBoxList.type == MsgBoxType.OBU){
|
||||
dataList.add(msgBoxList)
|
||||
passengerMsgBoxBubbleAdapter?.setData(dataList)
|
||||
MsgBoxConfig.noticeList.add(msgBoxList)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// fun setData(){
|
||||
// val list :ArrayList<MsgBoxBean> = ArrayList()
|
||||
// val one = MsgBoxBean(MsgBoxType.OPERATION, OperationMsg(System.currentTimeMillis(),"测试"))
|
||||
// val two = MsgBoxBean(MsgBoxType.OPERATION, OperationMsg(System.currentTimeMillis(),"测试"))
|
||||
// val three = MsgBoxBean(MsgBoxType.OPERATION, OperationMsg(System.currentTimeMillis(),"测试"))
|
||||
// list.add(one)
|
||||
// list.add(two)
|
||||
// list.add(three)
|
||||
// passengerMsgBoxBubbleAdapter?.setData(list)
|
||||
// }
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
if(AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode) &&
|
||||
|
||||
@@ -13,6 +13,7 @@ import com.mogo.eagle.core.data.msgbox.V2XMsg
|
||||
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.function.hmi.ui.msgbox.adapter.PassengerMsgBoxListAdapter
|
||||
import com.mogo.eagle.core.function.msgbox.MsgBoxConfig
|
||||
import com.mogo.eagle.core.utilcode.util.ResourceUtils.getDrawable
|
||||
import kotlinx.android.synthetic.main.layout_passenger_msg_box_list.view.*
|
||||
|
||||
@@ -28,6 +29,7 @@ class PassengerMsgBoxListView @JvmOverloads constructor(
|
||||
) : ConstraintLayout(context, attrs, defStyleAttr){
|
||||
|
||||
var passengerMsgBoxListAdapter: PassengerMsgBoxListAdapter ?= null
|
||||
private var noticeList: ArrayList<MsgBoxBean> ?= null
|
||||
|
||||
init{
|
||||
LayoutInflater.from(context).inflate(R.layout.layout_passenger_msg_box_list, this, true)
|
||||
@@ -44,23 +46,20 @@ class PassengerMsgBoxListView @JvmOverloads constructor(
|
||||
rvPassengerList.layoutManager = linearLayoutManager
|
||||
rvPassengerList.addItemDecoration(divider)
|
||||
//获取通知消息列表
|
||||
val noticeList: List<MsgBoxBean>? = CallerMsgBoxManager.getCachedNotifyData()
|
||||
noticeList= CallerMsgBoxManager.getCachedNotifyData() as ArrayList<MsgBoxBean>?
|
||||
noticeList?.reversed()
|
||||
noticeList?.let {
|
||||
passengerMsgBoxListAdapter?.setData(it.reversed())
|
||||
passengerMsgBoxListAdapter?.setData(it)
|
||||
}
|
||||
|
||||
// setData()
|
||||
}
|
||||
|
||||
fun setData(){
|
||||
val list :ArrayList<MsgBoxBean> = ArrayList()
|
||||
val one = MsgBoxBean(MsgBoxType.V2X, V2XMsg("","ceshiyixa"))
|
||||
val two = MsgBoxBean(MsgBoxType.OPERATION, V2XMsg("","ceshiyixa1"))
|
||||
val three = MsgBoxBean(MsgBoxType.OPERATION, V2XMsg("","ceshiyixa2"))
|
||||
list.add(one)
|
||||
list.add(two)
|
||||
list.add(three)
|
||||
passengerMsgBoxListAdapter?.setData(list)
|
||||
fun notifyData(){
|
||||
val localNoticeList = MsgBoxConfig.noticeList.reversed()
|
||||
noticeList?.addAll(0,localNoticeList)
|
||||
noticeList?.let {
|
||||
passengerMsgBoxListAdapter?.setData(it)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -244,7 +244,7 @@
|
||||
|
||||
<com.mogo.eagle.core.function.hmi.ui.msgbox.PassengerMsgBoxBubbleView
|
||||
android:id="@+id/viewPassengerMsgBoxBubble"
|
||||
android:layout_width="864px"
|
||||
android:layout_width="650px"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintBottom_toTopOf="@id/cbMsgBoxPassenger"
|
||||
app:layout_constraintLeft_toLeftOf="@id/cbMsgBoxPassenger"
|
||||
|
||||
@@ -41,6 +41,8 @@
|
||||
android:ellipsize="end"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="36px"
|
||||
android:layout_marginStart="25px"
|
||||
android:layout_marginEnd="25px"
|
||||
/>
|
||||
|
||||
</com.mogo.eagle.core.widget.RoundConstraintLayout>
|
||||
@@ -20,7 +20,7 @@
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textColor="#99FFFFFF"
|
||||
android:textSize="26px"
|
||||
/>
|
||||
|
||||
@@ -37,6 +37,8 @@
|
||||
android:ellipsize="end"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="36px"
|
||||
android:layout_marginStart="25px"
|
||||
android:layout_marginEnd="25px"
|
||||
/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -13,8 +13,8 @@
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
android:layout_marginStart="20px"
|
||||
android:layout_marginEnd="20px"
|
||||
android:layout_marginStart="30px"
|
||||
android:layout_marginEnd="30px"
|
||||
/>
|
||||
|
||||
</com.mogo.eagle.core.widget.RoundConstraintLayout>
|
||||
Reference in New Issue
Block a user