diff --git a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MogoObuDcCombineManager.kt b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MogoObuDcCombineManager.kt index 62b6e5d953..f22ffd93a5 100644 --- a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MogoObuDcCombineManager.kt +++ b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MogoObuDcCombineManager.kt @@ -127,13 +127,13 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener ttsContent = EventTypeEnumNew.getWarningTts(appId) alertContent = String.format( //事件才有影响范围 alertContent, - Math.round(rsiWarningData.warningMsgList[0].distance / 100.0).toString(), - Math.round(rsiWarningData.warningMsgList[0].eventRadius / 10.0).toString() + Math.round(rsiWarningData.warningMsgList[0].distance).toString(), + Math.round(rsiWarningData.warningMsgList[0].eventRadius).toString() ) ttsContent = String.format( ttsContent, - Math.round(rsiWarningData.warningMsgList[0].distance / 100.0).toString(), - Math.round(rsiWarningData.warningMsgList[0].eventRadius / 10.0).toString() + Math.round(rsiWarningData.warningMsgList[0].distance).toString(), + Math.round(rsiWarningData.warningMsgList[0].eventRadius).toString() ) } @@ -210,11 +210,11 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener ttsContent = EventTypeEnumNew.getWarningTts(appId) alertContent = String.format( //标牌是没有影响范围的 alertContent, - Math.round(rsiWarningData.warningMsgList[0].distance / 100.0).toString() + Math.round(rsiWarningData.warningMsgList[0].distance).toString() ) ttsContent = String.format( ttsContent, - Math.round(rsiWarningData.warningMsgList[0].distance / 100.0).toString() + Math.round(rsiWarningData.warningMsgList[0].distance).toString() ) } @@ -225,13 +225,13 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener ttsContent = EventTypeEnumNew.getWarningTts(appId) alertContent = String.format( //事件才有影响范围 alertContent, - Math.round(rsiWarningData.warningMsgList[0].distance / 100.0).toString(), - Math.round(rsiWarningData.warningMsgList[0].eventRadius / 10.0).toString() + Math.round(rsiWarningData.warningMsgList[0].distance).toString(), + Math.round(rsiWarningData.warningMsgList[0].eventRadius).toString() ) ttsContent = String.format( ttsContent, - Math.round(rsiWarningData.warningMsgList[0].distance / 100.0).toString(), - Math.round(rsiWarningData.warningMsgList[0].eventRadius / 10.0).toString() + Math.round(rsiWarningData.warningMsgList[0].distance).toString(), + Math.round(rsiWarningData.warningMsgList[0].eventRadius).toString() ) } @@ -252,8 +252,11 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener if (alertContent.isEmpty() || ttsContent.isEmpty()) { return } - saveObuToDcData(appId, alertContent, ttsContent) - showWarning(appId, alertContent, ttsContent, direction) + //大于10m,才提示rsi + if (Math.round(rsiWarningData.warningMsgList[0].distance) > 10) { + saveObuToDcData(appId, alertContent, ttsContent) + showWarning(appId, alertContent, ttsContent, direction) + } } MogoObuConstants.STATUS.UPDATE -> { // 更新 @@ -392,14 +395,14 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener "${M_OBU}${TAG}", "MogoObuDcCombineManager onMogoObuMapMath = ${data.status} --speedMaxLimit = ${ Math.round( - (data.speedMaxLimit * 0.02 * 3.6) + (data.speedMaxLimit * 3.6) ) } --- data.speedMaxLimit = ${data.speedMaxLimit}" ) when (data.status) { MogoObuConstants.STATUS.ADD -> { // 添加 CallerLimitingVelocityListenerManager.invokeUnion( - (data.speedMaxLimit * 0.02 * 3.6).roundToInt().toInt(), + (data.speedMaxLimit * 3.6).roundToInt(), DataSourceType.OBU ) } @@ -526,15 +529,15 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener "MogoObuDcCombineManager 绿波通行引导 --------> speed_min = ${currentLight.suggestMinSpeed} --speed_max = ${currentLight.suggestMaxSpeed}" ) val adviceSpeed = - "${Math.round(currentLight.suggestMinSpeed * 3.6 * 0.02)} - ${ + "${Math.round(currentLight.suggestMinSpeed * 3.6)} - ${ Math.round( - currentLight.suggestMaxSpeed * 3.6 * 0.02 + currentLight.suggestMaxSpeed * 3.6 ) }" val adviceSpeedTts = - "${Math.round(currentLight.suggestMinSpeed * 3.6 * 0.02)} - ${ + "${Math.round(currentLight.suggestMinSpeed * 3.6)} - ${ Math.round( - currentLight.suggestMaxSpeed * 3.6 * 0.02 + currentLight.suggestMaxSpeed * 3.6 ) }" @@ -571,7 +574,7 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener } // 红灯 2, 3 -> { - val red = (currentLight.countDown / 10).toInt() + val red = currentLight.countDown.toInt() CallerTrafficLightListenerManager.invokeTrafficLightPlusSource( TrafficLightEnum.RED, red, @@ -580,7 +583,7 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener } // 绿灯 4, 5, 6 -> { - val green = (currentLight.countDown / 10).toInt() + val green = currentLight.countDown.toInt() CallerTrafficLightListenerManager.invokeTrafficLightPlusSource( TrafficLightEnum.GREEN, green, @@ -589,7 +592,7 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener } // 黄灯 7, 8 -> { - val yellow = (currentLight.countDown / 10).toInt() + val yellow = currentLight.countDown.toInt() CallerTrafficLightListenerManager.invokeTrafficLightPlusSource( TrafficLightEnum.YELLOW, yellow, diff --git a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MogoPrivateObuNewManager.kt b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MogoPrivateObuNewManager.kt index 3f7f908681..5f182177b6 100644 --- a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MogoPrivateObuNewManager.kt +++ b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MogoPrivateObuNewManager.kt @@ -407,6 +407,7 @@ class MogoPrivateObuNewManager private constructor() : OnUpgradeListener { alertContent = EventTypeEnumNew.getWarningContent(appId) ttsContent = EventTypeEnumNew.getWarningTts(appId) + alertContent = String.format( //标牌是没有影响范围的 alertContent, Math.round(data.warningMsgList[0].distance).toString() @@ -455,8 +456,11 @@ class MogoPrivateObuNewManager private constructor() : OnUpgradeListener { if (alertContent.isEmpty() || ttsContent.isEmpty()) { return } - saveObuData(appId, alertContent, ttsContent) - showWarning(appId, alertContent, ttsContent, direction) + //大于10m,才提示rsi + if (Math.round(data.warningMsgList[0].distance) > 10) { + saveObuData(appId, alertContent, ttsContent) + showWarning(appId, alertContent, ttsContent, direction) + } // 更新数据 TrafficDataConvertUtilsNew.cvxRtiThreatIndInfo2TrafficData(data) diff --git a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/binding/BindingCarNetWorkManager.kt b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/binding/BindingCarNetWorkManager.kt index 008fe69093..a6b0fccc0f 100644 --- a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/binding/BindingCarNetWorkManager.kt +++ b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/binding/BindingCarNetWorkManager.kt @@ -87,8 +87,8 @@ class BindingCarNetWorkManager private constructor() { GsonUtils.toJson(info.getData()) ) } else { - SharedPrefsMgr.getInstance(context).putString( - SharedPrefsConstants.CAR_INFO, "null") +// SharedPrefsMgr.getInstance(context).putString( +// SharedPrefsConstants.CAR_INFO, "null") e( SceneConstant.M_BINDING + TAG, "getBindingCarInfo data = null " ) @@ -96,8 +96,8 @@ class BindingCarNetWorkManager private constructor() { } override fun onError(e: Throwable) { - SharedPrefsMgr.getInstance(context).putString( - SharedPrefsConstants.CAR_INFO, e.message.toString()) +// SharedPrefsMgr.getInstance(context).putString( +// SharedPrefsConstants.CAR_INFO, e.message.toString()) e( SceneConstant.M_BINDING + TAG, "getBindingCarInfo onError e = " + e.toString() + "---e.getMessage = " + e.message diff --git a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/mofang/MoFangManager.kt b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/mofang/MoFangManager.kt index 27ffcea085..28ab73c903 100644 --- a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/mofang/MoFangManager.kt +++ b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/mofang/MoFangManager.kt @@ -9,6 +9,7 @@ import android.content.Intent import android.content.IntentFilter import android.view.KeyEvent import com.mogo.commons.context.ContextHolderUtil +import com.mogo.eagle.core.data.config.HmiBuildConfig import com.mogo.eagle.core.data.deva.mofang.MfConstants import com.mogo.eagle.core.function.api.devatools.mofang.IMoGoMoFangListener import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager.sendOperatorChangeLaneLeft @@ -46,7 +47,6 @@ class MoFangManager private constructor() : IMoGoMoFangListener { private lateinit var mBluetoothAdapter: BluetoothAdapter private var isMfConnect: Boolean = false //添加状态判断 - private val isShowToast = false //toast 控制,自测使用 private var startPressTime: Long = 0 //开始按键时间 private var isPressEnd = false //按键是否结束 @Volatile @@ -171,23 +171,23 @@ class MoFangManager private constructor() : IMoGoMoFangListener { startPressTime = System.currentTimeMillis() } e(M_F + "MoFangManager", - "dispatchKeyEvent ------ bluetoothName = $bluetoothName ---code = $keyCode -----action = $action ") + "dispatchKeyEvent ------ bluetoothName = $bluetoothName ---code = $keyCode -----action = $action ---HmiBuildConfig.isShowMfToastView = ${HmiBuildConfig.isShowMfToastView}") if (keyCode == KeyEvent.KEYCODE_A) { //单击 -1,长按无操作,AB组合-2 if (action == KeyEvent.ACTION_DOWN) { pressADownTime = System.currentTimeMillis() d(M_F + "MoFangManager", "dispatchKeyEvent A down pressADownTime = " + pressADownTime + "---" + (pressADownTime - startPressTime) + "----isCombinationKey = " + isCombinationKey + "--pressBDownTime = " + pressBDownTime) if (pressADownTime - startPressTime in (clickTimeInterval + 1) until longPressTime && pressBDownTime > 0) { - if (isShowToast) { - ToastUtils.showShort("方块 A 按AB组合 +1 ") + if (HmiBuildConfig.isShowMfToastView) { + ToastUtils.showShort("方块 A 按AB组合 +1 timeInterval: ${pressADownTime - startPressTime}ms---$pressBDownTime") } sendAcc(true, +1.0) isCombinationKey = 3 } if (isCombinationKey != 3 && isCombinationKey != 1) { if (pressADownTime - startPressTime > longPressTimeInterval) { - if (isShowToast) { - ToastUtils.showShort("方块 长按A -2 ") + if (HmiBuildConfig.isShowMfToastView) { + ToastUtils.showShort("方块 长按A -2 timeInterval: ${pressADownTime - startPressTime}ms") } sendAcc(true, -2.0) isCombinationKey = 2 @@ -199,8 +199,8 @@ class MoFangManager private constructor() : IMoGoMoFangListener { "dispatchKeyEvent A up pressAUpTime = " + pressAUpTime + "---" + (pressAUpTime - startPressTime) + "--pressBDownTime = " + pressBDownTime + "---isCombinationKey = $isCombinationKey") if (pressAUpTime - startPressTime < clickTime && isCombinationKey != 3) { isCombinationKey = 1 - if (isShowToast) { - ToastUtils.showShort("方块 单击A -1 ") + if (HmiBuildConfig.isShowMfToastView) { + ToastUtils.showShort("方块 单击A -1 timeInterval: ${pressAUpTime - startPressTime}ms") } sendAcc(true, -1.0) } @@ -215,16 +215,16 @@ class MoFangManager private constructor() : IMoGoMoFangListener { "dispatchKeyEvent B down pressBDownTime = " + pressBDownTime + "--差-" + (pressBDownTime - startPressTime) + "---isCombinationKey = " + isCombinationKey + "--pressADownTime = " + pressADownTime ) if (pressBDownTime - startPressTime > clickTimeInterval && pressBDownTime - startPressTime < longPressTime && pressADownTime > 0) { - if (isShowToast) { - ToastUtils.showShort("方块 B 按AB组合 +1 ") + if (HmiBuildConfig.isShowMfToastView) { + ToastUtils.showShort("方块 B 按AB组合 +1 timeInterval: ${pressBDownTime - startPressTime}ms ---pressADownTime = $pressADownTime ") } sendAcc(true, +1.0) isCombinationKey = 3 } if (isCombinationKey != 3 && isCombinationKey != 1) { if (pressBDownTime - startPressTime > longPressTimeInterval) { - if (isShowToast) { - ToastUtils.showShort("方块 长按B 无操作 ") + if (HmiBuildConfig.isShowMfToastView) { + ToastUtils.showShort("方块 长按B 无操作 timeInterval: ${pressBDownTime - startPressTime}ms") } isCombinationKey = 2 } @@ -234,8 +234,8 @@ class MoFangManager private constructor() : IMoGoMoFangListener { d(M_F + "MoFangManager", "dispatchKeyEvent B up pressBUpTime = " + pressBUpTime + "--差-" + (pressBUpTime - startPressTime) + "--pressADownTime = " + pressADownTime + "----isCombinationKey = $isCombinationKey") if (pressBUpTime - startPressTime < clickTime && isCombinationKey != 3) { - if (isShowToast) { - ToastUtils.showShort("方块 单击B 0 ") + if (HmiBuildConfig.isShowMfToastView) { + ToastUtils.showShort("方块 单击B 0 timeInterval: ${pressBUpTime - startPressTime}ms") } sendAcc(false, 0.0) isCombinationKey = 1 @@ -250,8 +250,8 @@ class MoFangManager private constructor() : IMoGoMoFangListener { d(M_F + "MoFangManager", "dispatchKeyEvent 方块 长按C 无操作 time dif = " + (pressCDownTime - startPressTime)) if (pressCDownTime - startPressTime > longPressTimeInterval) { - if (isShowToast) { - ToastUtils.showShort("方块 长按C 无操作 ") + if (HmiBuildConfig.isShowMfToastView) { + ToastUtils.showShort("方块 长按C 无操作 timeInterval: ${pressCDownTime - startPressTime}ms") } } } else if (action == KeyEvent.ACTION_UP) { @@ -260,8 +260,8 @@ class MoFangManager private constructor() : IMoGoMoFangListener { d(M_F + "MoFangManager", "dispatchKeyEvent 方块 单击C ← 向左变道 time dif = " + (pressCUpTime - startPressTime)) if (pressCUpTime - startPressTime < clickTime) { - if (isShowToast) { - ToastUtils.showShort("方块 单击C ← 向左变道 ") + if (HmiBuildConfig.isShowMfToastView) { + ToastUtils.showShort("方块 单击C ← 向左变道 timeInterval: ${pressCUpTime - startPressTime}ms") } sendOperatorChangeLaneLeft() } @@ -272,8 +272,8 @@ class MoFangManager private constructor() : IMoGoMoFangListener { d(M_F + "MoFangManager", "dispatchKeyEvent 方块 长按D 无操作 time dif = " + (pressDDownTime - startPressTime)) if (pressDDownTime - startPressTime > longPressTimeInterval) { - if (isShowToast) { - ToastUtils.showShort("方块 长按D 无操作 ") + if (HmiBuildConfig.isShowMfToastView) { + ToastUtils.showShort("方块 长按D 无操作 timeInterval: ${pressDDownTime - startPressTime}ms") } } } else if (action == KeyEvent.ACTION_UP) { @@ -282,8 +282,8 @@ class MoFangManager private constructor() : IMoGoMoFangListener { d(M_F + "MoFangManager", "dispatchKeyEvent 方块 单击D → 向右变道 time dif = " + (pressDUpTime - startPressTime)) if (pressDUpTime - startPressTime < clickTime) { - if (isShowToast) { - ToastUtils.showShort("方块 单击D → 向右变道 ") + if (HmiBuildConfig.isShowMfToastView) { + ToastUtils.showShort("方块 单击D → 向右变道 timeInterval: ${pressDUpTime - startPressTime}ms") } sendOperatorChangeLaneRight() } @@ -294,8 +294,8 @@ class MoFangManager private constructor() : IMoGoMoFangListener { d(M_F + "MoFangManager", "dispatchKeyEvent 方块 长按E 鸣笛 time dif = " + (pressEDownTime - startPressTime)) if (pressEDownTime - startPressTime > longPressTimeInterval) { - if (isShowToast) { - ToastUtils.showShort("方块 长按E 鸣笛 ") + if (HmiBuildConfig.isShowMfToastView) { + ToastUtils.showShort("方块 长按E 鸣笛 timeInterval: ${pressEDownTime - startPressTime}ms") } sendOperatorSetHorn(1.0) if (timerHorn == null) { @@ -314,8 +314,8 @@ class MoFangManager private constructor() : IMoGoMoFangListener { d(M_F + "MoFangManager", "方块 单击E 开启自动驾驶 time dif = " + (pressEUpTime - startPressTime)) if (pressEUpTime - startPressTime < clickTime) { - if (isShowToast) { - ToastUtils.showShort("方块 单击E 开启自动驾驶 ") + if (HmiBuildConfig.isShowMfToastView) { + ToastUtils.showShort("方块 单击E 开启自动驾驶 timeInterval: ${pressEUpTime - startPressTime}ms") } startAutoPilot(getAutoPilotStatusInfo().autopilotControlParameters) } diff --git a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/report/IPCReportManager.kt b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/report/IPCReportManager.kt index d338f02da8..aa995725a5 100644 --- a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/report/IPCReportManager.kt +++ b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/report/IPCReportManager.kt @@ -79,7 +79,7 @@ class IPCReportManager : IMoGoAutopilotStatusListener { || it.resultList.contains(RESULT_SHOW_WARNING) || it.resultList.contains(RESULT_REMOTEPILOT_INFERIOR)){ val reportEntity = ReportEntity(TimeUtils.millis2String(System.currentTimeMillis()), - it.src,it.level,it.msg,it.code,it.resultList,it.actionsList) + it.src,it.level,it.msg,it.code,it.resultList,it.actionsList,false) CallerMsgBoxManager.saveMsgBox(MsgBoxBean(MsgBoxType.REPORT, reportEntity)) } @@ -91,7 +91,7 @@ class IPCReportManager : IMoGoAutopilotStatusListener { ReportEntity( TimeUtils.millis2String(System.currentTimeMillis()), it.src, it.level, it.msg, it.code, it.resultList, it.actionsList - ) + ,false) ) reportListFloatWindow?.refreshData(reportList) diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/DriverMsgBoxBubbleView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/DriverMsgBoxBubbleView.kt index dc08cb75f7..0bf5097f02 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/DriverMsgBoxBubbleView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/DriverMsgBoxBubbleView.kt @@ -9,6 +9,7 @@ import androidx.constraintlayout.widget.ConstraintLayout 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.MsgBoxCountDownBean import com.mogo.eagle.core.data.msgbox.MsgCategory import com.mogo.eagle.core.function.api.datacenter.msgbox.IMsgBoxListener import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager @@ -39,7 +40,7 @@ class DriverMsgBoxBubbleView @JvmOverloads constructor( var driverMsgBoxBubbleAdapter: DriverMsgBoxBubbleAdapter ?=null private val TAG = "DriverMsgBoxBubbleView" - private val dataList :ArrayList = ArrayList() + private val dataList :ArrayList = ArrayList() private var isShowData = true private fun initView() { @@ -92,7 +93,8 @@ class DriverMsgBoxBubbleView @JvmOverloads constructor( //todo 过滤MAP系统异常报警 } else{ clMsgBubbleLayout.visibility = View.VISIBLE - dataList.add(msgBoxBean) + val msgBoxCountDownBean = MsgBoxCountDownBean(msgBoxBean) + dataList.add(msgBoxCountDownBean) driverMsgBoxBubbleAdapter?.setData(dataList) } } diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/MBoxBubbleView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/MBoxBubbleView.kt index 30ff6c7f23..17151d727e 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/MBoxBubbleView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/MBoxBubbleView.kt @@ -7,6 +7,7 @@ import android.view.LayoutInflater import androidx.constraintlayout.widget.ConstraintLayout import androidx.recyclerview.widget.LinearLayoutManager import com.mogo.eagle.core.data.msgbox.MsgBoxBean +import com.mogo.eagle.core.data.msgbox.MsgBoxCountDownBean import com.mogo.eagle.core.data.msgbox.MsgBoxType import com.mogo.eagle.core.data.msgbox.MsgCategory import com.mogo.eagle.core.function.api.datacenter.msgbox.IMsgBoxListener @@ -25,7 +26,7 @@ class MBoxBubbleView @JvmOverloads constructor( ) : ConstraintLayout(context, attrs, defStyleAttr), IMsgBoxListener { private val TAG = "PassengerMsgBoxBubbleView" - private val dataList :ArrayList = ArrayList() + private val dataList :ArrayList = ArrayList() private var mBoxBubbleAdapter: MBoxBubbleAdapter?= null private var isShowData = true @@ -58,7 +59,8 @@ class MBoxBubbleView @JvmOverloads constructor( MsgBoxConfig.noticeList.add(msgBoxList) if(isShowData){ CallerMsgBoxEventListenerManager.invokeUpdateTipListener(true) - dataList.add(msgBoxList) + val msgBoxCountDownBean = MsgBoxCountDownBean(msgBoxList) + dataList.add(msgBoxCountDownBean) mBoxBubbleAdapter?.setData(dataList) } } diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/MMsgBoxBubbleView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/MMsgBoxBubbleView.kt index 78f9002e4a..e382698b28 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/MMsgBoxBubbleView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/MMsgBoxBubbleView.kt @@ -6,10 +6,7 @@ import android.util.AttributeSet import android.view.LayoutInflater import androidx.constraintlayout.widget.ConstraintLayout 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.data.msgbox.* 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 @@ -26,7 +23,7 @@ class MMsgBoxBubbleView @JvmOverloads constructor( ) : ConstraintLayout(context, attrs, defStyleAttr), IMsgBoxListener { private val TAG = "MMsgBoxBubbleView" - private val dataList :ArrayList = ArrayList() + private val dataList :ArrayList = ArrayList() private var mMsgBoxBubbleAdapter: MMsgBoxBubbleAdapter?= null private var isShowData = true @@ -56,27 +53,27 @@ class MMsgBoxBubbleView @JvmOverloads constructor( if(category == MsgCategory.NOTICE){ if(msgBoxList.type == MsgBoxType.NOTICE || msgBoxList.type == MsgBoxType.V2X || msgBoxList.type == MsgBoxType.OBU){ - MsgBoxConfig.noticeList.add(msgBoxList) - if(isShowData){ - CallerMsgBoxEventListenerManager.invokeUpdateTipListener(true) - dataList.add(msgBoxList) - mMsgBoxBubbleAdapter?.setData(dataList) - } + update(msgBoxList) } 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) - } + update(msgBoxList) } } } } } + private fun update(msgBoxList: MsgBoxBean){ + MsgBoxConfig.noticeList.add(msgBoxList) + if(isShowData){ + CallerMsgBoxEventListenerManager.invokeUpdateTipListener(true) + val msgBoxCountDownBean = MsgBoxCountDownBean(msgBoxList) + dataList.add(msgBoxCountDownBean) + mMsgBoxBubbleAdapter?.setData(dataList) + } + } + override fun onAttachedToWindow() { super.onAttachedToWindow() CallerMsgBoxListenerManager.addListener(TAG,this) diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/PassengerMsgBoxBubbleView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/PassengerMsgBoxBubbleView.kt index 0112f09266..0ed1eb0622 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/PassengerMsgBoxBubbleView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/PassengerMsgBoxBubbleView.kt @@ -7,6 +7,7 @@ import android.view.* import androidx.constraintlayout.widget.ConstraintLayout import androidx.recyclerview.widget.LinearLayoutManager import com.mogo.eagle.core.data.msgbox.MsgBoxBean +import com.mogo.eagle.core.data.msgbox.MsgBoxCountDownBean import com.mogo.eagle.core.data.msgbox.MsgBoxType import com.mogo.eagle.core.data.msgbox.MsgCategory import com.mogo.eagle.core.function.api.datacenter.msgbox.IMsgBoxListener @@ -30,7 +31,7 @@ class PassengerMsgBoxBubbleView @JvmOverloads constructor( ) : ConstraintLayout(context, attrs, defStyleAttr), IMsgBoxListener { private val TAG = "PassengerMsgBoxBubbleView" - private val dataList :ArrayList = ArrayList() + private val dataList :ArrayList = ArrayList() private var passengerMsgBoxBubbleAdapter: PassengerMsgBoxBubbleAdapter ?= null private var isShowData = true @@ -63,7 +64,8 @@ class PassengerMsgBoxBubbleView @JvmOverloads constructor( MsgBoxConfig.noticeList.add(msgBoxList) if(isShowData){ CallerMsgBoxEventListenerManager.invokeUpdateTipListener(true) - dataList.add(msgBoxList) + val msgBoxCountDownBean = MsgBoxCountDownBean(msgBoxList) + dataList.add(msgBoxCountDownBean) passengerMsgBoxBubbleAdapter?.setData(dataList) } } diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/DriverMsgBoxBubbleAdapter.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/DriverMsgBoxBubbleAdapter.kt index 754c9a91a3..466e5bf5a6 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/DriverMsgBoxBubbleAdapter.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/DriverMsgBoxBubbleAdapter.kt @@ -30,7 +30,7 @@ import com.mogo.eagle.core.widget.RoundCanClickConstraintLayout */ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.Adapter(){ - private var data: ArrayList ?= null + private var data: ArrayList ?= null private val operation: Int = 1 private val operationReturn: Int = 10 @@ -40,10 +40,9 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A private val report: Int = 4 private val summary: Int = 5 - var countDownTimer: CountDownTimer?=null private var changeViewListener: ChangeViewListener?=null - fun setData(data: ArrayList){ + fun setData(data: ArrayList){ this.data = data if(data.size>4){ data.removeAt(0) @@ -90,9 +89,9 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A when (holder) { is BubbleOperationHolder -> { data?.let { - val msgBoxBean = it[position] + val msgBoxBean = it[position].msgBoxBean val operationMsg = msgBoxBean.bean as OperationMsg - holder.tvBubbleOperationTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat()) + holder.tvBubbleOperationTime.text = TimeUtils.millis2String(it[position].msgBoxBean.timestamp,getHourMinFormat()) holder.tvBubbleOperationContent.text = operationMsg.content holder.clBubbleOperationLayout.setOnClickListener { CallerMsgBoxEventListenerManager.invokeBubbleOperationListener(msgBoxBean) @@ -102,7 +101,7 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A //运营平台还车通知 is BubbleOperationReturnHolder -> { data?.let { - val operationReturnMsg = it[position].bean as OperationMsg + val operationReturnMsg = it[position].msgBoxBean.bean as OperationMsg holder.tvOperationReturnContent.text = operationReturnMsg.content holder.tvOperationReturnTime.text = TimeUtils.millis2String(operationReturnMsg.timestamp, getHourMinFormat()) @@ -111,17 +110,17 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A //运营平台靠边停车 is BubbleOperationStopHolder -> { data?.let { - val operationStopMsg = it[position].bean as OperationMsg + val operationStopMsg = it[position].msgBoxBean.bean as OperationMsg holder.tvOperationStopTime.text = TimeUtils.millis2String(operationStopMsg.timestamp, getHourMinFormat()) } } is BubbleReportHolder -> { data?.let { - val msgBoxBean = it[position] + val msgBoxBean = it[position].msgBoxBean val reportEntity = msgBoxBean.bean as ReportEntity - holder.tvBubbleReportTime.text = "时间:${TimeUtils.millis2String(it[position].timestamp)}" - holder.tvBubbleReceiveTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat()) + holder.tvBubbleReportTime.text = "时间:${TimeUtils.millis2String(it[position].msgBoxBean.timestamp)}" + holder.tvBubbleReceiveTime.text = TimeUtils.millis2String(it[position].msgBoxBean.timestamp,getHourMinFormat()) var resultStr = "类型:" for (result in reportEntity.resultList){ resultStr = "${resultStr}${CallerAutoPilotControlManager.getReportResultDesc(result)}" @@ -134,11 +133,11 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A } is BubbleNoticeHolder -> { data?.let { - val msgBoxBean = it[position].bean + val msgBoxBean = it[position].msgBoxBean.bean val noticeFrCloudMsg = msgBoxBean as NoticeFrCloudMsg if(noticeFrCloudMsg.type == 0){ val noticeNormalData = noticeFrCloudMsg.noticeNormalData - holder.tvNoticeTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat()) + holder.tvNoticeTime.text = TimeUtils.millis2String(it[position].msgBoxBean.timestamp,getHourMinFormat()) holder.tvNoticeContent.text = noticeNormalData?.content GlideApp.with(activity).load(noticeNormalData?.imageUrl).optionalTransform( GlideRoundedCornersTransform( @@ -154,7 +153,7 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A } }else if(noticeFrCloudMsg.type == 1){ val noticeTrafficStylePushData = noticeFrCloudMsg.trafficPushData - holder.tvNoticeTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat()) + holder.tvNoticeTime.text = TimeUtils.millis2String(it[position].msgBoxBean.timestamp,getHourMinFormat()) holder.tvNoticeContent.text = noticeTrafficStylePushData?.content GlideApp.with(activity).load(noticeTrafficStylePushData?.poiImgUrl).optionalTransform( GlideRoundedCornersTransform( @@ -173,9 +172,9 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A } is BubbleV2XHolder -> { data?.let { - val msgBoxBean = it[position] + val msgBoxBean = it[position].msgBoxBean val v2XMsg = msgBoxBean.bean as V2XMsg - holder.tvV2XTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat()) + holder.tvV2XTime.text = TimeUtils.millis2String(it[position].msgBoxBean.timestamp,getHourMinFormat()) holder.tvV2XContent.text = v2XMsg.content holder.ivV2XImage.setImageDrawable(activity.resources.getDrawable( EventTypeEnumNew.getUpdateIconRes(v2XMsg.type))) @@ -186,15 +185,15 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A } is BubbleSummaryHolder -> { data?.let { - val summaryMsg = it[position].bean as V2XMsg - holder.tvSummaryTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat()) + val summaryMsg = it[position].msgBoxBean.bean as V2XMsg + holder.tvSummaryTime.text = TimeUtils.millis2String(it[position].msgBoxBean.timestamp,getHourMinFormat()) holder.tvSummaryContent.text = summaryMsg.content } } } - val msgBoxBean: MsgBoxBean = data!![position] - countDownTimer =object: CountDownTimer(CallerMsgBoxManager.getDismissTime(),1000){ + val msgBoxBean: MsgBoxCountDownBean = data!![position] + msgBoxBean.countDownTimer =object: CountDownTimer(CallerMsgBoxManager.getDismissTime(),1000){ override fun onTick(p0: Long) { } @@ -203,34 +202,32 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A data?.remove(msgBoxBean) changeViewListener?.notifyView() notifyDataSetChanged() -// notifyItemRemoved(index) -// notifyItemRangeChanged(index,recordTypeEntity.size-index) } } - countDownTimer?.start() + msgBoxBean.countDownTimer?.start() } override fun getItemCount() = data?.size ?: 0 override fun getItemViewType(position: Int): Int { - return if(data!![position].type == MsgBoxType.OPERATION){ - if((data!![position].bean as OperationMsg).type == 0){ + return if(data!![position].msgBoxBean.type == MsgBoxType.OPERATION){ + if((data!![position].msgBoxBean.bean as OperationMsg).type == 0){ //运营平台还车通知 operationReturn - }else if((data!![position].bean as OperationMsg).type == 1){ + }else if((data!![position].msgBoxBean.bean as OperationMsg).type == 1){ //运营平台靠边停车 operationStop }else{ //普通运营平台 operation } - }else if(data!![position].type == MsgBoxType.REPORT){ + }else if(data!![position].msgBoxBean.type == MsgBoxType.REPORT){ report - }else if(data!![position].type == MsgBoxType.NOTICE){ + }else if(data!![position].msgBoxBean.type == MsgBoxType.NOTICE){ notice - }else if(data!![position].type == MsgBoxType.V2X && data!![position].sourceType == DataSourceType.SUMMARY){ + }else if(data!![position].msgBoxBean.type == MsgBoxType.V2X && data!![position].msgBoxBean.sourceType == DataSourceType.SUMMARY){ summary } else{ v2x diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/DriverMsgBoxListAdapter.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/DriverMsgBoxListAdapter.kt index 2bf6e3930d..6c27709cbf 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/DriverMsgBoxListAdapter.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/DriverMsgBoxListAdapter.kt @@ -163,8 +163,51 @@ class DriverMsgBoxListAdapter(private val activity: Activity) : "${actionStr}${CallerAutoPilotControlManager.getReportActionDesc(action)}" } holder.tvReportActionOpen.text = "建议操作:$actionStr" + holder.tvStatusSelect.tag = reportEntity + if(reportEntity.isShow){ + holder.tvStatusSelect.setCompoundDrawablesWithIntrinsicBounds( + getDrawable(R.drawable.icon_msg_close), + null, + null, + null + ) + holder.tvStatusSelect.text = "折叠" + holder.ivReportImageNormal.visibility = View.GONE + holder.tvReportLevelNormal.visibility = View.GONE + holder.tvReportTimeNormal.visibility = View.GONE + holder.tvReportTypeNormal.visibility = View.GONE + + holder.ivReportImageOpen.visibility = View.VISIBLE + holder.tvReportLevelOpen.visibility = View.VISIBLE + holder.tvReportTimeOpen.visibility = View.VISIBLE + holder.tvReportTypeOpen.visibility = View.VISIBLE + holder.tvReportReasonOpen.visibility = View.VISIBLE + holder.tvReportSrcOpen.visibility = View.VISIBLE + holder.tvReportActionOpen.visibility = View.VISIBLE + }else{ + holder.tvStatusSelect.setCompoundDrawablesWithIntrinsicBounds( + getDrawable(R.drawable.icon_msg_open), + null, + null, + null + ) + holder.tvStatusSelect.text = "展开" + holder.ivReportImageNormal.visibility = View.VISIBLE + holder.tvReportLevelNormal.visibility = View.VISIBLE + holder.tvReportTimeNormal.visibility = View.VISIBLE + holder.tvReportTypeNormal.visibility = View.VISIBLE + + holder.ivReportImageOpen.visibility = View.GONE + holder.tvReportLevelOpen.visibility = View.GONE + holder.tvReportTimeOpen.visibility = View.GONE + holder.tvReportTypeOpen.visibility = View.GONE + holder.tvReportReasonOpen.visibility = View.GONE + holder.tvReportSrcOpen.visibility = View.GONE + holder.tvReportActionOpen.visibility = View.GONE + } holder.tvStatusSelect.setOnClickListener { - if (holder.tvReportLevelNormal.isVisible) { + if (!reportEntity.isShow) { + reportEntity.isShow = true holder.tvStatusSelect.setCompoundDrawablesWithIntrinsicBounds( getDrawable(R.drawable.icon_msg_close), null, @@ -185,6 +228,7 @@ class DriverMsgBoxListAdapter(private val activity: Activity) : holder.tvReportSrcOpen.visibility = View.VISIBLE holder.tvReportActionOpen.visibility = View.VISIBLE } else { + reportEntity.isShow = false holder.tvStatusSelect.setCompoundDrawablesWithIntrinsicBounds( getDrawable(R.drawable.icon_msg_open), null, @@ -323,7 +367,7 @@ class DriverMsgBoxListAdapter(private val activity: Activity) : TimeUtils.millis2String(it[position].timestamp, getHourMinFormat()) holder.tvV2XContent.text = v2XMsg.content holder.ivV2XImage.setImageDrawable(activity.resources.getDrawable( - EventTypeEnumNew.getUpdateIconRes(v2XMsg.type)) + EventTypeEnumNew.getUpdateIconRes(v2XMsg.type)) ) } } diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/MBoxBubbleAdapter.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/MBoxBubbleAdapter.kt index 343289ebcd..c95913d7e7 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/MBoxBubbleAdapter.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/MBoxBubbleAdapter.kt @@ -17,14 +17,13 @@ import com.mogo.eagle.core.utilcode.util.TimeUtils.getHourMinFormat class MBoxBubbleAdapter(private val activity: Activity): RecyclerView.Adapter(){ - private var data: ArrayList ?= null + private var data: ArrayList ?= null private val notice: Int = 1 private val v2x: Int = 2 - var countDownTimer: CountDownTimer?=null - fun setData(data: ArrayList){ + fun setData(data: ArrayList){ this.data = data if(data.size>3){ data.removeAt(0) @@ -49,14 +48,14 @@ class MBoxBubbleAdapter(private val activity: Activity): RecyclerView.Adapter { data?.let { - val noticeFrCloudMsg = it[position].bean as NoticeFrCloudMsg + val noticeFrCloudMsg = it[position].msgBoxBean.bean as NoticeFrCloudMsg if(noticeFrCloudMsg.type == 0){ val noticeNormalData = noticeFrCloudMsg.noticeNormalData - holder.tvMNoticeTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat()) + holder.tvMNoticeTime.text = TimeUtils.millis2String(it[position].msgBoxBean.timestamp,getHourMinFormat()) holder.tvMNoticeContent.text = noticeNormalData?.content }else { val noticeTrafficStylePushData = noticeFrCloudMsg.trafficPushData - holder.tvMNoticeTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat()) + holder.tvMNoticeTime.text = TimeUtils.millis2String(it[position].msgBoxBean.timestamp,getHourMinFormat()) holder.tvMNoticeContent.text = noticeTrafficStylePushData?.content } @@ -65,8 +64,8 @@ class MBoxBubbleAdapter(private val activity: Activity): RecyclerView.Adapter { data?.let { val msgBoxBean = it[position] - val v2XMsg = msgBoxBean.bean as V2XMsg - holder.tvMV2XTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat()) + val v2XMsg = msgBoxBean.msgBoxBean.bean as V2XMsg + holder.tvMV2XTime.text = TimeUtils.millis2String(it[position].msgBoxBean.timestamp,getHourMinFormat()) holder.tvMV2XContent.text = v2XMsg.content holder.ivMV2XImage.setImageDrawable(activity.resources.getDrawable( EventTypeEnumNew.getUpdateIconRes(v2XMsg.type))) @@ -74,8 +73,8 @@ class MBoxBubbleAdapter(private val activity: Activity): RecyclerView.Adapter() { - private var data: ArrayList ?= null + private var data: ArrayList ?= null private val notice: Int = 1 private val v2x: Int = 2 private val summary: Int = 3 private val operation: Int = 4 - var countDownTimer: CountDownTimer?=null - fun setData(data: ArrayList){ + fun setData(data: ArrayList){ this.data = data if(data.size>3){ data.removeAt(0) @@ -65,10 +64,10 @@ class MMsgBoxBubbleAdapter(private val activity: Activity): RecyclerView.Adapter when (holder) { is BubbleNoticeHolder -> { data?.let { - val noticeFrCloudMsg = it[position].bean as NoticeFrCloudMsg + val noticeFrCloudMsg = it[position].msgBoxBean.bean as NoticeFrCloudMsg if(noticeFrCloudMsg.type == 0){ val noticeNormalData = noticeFrCloudMsg.noticeNormalData - holder.tvMNoticeTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat()) + holder.tvMNoticeTime.text = TimeUtils.millis2String(it[position].msgBoxBean.timestamp,getHourMinFormat()) holder.tvMNoticeContent.text = noticeNormalData?.content GlideApp.with(activity).load(noticeNormalData?.imageUrl).placeholder(R.drawable.icon_passenger_operation) .optionalTransform( @@ -83,7 +82,7 @@ class MMsgBoxBubbleAdapter(private val activity: Activity): RecyclerView.Adapter } }else if(noticeFrCloudMsg.type == 1){ val noticeTrafficStylePushData = noticeFrCloudMsg.trafficPushData - holder.tvMNoticeTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat()) + holder.tvMNoticeTime.text = TimeUtils.millis2String(it[position].msgBoxBean.timestamp,getHourMinFormat()) holder.tvMNoticeContent.text = noticeTrafficStylePushData?.content GlideApp.with(activity).load(noticeTrafficStylePushData?.poiImgUrl).placeholder(R.drawable.icon_passenger_operation) .optionalTransform( @@ -102,9 +101,9 @@ class MMsgBoxBubbleAdapter(private val activity: Activity): RecyclerView.Adapter } is BubbleV2XHolder -> { data?.let { - val msgBoxBean = it[position] + val msgBoxBean = it[position].msgBoxBean val v2XMsg = msgBoxBean.bean as V2XMsg - holder.tvMV2XTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat()) + holder.tvMV2XTime.text = TimeUtils.millis2String(it[position].msgBoxBean.timestamp,getHourMinFormat()) holder.tvMV2XContent.text = v2XMsg.content holder.ivMV2XImage.setImageDrawable(activity.resources.getDrawable( EventTypeEnumNew.getUpdateIconRes(v2XMsg.type))) @@ -115,8 +114,8 @@ class MMsgBoxBubbleAdapter(private val activity: Activity): RecyclerView.Adapter } is BubbleSummaryHolder -> { data?.let { - val summaryMsg= it[position].bean as V2XMsg - holder.tvMSummaryTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat()) + val summaryMsg= it[position].msgBoxBean.bean as V2XMsg + holder.tvMSummaryTime.text = TimeUtils.millis2String(it[position].msgBoxBean.timestamp,getHourMinFormat()) holder.tvMSummaryContent.text = summaryMsg.content holder.tvMSummaryCheck.setOnClickListener { //跳转全览模式 @@ -127,15 +126,15 @@ 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()) + val operationMsg = it[position].msgBoxBean.bean as OperationMsg + holder.tvMOperationTime.text = TimeUtils.millis2String(it[position].msgBoxBean.timestamp,getHourMinFormat()) holder.tvMOperationContent.text = operationMsg.content } } } - val msgBoxBean: MsgBoxBean = data!![position] - countDownTimer =object: CountDownTimer(CallerMsgBoxManager.getDismissTime(),1000){ + val msgBoxBean: MsgBoxCountDownBean = data!![position] + msgBoxBean.countDownTimer =object: CountDownTimer(CallerMsgBoxManager.getDismissTime(),1000){ override fun onTick(p0: Long) { } @@ -148,17 +147,17 @@ class MMsgBoxBubbleAdapter(private val activity: Activity): RecyclerView.Adapter } } - countDownTimer?.start() + msgBoxBean.countDownTimer?.start() } override fun getItemCount() = data?.size ?: 0 override fun getItemViewType(position: Int): Int { - return if(data!![position].type == MsgBoxType.NOTICE){ + return if(data!![position].msgBoxBean.type == MsgBoxType.NOTICE){ notice - }else if(data!![position].type == MsgBoxType.V2X && data!![position].sourceType == DataSourceType.SUMMARY){ + }else if(data!![position].msgBoxBean.type == MsgBoxType.V2X && data!![position].msgBoxBean.sourceType == DataSourceType.SUMMARY){ summary - }else if(data!![position].type == MsgBoxType.OPERATION){ + }else if(data!![position].msgBoxBean.type == MsgBoxType.OPERATION){ operation } else{ v2x diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/PassengerMsgBoxBubbleAdapter.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/PassengerMsgBoxBubbleAdapter.kt index 01c8b24ae1..5b5aca0a98 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/PassengerMsgBoxBubbleAdapter.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/PassengerMsgBoxBubbleAdapter.kt @@ -28,15 +28,13 @@ import com.mogo.eagle.core.widget.RoundCanClickConstraintLayout */ class PassengerMsgBoxBubbleAdapter(private val activity: Activity): RecyclerView.Adapter() { - private var data: ArrayList ?= null + private var data: ArrayList ?= null private val notice: Int = 1 private val v2x: Int = 2 private val summary: Int = 3 - var countDownTimer: CountDownTimer?=null - - fun setData(data: ArrayList){ + fun setData(data: ArrayList){ this.data = data if(data.size>3){ data.removeAt(0) @@ -65,10 +63,10 @@ class PassengerMsgBoxBubbleAdapter(private val activity: Activity): RecyclerView when (holder) { is BubbleNoticeHolder -> { data?.let { - val noticeFrCloudMsg = it[position].bean as NoticeFrCloudMsg + val noticeFrCloudMsg = it[position].msgBoxBean.bean as NoticeFrCloudMsg if(noticeFrCloudMsg.type == 0){ val noticeNormalData = noticeFrCloudMsg.noticeNormalData - holder.tvPassengerNoticeTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat()) + holder.tvPassengerNoticeTime.text = TimeUtils.millis2String(it[position].msgBoxBean.timestamp,getHourMinFormat()) holder.tvPassengerNoticeContent.text = noticeNormalData?.content GlideApp.with(activity).load(noticeNormalData?.imageUrl).optionalTransform( GlideRoundedCornersTransform( @@ -82,7 +80,7 @@ class PassengerMsgBoxBubbleAdapter(private val activity: Activity): RecyclerView } }else if(noticeFrCloudMsg.type == 1){ val noticeTrafficStylePushData = noticeFrCloudMsg.trafficPushData - holder.tvPassengerNoticeTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat()) + holder.tvPassengerNoticeTime.text = TimeUtils.millis2String(it[position].msgBoxBean.timestamp,getHourMinFormat()) holder.tvPassengerNoticeContent.text = noticeTrafficStylePushData?.content GlideApp.with(activity).load(noticeTrafficStylePushData?.poiImgUrl).optionalTransform( GlideRoundedCornersTransform( @@ -100,9 +98,9 @@ class PassengerMsgBoxBubbleAdapter(private val activity: Activity): RecyclerView } is BubbleV2XHolder -> { data?.let { - val msgBoxBean = it[position] + val msgBoxBean = it[position].msgBoxBean val v2XMsg = msgBoxBean.bean as V2XMsg - holder.tvPassengerV2XTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat()) + holder.tvPassengerV2XTime.text = TimeUtils.millis2String(it[position].msgBoxBean.timestamp,getHourMinFormat()) holder.tvPassengerV2XContent.text = v2XMsg.content holder.ivPassengerV2XImage.setImageDrawable(activity.resources.getDrawable( EventTypeEnumNew.getUpdateIconRes(v2XMsg.type))) @@ -113,8 +111,8 @@ class PassengerMsgBoxBubbleAdapter(private val activity: Activity): RecyclerView } is BubbleSummaryHolder -> { data?.let { - val summaryMsg= it[position].bean as V2XMsg - holder.tvPassengerSummaryTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat()) + val summaryMsg= it[position].msgBoxBean.bean as V2XMsg + holder.tvPassengerSummaryTime.text = TimeUtils.millis2String(it[position].msgBoxBean.timestamp,getHourMinFormat()) holder.tvPassengerSummaryContent.text = summaryMsg.content holder.tvPassengerSummaryCheck.setOnClickListener { //跳转全览模式 @@ -125,8 +123,8 @@ class PassengerMsgBoxBubbleAdapter(private val activity: Activity): RecyclerView } } - val msgBoxBean: MsgBoxBean = data!![position] - countDownTimer =object: CountDownTimer(CallerMsgBoxManager.getDismissTime(),1000){ + val msgBoxBean: MsgBoxCountDownBean = data!![position] + msgBoxBean.countDownTimer =object: CountDownTimer(CallerMsgBoxManager.getDismissTime(),1000){ override fun onTick(p0: Long) { } @@ -139,15 +137,15 @@ class PassengerMsgBoxBubbleAdapter(private val activity: Activity): RecyclerView } } - countDownTimer?.start() + msgBoxBean.countDownTimer?.start() } override fun getItemCount() = data?.size ?: 0 override fun getItemViewType(position: Int): Int { - return if(data!![position].type == MsgBoxType.NOTICE){ + return if(data!![position].msgBoxBean.type == MsgBoxType.NOTICE){ notice - }else if(data!![position].type == MsgBoxType.V2X && data!![position].sourceType == DataSourceType.SUMMARY){ + }else if(data!![position].msgBoxBean.type == MsgBoxType.V2X && data!![position].msgBoxBean.sourceType == DataSourceType.SUMMARY){ summary } else{ v2x diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt index 98776afe49..868a98e6ac 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt @@ -9,6 +9,7 @@ import android.graphics.Color import android.os.Build import android.text.Html import android.util.AttributeSet +import android.util.Log import android.view.LayoutInflater import android.view.View import androidx.annotation.RequiresApi @@ -77,6 +78,8 @@ import com.mogo.eagle.core.utilcode.util.* import com.mogo.map.uicontroller.VisualAngleMode import com.mogo.map.uicontroller.VisualAngleMode.* import kotlinx.android.synthetic.main.view_debug_setting.view.* +import kotlinx.android.synthetic.main.view_debug_setting.view.tbRouteDynamicEffect +import kotlinx.android.synthetic.main.view_sop_setting.view.* import kotlinx.coroutines.launch import mogo.telematics.pad.MessagePad import mogo_msg.MogoReportMsg @@ -306,21 +309,22 @@ internal class DebugSettingView @JvmOverloads constructor( } } - /** - * 魔戒控制 - */ tbMojie.setOnCheckedChangeListener { buttonView, isChecked -> if (isChecked) { buttonView.setCompoundDrawables(null, null, iconDown, null) - btnOpenAllGestures.visibility = View.VISIBLE + tbOpenMfView.visibility = View.VISIBLE } else { buttonView.setCompoundDrawables(null, null, iconRight, null) - btnOpenAllGestures.visibility = View.GONE + tbOpenMfView.visibility = View.GONE } } - btnOpenAllGestures.setOnClickListener { - CallerMapUIServiceManager.getMapUIController()?.setAllGesturesEnabled(true) + /** + * 蘑方控制 默认关闭 + */ + tbOpenMfView.isChecked = HmiBuildConfig.isShowMfToastView + tbOpenMfView.setOnCheckedChangeListener { _, isChecked -> + HmiBuildConfig.isShowMfToastView = isChecked } /** diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainActivity.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainActivity.kt index 772a37f214..842235f84b 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainActivity.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainActivity.kt @@ -74,10 +74,10 @@ open class MainActivity : MvpActivity(), MainView, } override fun initViews() { + injectFloatView() injectStatusBar() window.setBackgroundDrawable(null) initConnectInfoRV() - FloatingViewHandler.init(module_main_id_floating_view) CallerHmiManager.init(this) //申请悬浮窗权限 @@ -91,9 +91,9 @@ open class MainActivity : MvpActivity(), MainView, } private fun injectStatusBar() { - val decorView = this.window.decorView as FrameLayout + val decorView = this.window.decorView as? FrameLayout ?: return val contentView = - (decorView.findViewById(android.R.id.content) as ViewGroup).getChildAt(0) + (decorView.findViewById(android.R.id.content) as? ViewGroup)?.getChildAt(0) ?: return contentView.fitsSystemWindows = false decorView.clipToPadding = false var statusBarView = decorView.findViewWithTag("status_bar") @@ -111,6 +111,26 @@ open class MainActivity : MvpActivity(), MainView, decorView.addView(statusBarView, statusBarLP) } + + private fun injectFloatView() { + val decorView = this.window.decorView as? FrameLayout ?: return + val contentView = + (decorView.findViewById(android.R.id.content) as? ViewGroup)?.getChildAt(0) ?: return + contentView.fitsSystemWindows = false + decorView.clipToPadding = false + var floatContainer = decorView.findViewWithTag("float_container") + if (floatContainer == null) { + floatContainer = FrameLayout(this) + floatContainer.tag = "float_container" + FloatingViewHandler.init(floatContainer) + val params = FrameLayout.LayoutParams( + ViewGroup.LayoutParams.MATCH_PARENT, + ViewGroup.LayoutParams.MATCH_PARENT, + ) + decorView.addView(floatContainer, params) + } + } + override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) calculateStartTime() diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/module_main_activity_main.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/module_main_activity_main.xml index 96184c4e54..0b1e1b60cd 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/module_main_activity_main.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/module_main_activity_main.xml @@ -6,23 +6,11 @@ android:background="@drawable/main_splash_bg" android:orientation="vertical"> + - - - - - - - - + android:layout_height="match_parent" /> -