[2.14.0]消息盒子
This commit is contained in:
@@ -73,6 +73,8 @@ import com.mogo.eagle.core.function.hmi.ui.bindingcar.ToBindingCarDialog
|
||||
import com.mogo.eagle.core.function.hmi.ui.bindingcar.UpgradeAppDialog
|
||||
import com.mogo.eagle.core.function.hmi.ui.camera.CameraListView
|
||||
import com.mogo.eagle.core.function.hmi.ui.camera.RoadVideoDialog
|
||||
import com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxButtonView
|
||||
import com.mogo.eagle.core.function.hmi.ui.msgbox.PassengerMsgBoxButtonView
|
||||
import com.mogo.eagle.core.function.hmi.ui.notice.NoticeCheckDialog
|
||||
import com.mogo.eagle.core.function.hmi.ui.notice.NoticeTrafficDialog
|
||||
import com.mogo.eagle.core.function.hmi.ui.setting.DebugSettingView
|
||||
@@ -253,41 +255,45 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
cbMsgBoxDriver.setOnCheckedChangeListener { _, isChecked ->
|
||||
if(isChecked){
|
||||
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)
|
||||
//消息盒子
|
||||
viewDriverMsgBoxButton.setClickListener(object: DriverMsgBoxButtonView.ClickListener{
|
||||
override fun showMsgBoxList(show: Boolean) {
|
||||
if(show){
|
||||
viewDriverMsgBoxList.visibility = View.VISIBLE
|
||||
viewDriverMsgBoxList.notifyData()
|
||||
viewDriverMsgBoxBubble.visibility = View.GONE
|
||||
viewDriverMsgBoxBubble.isShowData(false)
|
||||
}else{
|
||||
viewDriverMsgBoxList.visibility = View.GONE
|
||||
viewDriverMsgBoxBubble.visibility = View.VISIBLE
|
||||
viewDriverMsgBoxBubble.isShowData(true)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
cbMsgBoxPassenger.setOnCheckedChangeListener { _, isChecked ->
|
||||
if(isChecked){
|
||||
viewPassengerMsgBoxList.visibility = View.VISIBLE
|
||||
viewPassengerMsgBoxBubble.visibility = View.GONE
|
||||
viewPassengerMsgBoxBubble.isShowData(false)
|
||||
CallerHmiManager.updatePassengerMsgBoxTipView(false)
|
||||
}else{
|
||||
viewPassengerMsgBoxList.visibility = View.GONE
|
||||
viewPassengerMsgBoxBubble.visibility = View.VISIBLE
|
||||
viewPassengerMsgBoxBubble.isShowData(true)
|
||||
})
|
||||
|
||||
viewPassengerMsgBoxButton.setClickListener(object: PassengerMsgBoxButtonView.ClickListener{
|
||||
override fun showMsgBoxList(show: Boolean) {
|
||||
if(show){
|
||||
viewPassengerMsgBoxList.visibility = View.VISIBLE
|
||||
viewPassengerMsgBoxBubble.visibility = View.GONE
|
||||
viewPassengerMsgBoxBubble.isShowData(false)
|
||||
}else{
|
||||
viewPassengerMsgBoxList.visibility = View.GONE
|
||||
viewPassengerMsgBoxBubble.visibility = View.VISIBLE
|
||||
viewPassengerMsgBoxBubble.isShowData(true)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
if(AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)){
|
||||
cbMsgBoxDriver.visibility = View.VISIBLE
|
||||
viewDriverMsgBoxButton.visibility = View.VISIBLE
|
||||
viewDriverMsgBoxBubble.visibility = View.VISIBLE
|
||||
}
|
||||
if(AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode) &&
|
||||
AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode)){
|
||||
cbMsgBoxPassenger.visibility = View.VISIBLE
|
||||
viewPassengerMsgBoxButton.visibility = View.VISIBLE
|
||||
viewPassengerMsgBoxBubble.visibility = View.VISIBLE
|
||||
}
|
||||
}
|
||||
@@ -469,22 +475,6 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
|
||||
statusBarView?.updateMfStatus(tag, status)
|
||||
}
|
||||
|
||||
override fun updateDriverMsgBoxTipView(show: Boolean) {
|
||||
if(show){
|
||||
MsgBoxTipView?.visibility = View.VISIBLE
|
||||
}else{
|
||||
MsgBoxTipView?.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
|
||||
override fun updatePassengerMsgBoxTipView(show: Boolean) {
|
||||
if(show){
|
||||
MsgBoxPTipView?.visibility = View.VISIBLE
|
||||
}else{
|
||||
MsgBoxPTipView?.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置 红绿灯 代理View
|
||||
*/
|
||||
|
||||
@@ -13,6 +13,7 @@ import com.mogo.eagle.core.data.msgbox.MsgCategory
|
||||
import com.mogo.eagle.core.function.api.msgbox.IMsgBoxListener
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
|
||||
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxEventListenerManager
|
||||
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.DriverMsgBoxBubbleAdapter
|
||||
@@ -83,7 +84,7 @@ class DriverMsgBoxBubbleView @JvmOverloads constructor(
|
||||
}
|
||||
}
|
||||
if(isShowData){
|
||||
CallerHmiManager.updateDriverMsgBoxTipView(true)
|
||||
CallerMsgBoxEventListenerManager.invokeUpdateTipListener(true)
|
||||
if(category == MsgCategory.RECORD_BAG){
|
||||
//弹出被动录包弹窗
|
||||
CallerDevaToolsManager.onReceiveBadCaseRecord(msgBoxBean,context as Activity,true)
|
||||
|
||||
@@ -0,0 +1,96 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.msgbox
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
|
||||
import com.mogo.eagle.core.function.api.msgbox.IMsgBoxEventListener
|
||||
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxEventListenerManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
import kotlinx.android.synthetic.main.view_driver_msg_box_button.view.*
|
||||
|
||||
/**
|
||||
* @author XuXinChao
|
||||
* @description 消息盒子司机端视图切换按钮
|
||||
* @since: 2023/1/31
|
||||
*/
|
||||
class DriverMsgBoxButtonView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
):ConstraintLayout(context, attrs, defStyleAttr), IMsgBoxEventListener {
|
||||
|
||||
companion object {
|
||||
const val TAG = "DriverMsgBoxButtonView"
|
||||
}
|
||||
|
||||
private var clickListener: ClickListener? = null
|
||||
|
||||
init{
|
||||
LayoutInflater.from(context).inflate(R.layout.view_driver_msg_box_button, this, true)
|
||||
initView()
|
||||
}
|
||||
|
||||
private fun initView(){
|
||||
cbMsgBoxDriver.setOnCheckedChangeListener { _, isChecked ->
|
||||
clickListener?.showMsgBoxList(isChecked)
|
||||
msgBoxTipView.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
if(AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)){
|
||||
CallerMsgBoxEventListenerManager.addListener(TAG,this)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
if(AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)){
|
||||
CallerMsgBoxEventListenerManager.removeListener(TAG)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onSummaryClickEvent() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新新消息提醒红点
|
||||
* @param isShow true:展示;false:不展示
|
||||
*/
|
||||
override fun onUpdateTipEvent(isShow: Boolean) {
|
||||
if(isShow){
|
||||
msgBoxTipView.visibility = View.VISIBLE
|
||||
}else{
|
||||
msgBoxTipView.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
|
||||
override fun onBubbleOperationClickEvent(msgBoxBean: MsgBoxBean) {
|
||||
cbMsgBoxDriver.performClick()
|
||||
}
|
||||
|
||||
override fun onBubbleV2XClickEvent(msgBoxBean: MsgBoxBean) {
|
||||
cbMsgBoxDriver.performClick()
|
||||
}
|
||||
|
||||
override fun onBubbleReportClickEvent(msgBoxBean: MsgBoxBean) {
|
||||
cbMsgBoxDriver.performClick()
|
||||
}
|
||||
|
||||
fun setClickListener(clickListener: ClickListener) {
|
||||
this.clickListener = clickListener
|
||||
}
|
||||
|
||||
interface ClickListener{
|
||||
fun showMsgBoxList(show: Boolean)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -10,7 +10,9 @@ import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
|
||||
import com.mogo.eagle.core.data.msgbox.MsgCategory
|
||||
import com.mogo.eagle.core.function.api.msgbox.IMsgBoxEventListener
|
||||
import com.mogo.eagle.core.function.api.msgbox.IMsgBoxListener
|
||||
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxEventListenerManager
|
||||
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxListenerManager
|
||||
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
@@ -32,7 +34,7 @@ class DriverMsgBoxListView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : ConstraintLayout(context, attrs, defStyleAttr) , IMsgBoxListener {
|
||||
) : ConstraintLayout(context, attrs, defStyleAttr) , IMsgBoxListener, IMsgBoxEventListener {
|
||||
|
||||
init {
|
||||
LayoutInflater.from(context).inflate(R.layout.layout_driver_msg_box_list, this, true)
|
||||
@@ -43,11 +45,13 @@ class DriverMsgBoxListView @JvmOverloads constructor(
|
||||
private var ipcReportList: ArrayList<MsgBoxBean> ?= null
|
||||
private var badCaseList: ArrayList<MsgBoxBean> ?= null
|
||||
private var driverMsgBoxListAdapter: DriverMsgBoxListAdapter ?=null
|
||||
private var linearLayoutManager: LinearLayoutManager ?= null
|
||||
|
||||
private fun initView() {
|
||||
driverMsgBoxListAdapter= DriverMsgBoxListAdapter(context as Activity)
|
||||
rvMsgBoxList.adapter = driverMsgBoxListAdapter
|
||||
rvMsgBoxList.layoutManager = LinearLayoutManager(context)
|
||||
linearLayoutManager = LinearLayoutManager(context)
|
||||
rvMsgBoxList.layoutManager = linearLayoutManager
|
||||
|
||||
//获取通知消息列表
|
||||
noticeList= CallerMsgBoxManager.getCachedNotifyData() as ArrayList<MsgBoxBean>?
|
||||
@@ -195,6 +199,7 @@ class DriverMsgBoxListView @JvmOverloads constructor(
|
||||
super.onAttachedToWindow()
|
||||
if(AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)){
|
||||
CallerMsgBoxListenerManager.addListener(TAG,this)
|
||||
CallerMsgBoxEventListenerManager.addListener(TAG,this)
|
||||
EventBus.getDefault().register(this)
|
||||
}
|
||||
}
|
||||
@@ -203,6 +208,7 @@ class DriverMsgBoxListView @JvmOverloads constructor(
|
||||
super.onDetachedFromWindow()
|
||||
if(AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)){
|
||||
CallerMsgBoxListenerManager.removeListener(TAG)
|
||||
CallerMsgBoxEventListenerManager.removeListener(TAG)
|
||||
EventBus.getDefault().unregister(this)
|
||||
}
|
||||
}
|
||||
@@ -214,4 +220,36 @@ class DriverMsgBoxListView @JvmOverloads constructor(
|
||||
it.remove(msgBoxList)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onSummaryClickEvent() {
|
||||
|
||||
}
|
||||
|
||||
override fun onUpdateTipEvent(isShow: Boolean) {
|
||||
|
||||
}
|
||||
|
||||
override fun onBubbleOperationClickEvent(msgBoxBean: MsgBoxBean) {
|
||||
MsgBoxConfig.setUserRecord(0)
|
||||
notifyData()
|
||||
noticeList?.let {
|
||||
rvMsgBoxList?.scrollToPosition(it.indexOf(msgBoxBean))
|
||||
}
|
||||
}
|
||||
|
||||
override fun onBubbleV2XClickEvent(msgBoxBean: MsgBoxBean) {
|
||||
MsgBoxConfig.setUserRecord(0)
|
||||
notifyData()
|
||||
noticeList?.let {
|
||||
rvMsgBoxList?.scrollToPosition(it.indexOf(msgBoxBean))
|
||||
}
|
||||
}
|
||||
|
||||
override fun onBubbleReportClickEvent(msgBoxBean: MsgBoxBean) {
|
||||
MsgBoxConfig.setUserRecord(1)
|
||||
notifyData()
|
||||
ipcReportList?.let {
|
||||
linearLayoutManager?.scrollToPositionWithOffset(it.indexOf(msgBoxBean),0)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -12,6 +12,7 @@ import com.mogo.eagle.core.data.msgbox.MsgBoxType
|
||||
import com.mogo.eagle.core.data.msgbox.MsgCategory
|
||||
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.CallerMsgBoxEventListenerManager
|
||||
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
|
||||
@@ -64,7 +65,7 @@ class PassengerMsgBoxBubbleView @JvmOverloads constructor(
|
||||
|| msgBoxList.type == MsgBoxType.OBU){
|
||||
MsgBoxConfig.noticeList.add(msgBoxList)
|
||||
if(isShowData){
|
||||
CallerHmiManager.updatePassengerMsgBoxTipView(true)
|
||||
CallerMsgBoxEventListenerManager.invokeUpdateTipListener(true)
|
||||
dataList.add(msgBoxList)
|
||||
passengerMsgBoxBubbleAdapter?.setData(dataList)
|
||||
}
|
||||
|
||||
@@ -0,0 +1,97 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.msgbox
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
|
||||
import com.mogo.eagle.core.function.api.msgbox.IMsgBoxEventListener
|
||||
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxEventListenerManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
import kotlinx.android.synthetic.main.view_passenger_msg_box_button.view.*
|
||||
|
||||
/**
|
||||
* @author XuXinChao
|
||||
* @description 消息盒子乘客端视图切换按钮
|
||||
* @since: 2023/1/31
|
||||
*/
|
||||
class PassengerMsgBoxButtonView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
): ConstraintLayout(context, attrs, defStyleAttr), IMsgBoxEventListener {
|
||||
|
||||
companion object {
|
||||
const val TAG = "PassengerMsgBoxButtonView"
|
||||
}
|
||||
|
||||
private var clickListener: ClickListener? = null
|
||||
|
||||
init{
|
||||
LayoutInflater.from(context).inflate(R.layout.view_passenger_msg_box_button, this, true)
|
||||
initView()
|
||||
}
|
||||
|
||||
private fun initView(){
|
||||
cbMsgBoxPassenger.setOnCheckedChangeListener { _, isChecked ->
|
||||
clickListener?.showMsgBoxList(isChecked)
|
||||
msgBoxPTipView.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
if(AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode) &&
|
||||
AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode)){
|
||||
CallerMsgBoxEventListenerManager.addListener(TAG,this)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
if(AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode) &&
|
||||
AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode)){
|
||||
CallerMsgBoxEventListenerManager.removeListener(TAG)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onSummaryClickEvent() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新新消息提醒红点
|
||||
* @param isShow true:展示;false:不展示
|
||||
*/
|
||||
override fun onUpdateTipEvent(isShow: Boolean) {
|
||||
if(isShow){
|
||||
msgBoxPTipView.visibility = View.VISIBLE
|
||||
}else{
|
||||
msgBoxPTipView.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
|
||||
override fun onBubbleOperationClickEvent(msgBoxBean: MsgBoxBean) {
|
||||
cbMsgBoxPassenger.performClick()
|
||||
}
|
||||
|
||||
override fun onBubbleV2XClickEvent(msgBoxBean: MsgBoxBean) {
|
||||
cbMsgBoxPassenger.performClick()
|
||||
}
|
||||
|
||||
override fun onBubbleReportClickEvent(msgBoxBean: MsgBoxBean) {
|
||||
cbMsgBoxPassenger.performClick()
|
||||
}
|
||||
|
||||
fun setClickListener(clickListener: ClickListener) {
|
||||
this.clickListener = clickListener
|
||||
}
|
||||
|
||||
interface ClickListener{
|
||||
fun showMsgBoxList(show: Boolean)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -11,7 +11,9 @@ import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
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.function.api.msgbox.IMsgBoxEventListener
|
||||
import com.mogo.eagle.core.function.api.msgbox.IMsgBoxListener
|
||||
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxEventListenerManager
|
||||
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxListenerManager
|
||||
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
@@ -30,7 +32,7 @@ class PassengerMsgBoxListView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : ConstraintLayout(context, attrs, defStyleAttr), IMsgBoxListener {
|
||||
) : ConstraintLayout(context, attrs, defStyleAttr), IMsgBoxListener, IMsgBoxEventListener {
|
||||
|
||||
private val TAG = "PassengerMsgBoxListView"
|
||||
var passengerMsgBoxListAdapter: PassengerMsgBoxListAdapter ?= null
|
||||
@@ -78,6 +80,7 @@ class PassengerMsgBoxListView @JvmOverloads constructor(
|
||||
if(AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode) &&
|
||||
AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode)){
|
||||
CallerMsgBoxListenerManager.addListener(TAG,this)
|
||||
CallerMsgBoxEventListenerManager.addListener(TAG,this)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -86,7 +89,30 @@ class PassengerMsgBoxListView @JvmOverloads constructor(
|
||||
if(AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode) &&
|
||||
AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode)){
|
||||
CallerMsgBoxListenerManager.removeListener(TAG)
|
||||
CallerMsgBoxEventListenerManager.removeListener(TAG)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onSummaryClickEvent() {
|
||||
|
||||
}
|
||||
|
||||
override fun onUpdateTipEvent(isShow: Boolean) {
|
||||
|
||||
}
|
||||
|
||||
override fun onBubbleOperationClickEvent(msgBoxBean: MsgBoxBean) {
|
||||
|
||||
}
|
||||
|
||||
override fun onBubbleV2XClickEvent(msgBoxBean: MsgBoxBean) {
|
||||
noticeList?.let {
|
||||
rvPassengerList.scrollToPosition(it.indexOf(msgBoxBean))
|
||||
}
|
||||
}
|
||||
|
||||
override fun onBubbleReportClickEvent(msgBoxBean: MsgBoxBean) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -13,12 +13,14 @@ import com.mogo.eagle.core.data.msgbox.*
|
||||
import com.mogo.eagle.core.data.report.ReportEntity
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
|
||||
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxEventListenerManager
|
||||
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.mogo.glide.GlideApp
|
||||
import com.mogo.eagle.core.utilcode.mogo.glide.transform.GlideRoundedCornersTransform
|
||||
import com.mogo.eagle.core.utilcode.util.TimeUtils
|
||||
import com.mogo.eagle.core.utilcode.util.TimeUtils.getHourMinFormat
|
||||
import com.mogo.eagle.core.widget.RoundCanClickConstraintLayout
|
||||
|
||||
/**
|
||||
* @author XuXinChao
|
||||
@@ -75,14 +77,19 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A
|
||||
when (holder) {
|
||||
is BubbleOperationHolder -> {
|
||||
data?.let {
|
||||
val operationMsg = it[position].bean as OperationMsg
|
||||
val msgBoxBean = it[position]
|
||||
val operationMsg = msgBoxBean.bean as OperationMsg
|
||||
holder.tvBubbleOperationTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat())
|
||||
holder.tvBubbleOperationContent.text = operationMsg.content
|
||||
holder.clBubbleOperationLayout.setOnClickListener {
|
||||
CallerMsgBoxEventListenerManager.invokeBubbleOperationListener(msgBoxBean)
|
||||
}
|
||||
}
|
||||
}
|
||||
is BubbleReportHolder -> {
|
||||
data?.let {
|
||||
val reportEntity = it[position].bean as ReportEntity
|
||||
val msgBoxBean = it[position]
|
||||
val reportEntity = msgBoxBean.bean as ReportEntity
|
||||
holder.tvBubbleReportTime.text = "时间:${TimeUtils.millis2String(it[position].timestamp)}"
|
||||
holder.tvBubbleReceiveTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat())
|
||||
var resultStr = "类型:"
|
||||
@@ -90,6 +97,9 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A
|
||||
resultStr = "${resultStr}${CallerAutoPilotManager.getReportResultDesc(result)}"
|
||||
}
|
||||
holder.tvBubbleReportType.text = resultStr
|
||||
holder.clReportLayout.setOnClickListener {
|
||||
CallerMsgBoxEventListenerManager.invokeBubbleReportListener(msgBoxBean)
|
||||
}
|
||||
}
|
||||
}
|
||||
is BubbleNoticeHolder -> {
|
||||
@@ -139,6 +149,9 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A
|
||||
holder.tvV2XContent.text = v2XMsg.content
|
||||
holder.ivV2XImage.setImageDrawable(activity.resources.getDrawable(
|
||||
EventTypeEnumNew.getUpdateIconRes(v2XMsg.type)))
|
||||
holder.clV2XLayout.setOnClickListener {
|
||||
CallerMsgBoxEventListenerManager.invokeBubbleV2XListener(msgBoxBean)
|
||||
}
|
||||
}
|
||||
}
|
||||
is BubbleSummaryHolder -> {
|
||||
@@ -190,12 +203,14 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A
|
||||
var tvBubbleReportTime: TextView = itemView.findViewById(R.id.tvBubbleReportTime)
|
||||
var tvBubbleReportType: TextView = itemView.findViewById(R.id.tvBubbleReportType)
|
||||
var tvBubbleReceiveTime: TextView = itemView.findViewById(R.id.tvBubbleReceiveTime)
|
||||
var clReportLayout: RoundCanClickConstraintLayout = itemView.findViewById(R.id.clReportLayout)
|
||||
}
|
||||
|
||||
//运营平台
|
||||
class BubbleOperationHolder(itemView: View): RecyclerView.ViewHolder(itemView){
|
||||
var tvBubbleOperationTime: TextView = itemView.findViewById(R.id.tvBubbleOperationTime)
|
||||
var tvBubbleOperationContent: TextView = itemView.findViewById(R.id.tvBubbleOperationContent)
|
||||
var clBubbleOperationLayout: RoundCanClickConstraintLayout = itemView.findViewById(R.id.clBubbleOperationLayout)
|
||||
}
|
||||
|
||||
//Notice
|
||||
@@ -212,6 +227,7 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A
|
||||
var ivV2XImage: ImageView = itemView.findViewById(R.id.ivV2XImage)
|
||||
var tvV2XTime: TextView = itemView.findViewById(R.id.tvV2XTime)
|
||||
var tvV2XContent: TextView = itemView.findViewById(R.id.tvV2XContent)
|
||||
var clV2XLayout: RoundCanClickConstraintLayout = itemView.findViewById(R.id.clV2XLayout)
|
||||
}
|
||||
|
||||
//汇总消息
|
||||
|
||||
@@ -18,6 +18,7 @@ import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.mogo.glide.transform.GlideRoundedCornersTransform
|
||||
import com.mogo.eagle.core.utilcode.util.TimeUtils
|
||||
import com.mogo.eagle.core.utilcode.util.TimeUtils.getHourMinFormat
|
||||
import com.mogo.eagle.core.widget.RoundCanClickConstraintLayout
|
||||
|
||||
/**
|
||||
* @author XuXinChao
|
||||
@@ -104,6 +105,9 @@ class PassengerMsgBoxBubbleAdapter(private val activity: Activity): RecyclerView
|
||||
holder.tvPassengerV2XContent.text = v2XMsg.content
|
||||
holder.ivPassengerV2XImage.setImageDrawable(activity.resources.getDrawable(
|
||||
EventTypeEnumNew.getUpdateIconRes(v2XMsg.type)))
|
||||
holder.clPassengerVeXLayout.setOnClickListener {
|
||||
CallerMsgBoxEventListenerManager.invokeBubbleV2XListener(msgBoxBean)
|
||||
}
|
||||
}
|
||||
}
|
||||
is BubbleSummaryHolder -> {
|
||||
@@ -114,7 +118,7 @@ class PassengerMsgBoxBubbleAdapter(private val activity: Activity): RecyclerView
|
||||
holder.tvPassengerSummaryCheck.setOnClickListener {
|
||||
//跳转全览模式
|
||||
// CallerHmiManager.showSmallFragment()
|
||||
CallerMsgBoxEventListenerManager.invokeListener()
|
||||
CallerMsgBoxEventListenerManager.invokeSummaryListener()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -163,6 +167,7 @@ class PassengerMsgBoxBubbleAdapter(private val activity: Activity): RecyclerView
|
||||
var ivPassengerV2XImage: ImageView = itemView.findViewById(R.id.ivPassengerV2XImage)
|
||||
var tvPassengerV2XTime: TextView = itemView.findViewById(R.id.tvPassengerV2XTime)
|
||||
var tvPassengerV2XContent: TextView = itemView.findViewById(R.id.tvPassengerV2XContent)
|
||||
var clPassengerVeXLayout: RoundCanClickConstraintLayout = itemView.findViewById(R.id.clPassengerVeXLayout)
|
||||
}
|
||||
|
||||
//汇总消息
|
||||
|
||||
@@ -106,7 +106,7 @@ class PassengerMsgBoxListAdapter(private val activity: Activity): RecyclerView.A
|
||||
holder.tvPassengerSummaryCheck.setOnClickListener {
|
||||
//跳转全览模式
|
||||
// CallerHmiManager.showSmallFragment()
|
||||
CallerMsgBoxEventListenerManager.invokeListener()
|
||||
CallerMsgBoxEventListenerManager.invokeSummaryListener()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -198,57 +198,26 @@
|
||||
app:layout_constraintTop_toBottomOf="@+id/viewLimitingVelocity" />
|
||||
|
||||
<!--消息盒子司机端选择入口-->
|
||||
<CheckBox
|
||||
android:id="@+id/cbMsgBoxDriver"
|
||||
<com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxButtonView
|
||||
android:id="@+id/viewDriverMsgBoxButton"
|
||||
android:layout_width="150dp"
|
||||
android:layout_height="150dp"
|
||||
app:layout_constraintTop_toBottomOf="@+id/ivCameraIcon"
|
||||
app:layout_constraintRight_toLeftOf="@id/viewLimitingVelocity"
|
||||
android:layout_marginEnd="25dp"
|
||||
android:layout_marginTop="15dp"
|
||||
android:button="@null"
|
||||
android:background="@drawable/selector_msg_box"
|
||||
android:visibility="gone"
|
||||
/>
|
||||
<!--司机端消息提示-->
|
||||
<View
|
||||
android:id="@+id/MsgBoxTipView"
|
||||
android:layout_width="8dp"
|
||||
android:layout_height="8dp"
|
||||
android:background="@drawable/version_upgrade_tips_background"
|
||||
android:translationZ="30dp"
|
||||
app:layout_constraintCircle="@id/cbMsgBoxDriver"
|
||||
app:layout_constraintCircleAngle="40"
|
||||
app:layout_constraintCircleRadius="32dp"
|
||||
tools:ignore="MissingConstraints"
|
||||
android:visibility="gone"
|
||||
/>
|
||||
|
||||
<!--消息盒子乘客端选择入口-->
|
||||
<CheckBox
|
||||
android:id="@+id/cbMsgBoxPassenger"
|
||||
<com.mogo.eagle.core.function.hmi.ui.msgbox.PassengerMsgBoxButtonView
|
||||
android:id="@+id/viewPassengerMsgBoxButton"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="100dp"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:layout_marginStart="320dp"
|
||||
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="15dp"
|
||||
android:layout_height="15dp"
|
||||
android:background="@drawable/version_upgrade_tips_background"
|
||||
android:translationZ="30dp"
|
||||
app:layout_constraintCircle="@id/cbMsgBoxPassenger"
|
||||
app:layout_constraintCircleAngle="40"
|
||||
app:layout_constraintCircleRadius="50dp"
|
||||
tools:ignore="MissingConstraints"
|
||||
android:visibility="gone"
|
||||
/>
|
||||
|
||||
@@ -256,7 +225,7 @@
|
||||
android:id="@+id/viewDriverMsgBoxList"
|
||||
android:layout_width="864dp"
|
||||
android:layout_height="746dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/cbMsgBoxDriver"
|
||||
app:layout_constraintTop_toBottomOf="@id/viewDriverMsgBoxButton"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
android:layout_marginEnd="40dp"
|
||||
android:visibility="gone"
|
||||
@@ -266,7 +235,7 @@
|
||||
android:id="@+id/viewDriverMsgBoxBubble"
|
||||
android:layout_width="864dp"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toBottomOf="@id/cbMsgBoxDriver"
|
||||
app:layout_constraintTop_toBottomOf="@id/viewDriverMsgBoxButton"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
android:layout_marginEnd="40dp"
|
||||
android:visibility="gone"
|
||||
@@ -276,9 +245,9 @@
|
||||
android:id="@+id/viewPassengerMsgBoxBubble"
|
||||
android:layout_width="650dp"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintBottom_toTopOf="@id/cbMsgBoxPassenger"
|
||||
app:layout_constraintLeft_toLeftOf="@id/cbMsgBoxPassenger"
|
||||
app:layout_constraintRight_toRightOf="@id/cbMsgBoxPassenger"
|
||||
app:layout_constraintBottom_toTopOf="@id/viewPassengerMsgBoxButton"
|
||||
app:layout_constraintLeft_toLeftOf="@id/viewPassengerMsgBoxButton"
|
||||
app:layout_constraintRight_toRightOf="@id/viewPassengerMsgBoxButton"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:visibility="gone"
|
||||
/>
|
||||
@@ -287,9 +256,9 @@
|
||||
android:id="@+id/viewPassengerMsgBoxList"
|
||||
android:layout_width="650dp"
|
||||
android:layout_height="750dp"
|
||||
app:layout_constraintBottom_toTopOf="@id/cbMsgBoxPassenger"
|
||||
app:layout_constraintLeft_toLeftOf="@id/cbMsgBoxPassenger"
|
||||
app:layout_constraintRight_toRightOf="@id/cbMsgBoxPassenger"
|
||||
app:layout_constraintBottom_toTopOf="@id/viewPassengerMsgBoxButton"
|
||||
app:layout_constraintLeft_toLeftOf="@id/viewPassengerMsgBoxButton"
|
||||
app:layout_constraintRight_toRightOf="@id/viewPassengerMsgBoxButton"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:visibility="gone"
|
||||
/>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<com.mogo.eagle.core.widget.RoundConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<com.mogo.eagle.core.widget.RoundCanClickConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/clBubbleOperationLayout"
|
||||
android:layout_width="804dp"
|
||||
android:layout_height="160dp"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
@@ -7,7 +8,8 @@
|
||||
app:roundLayoutRadius="24dp"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="7dp"
|
||||
android:layout_marginBottom="7dp">
|
||||
android:layout_marginBottom="7dp"
|
||||
>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivBubbleOperationImage"
|
||||
@@ -61,4 +63,4 @@
|
||||
android:lineSpacingMultiplier="1.2"
|
||||
/>
|
||||
|
||||
</com.mogo.eagle.core.widget.RoundConstraintLayout>
|
||||
</com.mogo.eagle.core.widget.RoundCanClickConstraintLayout>
|
||||
@@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<com.mogo.eagle.core.widget.RoundConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<com.mogo.eagle.core.widget.RoundCanClickConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/clReportLayout"
|
||||
android:layout_width="804dp"
|
||||
android:layout_height="160dp"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
@@ -72,4 +73,4 @@
|
||||
android:textSize="24dp"
|
||||
/>
|
||||
|
||||
</com.mogo.eagle.core.widget.RoundConstraintLayout>
|
||||
</com.mogo.eagle.core.widget.RoundCanClickConstraintLayout>
|
||||
@@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<com.mogo.eagle.core.widget.RoundConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<com.mogo.eagle.core.widget.RoundCanClickConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/clV2XLayout"
|
||||
android:layout_width="804dp"
|
||||
android:layout_height="160dp"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
@@ -44,4 +45,4 @@
|
||||
android:ellipsize="end"
|
||||
/>
|
||||
|
||||
</com.mogo.eagle.core.widget.RoundConstraintLayout>
|
||||
</com.mogo.eagle.core.widget.RoundCanClickConstraintLayout>
|
||||
@@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<com.mogo.eagle.core.widget.RoundConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<com.mogo.eagle.core.widget.RoundCanClickConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/clPassengerVeXLayout"
|
||||
android:layout_width="650dp"
|
||||
android:layout_height="160dp"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
@@ -47,4 +48,4 @@
|
||||
android:layout_marginEnd="25dp"
|
||||
/>
|
||||
|
||||
</com.mogo.eagle.core.widget.RoundConstraintLayout>
|
||||
</com.mogo.eagle.core.widget.RoundCanClickConstraintLayout>
|
||||
@@ -0,0 +1,34 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="150dp"
|
||||
android:layout_height="150dp"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<!--消息盒子司机端选择入口-->
|
||||
<CheckBox
|
||||
android:id="@+id/cbMsgBoxDriver"
|
||||
android:layout_width="150dp"
|
||||
android:layout_height="150dp"
|
||||
android:background="@drawable/selector_msg_box"
|
||||
android:button="@null"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
/>
|
||||
|
||||
<!--司机端消息提示-->
|
||||
<View
|
||||
android:id="@+id/msgBoxTipView"
|
||||
android:layout_width="8dp"
|
||||
android:layout_height="8dp"
|
||||
android:background="@drawable/version_upgrade_tips_background"
|
||||
android:translationZ="30dp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintCircle="@id/cbMsgBoxDriver"
|
||||
app:layout_constraintCircleAngle="40"
|
||||
app:layout_constraintCircleRadius="32dp"
|
||||
tools:ignore="MissingConstraints" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -0,0 +1,31 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="100dp"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<!--消息盒子乘客端选择入口-->
|
||||
<CheckBox
|
||||
android:id="@+id/cbMsgBoxPassenger"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="100dp"
|
||||
android:background="@drawable/selector_msg_box_p"
|
||||
android:button="@null"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent" />
|
||||
|
||||
<!--乘客端消息提示-->
|
||||
<View
|
||||
android:id="@+id/msgBoxPTipView"
|
||||
android:layout_width="15dp"
|
||||
android:layout_height="15dp"
|
||||
android:background="@drawable/version_upgrade_tips_background"
|
||||
android:translationZ="30dp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintCircle="@id/cbMsgBoxPassenger"
|
||||
app:layout_constraintCircleAngle="40"
|
||||
app:layout_constraintCircleRadius="50dp"
|
||||
tools:ignore="MissingConstraints" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
Reference in New Issue
Block a user