diff --git a/OCH/taxi/driver/src/main/java/com/mogo/och/taxi/ui/BaseTaxiTabFragment.java b/OCH/taxi/driver/src/main/java/com/mogo/och/taxi/ui/BaseTaxiTabFragment.java index a8d88edf6b..0344ff4e70 100644 --- a/OCH/taxi/driver/src/main/java/com/mogo/och/taxi/ui/BaseTaxiTabFragment.java +++ b/OCH/taxi/driver/src/main/java/com/mogo/och/taxi/ui/BaseTaxiTabFragment.java @@ -36,7 +36,6 @@ import com.mogo.map.listener.IMogoMapListener; import com.mogo.och.common.module.utils.ResourcesUtils; import com.mogo.och.common.module.wigets.map.orderstatus.OrderStatusView; import com.mogo.och.common.module.wigets.map.overmapview.OverMapDialog; -import com.mogo.och.common.module.wigets.map.switchvisual.VisualViewDirver; import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager; import com.mogo.och.taxi.R; @@ -60,11 +59,11 @@ public abstract class BaseTaxiTabFragment { - if (groupTestPanel.getVisibility() == View.VISIBLE) { - groupTestPanel.setVisibility(View.GONE); - } else { - groupTestPanel.setVisibility(View.VISIBLE); - } - return false; - }); +// mSpeedView.setOnLongClickListener(v -> { +// if (groupTestPanel.getVisibility() == View.VISIBLE) { +// groupTestPanel.setVisibility(View.GONE); +// } else { +// groupTestPanel.setVisibility(View.VISIBLE); +// } +// return false; +// }); CallerHmiViewControlListenerManager.INSTANCE.invokeMainPageViewVisible(View.VISIBLE); onAutopilotStatusChanged(CallerAutoPilotStatusListenerManager.INSTANCE.getState(), CallerAutoPilotControlManager.INSTANCE.isCanStartAutopilot(false, 0)); @@ -233,7 +232,6 @@ public abstract class BaseTaxiTabFragment - + + + + + + + + --> - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/androidTest/java/com/mogo/functions/test/V2NTest.kt b/app/src/androidTest/java/com/mogo/functions/test/V2NTest.kt index 78f15e375f..7987fb199f 100644 --- a/app/src/androidTest/java/com/mogo/functions/test/V2NTest.kt +++ b/app/src/androidTest/java/com/mogo/functions/test/V2NTest.kt @@ -58,12 +58,12 @@ class V2NTest { if (millis > 0) { delay(millis) } - FunctionBuildConfig.isNewV2NData = true - FunctionBuildConfig.v2nMainSwitch = true + FunctionBuildConfig.v2nNewLinked = true + FunctionBuildConfig.v2nTotalSwitch = true runCatching { val map = HashMap().also { - it["f1"] = FunctionBuildConfig.v2nMainSwitch - it["f2"] = FunctionBuildConfig.isNewV2NData + it["f1"] = FunctionBuildConfig.v2nTotalSwitch + it["f2"] = FunctionBuildConfig.v2nNewLinked } CallerTelematicManager.sendMsgToAllClients(TelematicConstant.V2N_NEW_LINK_SWITCH, GsonUtils.toJson(map).toByteArray()) } @@ -99,12 +99,12 @@ class V2NTest { if (millis > 0) { delay(millis) } - FunctionBuildConfig.isNewV2NData = true - FunctionBuildConfig.v2nMainSwitch = true + FunctionBuildConfig.v2nNewLinked = true + FunctionBuildConfig.v2nTotalSwitch = true runCatching { val map = HashMap().also { - it["f1"] = FunctionBuildConfig.v2nMainSwitch - it["f2"] = FunctionBuildConfig.isNewV2NData + it["f1"] = FunctionBuildConfig.v2nTotalSwitch + it["f2"] = FunctionBuildConfig.v2nNewLinked } CallerTelematicManager.sendMsgToAllClients(TelematicConstant.V2N_NEW_LINK_SWITCH, GsonUtils.toJson(map).toByteArray()) } @@ -179,12 +179,12 @@ class V2NTest { } val newPoint = DrivingDirectionUtils.calculateNewPoint(car.longitude, car.latitude, car.heading , 200.0) Log.d(TAG, "获取到路口数据..., 自车:[${car.longitude}, ${car.latitude}]前方200米外的点: [${newPoint.first}, ${newPoint.second}]") - FunctionBuildConfig.isNewV2NData = true - FunctionBuildConfig.v2nMainSwitch = true + FunctionBuildConfig.v2nNewLinked = true + FunctionBuildConfig.v2nTotalSwitch = true runCatching { val map = HashMap().also { - it["f1"] = FunctionBuildConfig.v2nMainSwitch - it["f2"] = FunctionBuildConfig.isNewV2NData + it["f1"] = FunctionBuildConfig.v2nTotalSwitch + it["f2"] = FunctionBuildConfig.v2nNewLinked } CallerTelematicManager.sendMsgToAllClients(TelematicConstant.V2N_NEW_LINK_SWITCH, GsonUtils.toJson(map).toByteArray()) } @@ -211,12 +211,12 @@ class V2NTest { if (millis > 0) { delay(millis) } - FunctionBuildConfig.isNewV2NData = true - FunctionBuildConfig.v2nMainSwitch = true + FunctionBuildConfig.v2nNewLinked = true + FunctionBuildConfig.v2nTotalSwitch = true runCatching { val map = HashMap().also { - it["f1"] = FunctionBuildConfig.v2nMainSwitch - it["f2"] = FunctionBuildConfig.isNewV2NData + it["f1"] = FunctionBuildConfig.v2nTotalSwitch + it["f2"] = FunctionBuildConfig.v2nNewLinked } CallerTelematicManager.sendMsgToAllClients(TelematicConstant.V2N_NEW_LINK_SWITCH, GsonUtils.toJson(map).toByteArray()) } @@ -261,12 +261,12 @@ class V2NTest { if (millis > 0) { delay(millis) } - FunctionBuildConfig.isNewV2NData = true - FunctionBuildConfig.v2nMainSwitch = true + FunctionBuildConfig.v2nNewLinked = true + FunctionBuildConfig.v2nTotalSwitch = true runCatching { val map = HashMap().also { - it["f1"] = FunctionBuildConfig.v2nMainSwitch - it["f2"] = FunctionBuildConfig.isNewV2NData + it["f1"] = FunctionBuildConfig.v2nTotalSwitch + it["f2"] = FunctionBuildConfig.v2nNewLinked } CallerTelematicManager.sendMsgToAllClients(TelematicConstant.V2N_NEW_LINK_SWITCH, GsonUtils.toJson(map).toByteArray()) } diff --git a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/FuncBizProvider.kt b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/FuncBizProvider.kt index 1e29f19194..574bd5f14a 100644 --- a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/FuncBizProvider.kt +++ b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/FuncBizProvider.kt @@ -118,7 +118,7 @@ class FuncBizProvider : IMoGoFuncBizProvider { } override fun queryV2XEvents() { - if (V2NCarTypeCheck.verifyCarType() && (!FunctionBuildConfig.v2nMainSwitch || !FunctionBuildConfig.isNewV2NData)) { + if (V2NCarTypeCheck.verifyCarType() && (!FunctionBuildConfig.v2nTotalSwitch || !FunctionBuildConfig.v2nNewLinked)) { v2xPoiLoader.queryWholeRoadEvents() } } diff --git a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/overview/OverViewDataManager.kt b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/overview/OverViewDataManager.kt index 496ddc44b2..e121438401 100644 --- a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/overview/OverViewDataManager.kt +++ b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/overview/OverViewDataManager.kt @@ -107,7 +107,7 @@ object OverViewDataManager { .observeOn(AndroidSchedulers.mainThread()) .subscribe { it?.apply { - if (V2NCarTypeCheck.verifyCarType() && (!FunctionBuildConfig.v2nMainSwitch || !FunctionBuildConfig.isNewV2NData)) { + if (V2NCarTypeCheck.verifyCarType() && (!FunctionBuildConfig.v2nTotalSwitch || !FunctionBuildConfig.v2nNewLinked)) { CallerFuncBizListenerManager.invokeV2XEvents(this) } } diff --git a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/V2XEventManager.kt b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/V2XEventManager.kt index 4b4238ee09..dd3b9092d5 100644 --- a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/V2XEventManager.kt +++ b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/V2XEventManager.kt @@ -196,8 +196,8 @@ object V2XEventManager : IMoGoChassisLocationGCJ02Listener, IV2XCallback, } is V2XEvent.RoadEventX -> { val flag = verifyCarType() - Log.d("$M_V2X$TAG", "---- 收到ai云V2N事件 ---:${flag}, ${FunctionBuildConfig.v2nMainSwitch}, ${FunctionBuildConfig.isNewV2NData}") - if (flag && (!FunctionBuildConfig.v2nMainSwitch || !FunctionBuildConfig.isNewV2NData)) { + Log.d("$M_V2X$TAG", "---- 收到ai云V2N事件 ---:${flag}, ${FunctionBuildConfig.v2nTotalSwitch}, ${FunctionBuildConfig.v2nNewLinked}") + if (flag && (!FunctionBuildConfig.v2nTotalSwitch || !FunctionBuildConfig.v2nNewLinked)) { // try { if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) { Log.d("$M_V2X$TAG", "onAck -> 司机端: 将收到云端事件给到乘客端...") @@ -210,7 +210,7 @@ object V2XEventManager : IMoGoChassisLocationGCJ02Listener, IV2XCallback, // } handleRoadMarkerEvent(event.data.toRoadMarker()) } else{ - V2XBizTrace.onAck("事件未触发,被开关拦截",mapOf("roadEvent" to event, "v2nMainSwitch" to FunctionBuildConfig.v2nMainSwitch,"isNewV2NData" to FunctionBuildConfig.isNewV2NData), true) + V2XBizTrace.onAck("事件未触发,被开关拦截",mapOf("roadEvent" to event, "v2nMainSwitch" to FunctionBuildConfig.v2nTotalSwitch,"isNewV2NData" to FunctionBuildConfig.v2nNewLinked), true) } } else -> { diff --git a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/pnc/V2NIdentifyDrawer.kt b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/pnc/V2NIdentifyDrawer.kt index a9a0282d94..516feb66b2 100644 --- a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/pnc/V2NIdentifyDrawer.kt +++ b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/pnc/V2NIdentifyDrawer.kt @@ -45,7 +45,6 @@ import com.mogo.eagle.function.biz.v2x.v2n.utils.EventDismissBean import com.mogo.eagle.function.biz.v2x.v2n.utils.EventDismissManager import com.mogo.eagle.function.biz.v2x.v2n.utils.IEventDismissListener import com.mogo.eagle.function.biz.v2x.v2n.utils.V2XEventAnalyticsManager -import com.mogo.map.entities.Lane import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.asCoroutineDispatcher import kotlinx.coroutines.delay @@ -484,42 +483,42 @@ internal object V2NIdentifyDrawer: IEventDismissListener { } private fun drawShiGong(events: List) { - if (V2NCarTypeCheck.verifyCarType() && FunctionBuildConfig.v2nMainSwitch && FunctionBuildConfig.isNewV2NData) { + if (V2NCarTypeCheck.verifyCarType() && FunctionBuildConfig.v2nTotalSwitch && FunctionBuildConfig.v2nNewLinked) { handler.removeMessages(MSG_WHAT_DRAW_SHIGONE) handler.sendMessage(Message.obtain(handler, MSG_WHAT_DRAW_SHIGONE, events)) } } private fun drawShiGu(events: List) { - if (V2NCarTypeCheck.verifyCarType() && FunctionBuildConfig.v2nMainSwitch && FunctionBuildConfig.isNewV2NData) { + if (V2NCarTypeCheck.verifyCarType() && FunctionBuildConfig.v2nTotalSwitch && FunctionBuildConfig.v2nNewLinked) { handler.removeMessages(MSG_WHAT_DRAW_SHIGU) handler.sendMessage(Message.obtain(handler, MSG_WHAT_DRAW_SHIGU, events)) } } private fun drawYongDu(events: List) { - if (V2NCarTypeCheck.verifyCarType() && FunctionBuildConfig.v2nMainSwitch && FunctionBuildConfig.isNewV2NData) { + if (V2NCarTypeCheck.verifyCarType() && FunctionBuildConfig.v2nTotalSwitch && FunctionBuildConfig.v2nNewLinked) { handler.removeMessages(MSG_WHAT_DRAW_YONGDU) handler.sendMessage(Message.obtain(handler, MSG_WHAT_DRAW_YONGDU, events)) } } private fun drawOtherRetrogradeVehicle(event: MessagePad.Event) { - if (V2NCarTypeCheck.verifyCarType() && FunctionBuildConfig.v2nMainSwitch && FunctionBuildConfig.isNewV2NData) { + if (V2NCarTypeCheck.verifyCarType() && FunctionBuildConfig.v2nTotalSwitch && FunctionBuildConfig.v2nNewLinked) { handler.removeMessages(MSG_WHAT_DRAW_OTHER_RETROGRADE_VEHICLE) handler.sendMessage(Message.obtain(handler, MSG_WHAT_DRAW_OTHER_RETROGRADE_VEHICLE, event)) } } private fun drawGreenWave(crossSpeed: V2nCrossSpeed) { - if (V2NCarTypeCheck.verifyCarType() && FunctionBuildConfig.v2nMainSwitch && FunctionBuildConfig.isNewV2NData) { + if (V2NCarTypeCheck.verifyCarType() && FunctionBuildConfig.v2nTotalSwitch && FunctionBuildConfig.v2nNewLinked) { handler.removeMessages(MSG_WHAT_DRAW_GREEN_WAVE) handler.sendMessage(Message.obtain(handler, MSG_WHAT_DRAW_GREEN_WAVE, crossSpeed)) } } private fun drawPeopleCross(event: MessagePad.Event) { - if (V2NCarTypeCheck.verifyCarType() && FunctionBuildConfig.v2nMainSwitch && FunctionBuildConfig.isNewV2NData) { + if (V2NCarTypeCheck.verifyCarType() && FunctionBuildConfig.v2nTotalSwitch && FunctionBuildConfig.v2nNewLinked) { handler.removeMessages(MSG_WHAT_DRAW_PEOPLE_CROSS) handler.sendMessage(Message.obtain(handler, MSG_WHAT_DRAW_PEOPLE_CROSS, event)) } diff --git a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/MoGoAutopilotControlProvider.kt b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/MoGoAutopilotControlProvider.kt index 41e007e3b0..107722103d 100644 --- a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/MoGoAutopilotControlProvider.kt +++ b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/MoGoAutopilotControlProvider.kt @@ -68,7 +68,6 @@ import com.zhidao.support.adas.high.common.Constants import com.zhidao.support.adas.high.common.CupidLogUtils import com.zhjt.mogo.adas.common.MessageType import com.zhjt.mogo.adas.common.power.PowerUnitChannel -import com.zhjt.mogo.adas.data.Adas import com.zhjt.mogo.adas.data.AdasConstants import com.zhjt.mogo.adas.data.bean.MogoReport import com.zhjt.mogo.adas.data.bean.NodeStateInfo @@ -1166,8 +1165,8 @@ class MoGoAutopilotControlProvider : CallerLogger.d("$M_D_C$TAG", status) runCatching { val map = HashMap().also { - it["f1"] = FunctionBuildConfig.v2nMainSwitch - it["f2"] = FunctionBuildConfig.isNewV2NData + it["f1"] = FunctionBuildConfig.v2nTotalSwitch + it["f2"] = FunctionBuildConfig.v2nNewLinked } CallerTelematicManager.sendMsgToAllClients(TelematicConstant.V2N_NEW_LINK_SWITCH, GsonUtils.toJson(map).toByteArray()) } diff --git a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/telematic/TeleMsgHandler.kt b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/telematic/TeleMsgHandler.kt index 6bcc217bf5..b49fc78e30 100644 --- a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/telematic/TeleMsgHandler.kt +++ b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/telematic/TeleMsgHandler.kt @@ -149,8 +149,8 @@ class TeleMsgHandler : IMsgHandler { val f1 = data["f1"] as Boolean val f2 = data["f2"] as Boolean Log.d(TAG, "乘客屏收到司机屏转发的新链路开关 --- 3 ---:$data, f1: $f1, f2:$f2") - FunctionBuildConfig.v2nMainSwitch = f1 - FunctionBuildConfig.isNewV2NData = f2 + FunctionBuildConfig.v2nTotalSwitch = f1 + FunctionBuildConfig.v2nNewLinked = f2 } catch (t: Throwable) { t.printStackTrace() Log.e(TAG, "乘客屏收到司机屏转发的新链路开关异常", t) @@ -270,11 +270,11 @@ class TeleMsgHandler : IMsgHandler { TelematicConstant.OBU_RUNREDLIGHT_WARNING -> { when (String(it.body)) { "0" -> { - HmiBuildConfig.isShowRunRedLightView = false + HmiBuildConfig.v2iRedLightWarning = false } "1" -> { - HmiBuildConfig.isShowRunRedLightView = true + HmiBuildConfig.v2iRedLightWarning = true } } } 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 37b63b34be..b874c07fee 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 @@ -64,25 +64,25 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener } override fun onMoGoObuRsiWarning(rsiWarningData: ObuScene.RsiWarningData) { - if (FunctionBuildConfig.v2xMainSwitch && HmiBuildConfig.isShowObuV2iView) { + if (FunctionBuildConfig.v2xTotalSwitch && HmiBuildConfig.v2iTotalSwitch) { onMogoObuDcRsiWarning(rsiWarningData) } } override fun onMoGoObuRsmWarning(rsmWarningData: ObuScene.RsmWarningData) { - if (FunctionBuildConfig.v2xMainSwitch && HmiBuildConfig.isShowObuV2iView) { + if (FunctionBuildConfig.v2xTotalSwitch && HmiBuildConfig.v2iTotalSwitch) { onMogoObuDcRsmWarning(rsmWarningData) } } override fun onMoGoObuSpatWarning(spatWarningData: ObuScene.SpatWarningData) { - if (FunctionBuildConfig.v2xMainSwitch && HmiBuildConfig.isShowObuV2iView) { + if (FunctionBuildConfig.v2xTotalSwitch && HmiBuildConfig.v2iTotalSwitch) { onMogoObuDcSpatWarning(spatWarningData) } } override fun onMoGoObuMapMath(mapMatchData: ObuScene.MapMatchData) { - if (FunctionBuildConfig.v2xMainSwitch && HmiBuildConfig.isShowObuV2iView) { + if (FunctionBuildConfig.v2xTotalSwitch && HmiBuildConfig.v2iTotalSwitch) { onMogoObuMapMath(mapMatchData) } } @@ -339,7 +339,7 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener * RSM预警信息 CvxPtcThreatIndInfo CvxPtcInfoIndInfo(主车与弱势交通参与者之间的预警(如:弱势交通参与者碰撞预警)) */ fun onMogoObuDcRsmWarning(rsmWarningData: ObuScene.RsmWarningData?) { - if (HmiBuildConfig.isShowObuWeaknessTrafficView) { + if (HmiBuildConfig.v2iWeaknessTraffic) { CallerLogger.d( "${M_OBU}${TAG}", "MogoObuDcCombineManager onMogoObuRsmWarning ------> ${rsmWarningData.toString()}" @@ -576,8 +576,8 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener } 1 -> { //闯红灯 V2I_RLVW_VIOLATION_TYPE_RUNNING_RED_LIGHT 一个红灯周期只显示一次 - if(FunctionBuildConfig.v2xMainSwitch && HmiBuildConfig.isShowObuV2iView){ - if (HmiBuildConfig.isShowRunRedLightView) { + if(FunctionBuildConfig.v2xTotalSwitch && HmiBuildConfig.v2iTotalSwitch){ + if (HmiBuildConfig.v2iRedLightWarning) { if (!isShowRunRedLight) { isShowRunRedLight = true ttsContent = @@ -609,7 +609,7 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener } 2 -> { //绿波通行引导 V2I_RLVW_VIOLATION_TYPE_NO_VIOLATION 一个绿灯周期只显示一次 - if (FunctionBuildConfig.v2xMainSwitch && FunctionBuildConfig.v2nMainSwitch && HmiBuildConfig.isShowGreenWaveView) { + if (FunctionBuildConfig.v2xTotalSwitch && FunctionBuildConfig.v2nTotalSwitch && HmiBuildConfig.isShowGreenWaveView) { if (!isShowGreenWave) { isShowGreenWave = true CallerLogger.d( 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 edab8756ef..9307fc3ecd 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 @@ -296,7 +296,7 @@ class MogoPrivateObuNewManager private constructor() : OnUpgradeListener { * v2v预警信息 CvxRvInfoIndInfo CvxV2vThreatIndInfo 他车 */ override fun onObuRvWarning(data: ObuScene.RvWarningData) { - if (FunctionBuildConfig.v2xMainSwitch && HmiBuildConfig.isShowObuV2vView) { + if (FunctionBuildConfig.v2xTotalSwitch && HmiBuildConfig.v2vTotalSwitch) { if (data.warningMsg != null) { // 更新数据,远车数据,之前要匹配uuid data.vehBasicsMsg?.let { @@ -343,7 +343,7 @@ class MogoPrivateObuNewManager private constructor() : OnUpgradeListener { * 红绿灯预警信息 CvxIvpThreatIndInfo */ override fun onObuSpatWarning(data: ObuScene.SpatWarningData) { - if (FunctionBuildConfig.v2xMainSwitch && HmiBuildConfig.isShowObuV2iView) { + if (FunctionBuildConfig.v2xTotalSwitch && HmiBuildConfig.v2iTotalSwitch) { handlerTrafficLight( data.warningType, data.status, @@ -356,7 +356,7 @@ class MogoPrivateObuNewManager private constructor() : OnUpgradeListener { * RSI预警信息 onMogoObuRsiWarning(交通标志预警(前方限速、前方学校等等),交通事件预警(前方拥堵、前方积水等等)) */ override fun onObuRsiWarning(data: ObuScene.RsiWarningData) { - if (FunctionBuildConfig.v2xMainSwitch && HmiBuildConfig.isShowObuV2iView) { + if (FunctionBuildConfig.v2xTotalSwitch && HmiBuildConfig.v2iTotalSwitch) { if (data.warningMsgList != null && data.warningMsgList.size > 0) { var alertContent = "" var ttsContent = "" @@ -643,8 +643,8 @@ class MogoPrivateObuNewManager private constructor() : OnUpgradeListener { "$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}", "onMogoObuRsmWarning ------> ${data?.toString()}" ) - if (FunctionBuildConfig.v2xMainSwitch && HmiBuildConfig.isShowObuV2iView) { - if (HmiBuildConfig.isShowObuWeaknessTrafficView) { + if (FunctionBuildConfig.v2xTotalSwitch && HmiBuildConfig.v2iTotalSwitch) { + if (HmiBuildConfig.v2iWeaknessTraffic) { // 交通参与者类型 0x0:未知 UNKNOWN | 1机动车 2:非机动车 NON_MOTOR | 3:行人 PEDESTRIAN 4:obu if (data != null && data.participant != null) { val v2xType = when (data.participant.ptcType) { @@ -736,7 +736,7 @@ class MogoPrivateObuNewManager private constructor() : OnUpgradeListener { * 地图匹配 是OBU算法输出地图匹配结果,主车匹配道路哪条路或者哪条车道 */ override fun onObuMapMath(data: ObuScene.MapMatchData?) { - if (FunctionBuildConfig.v2xMainSwitch && HmiBuildConfig.isShowObuV2iView) { + if (FunctionBuildConfig.v2xTotalSwitch && HmiBuildConfig.v2iTotalSwitch) { if (data != null) { CallerLogger.d( "$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}", @@ -1056,8 +1056,8 @@ class MogoPrivateObuNewManager private constructor() : OnUpgradeListener { } 1 -> {//闯红灯 V2I_RLVW_VIOLATION_TYPE_RUNNING_RED_LIGHT 一个红灯周期只显示一次 - if(FunctionBuildConfig.v2xMainSwitch && HmiBuildConfig.isShowObuV2iView){ - if (HmiBuildConfig.isShowRunRedLightView) { + if(FunctionBuildConfig.v2xTotalSwitch && HmiBuildConfig.v2iTotalSwitch){ + if (HmiBuildConfig.v2iRedLightWarning) { if (!isShowRunRedLight) { isShowRunRedLight = true ttsContent = diff --git a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/DevaToolsProvider.kt b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/DevaToolsProvider.kt index 7c6cc2fb8c..5b7a6b9b6a 100644 --- a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/DevaToolsProvider.kt +++ b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/DevaToolsProvider.kt @@ -34,7 +34,6 @@ import com.mogo.eagle.core.function.api.devatools.strict.IStrictModeProvider import com.mogo.eagle.core.function.api.lookaround.IMoGoLookAroundProvider import com.mogo.eagle.core.function.api.map.route.IMapRouteProvider import com.mogo.eagle.core.function.api.upgrade.IMoGoUpgradeProvider -import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager import com.mogo.eagle.core.utilcode.kotlin.lifeCycleScope import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger @@ -84,10 +83,8 @@ import com.zhjt.mogo_core_function_devatools.weaknetwork.DetectResultImpl import com.zhjt.mogo_core_function_devatools.weaknetwork.WeakNetworkStrategy import com.zhjt.mogo_core_function_devatools.workorder.WorkOrderManager import com.zhjt.service.chain.ChainLog -import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.delay import kotlinx.coroutines.launch -import java.io.File import java.lang.ref.WeakReference import java.util.concurrent.ConcurrentHashMap @@ -410,8 +407,8 @@ class DevaToolsProvider : IDevaToolsProvider, IAppStateListener { /** * 展示考试车辆控制窗口 */ - override fun showExamControlWindow(view: View,isShow: Boolean) { - ExamControlManager.showExamControlWindow(view,isShow) + override fun showExamControlWindow(isShow: Boolean) { + ExamControlManager.showExamControlWindow(isShow) } override fun onReceiveBadCaseRecord( diff --git a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/exam/ExamControlManager.kt b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/exam/ExamControlManager.kt index 566399a786..81abca169f 100644 --- a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/exam/ExamControlManager.kt +++ b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/exam/ExamControlManager.kt @@ -1,14 +1,10 @@ package com.zhjt.mogo_core_function_devatools.exam import android.annotation.SuppressLint -import android.view.View import androidx.fragment.app.FragmentActivity import com.mogo.eagle.core.data.config.FunctionBuildConfig import com.mogo.eagle.core.function.call.setting.CallerSopSettingManager -import com.mogo.eagle.core.utilcode.util.ClickUtils -import com.mogo.eagle.core.utilcode.util.NetworkUtils -import com.mogo.eagle.core.utilcode.util.ToastUtils -import com.zhjt.mogo_core_function_devatools.badcase.consts.BadCaseConfig +import com.mogo.eagle.core.utilcode.util.AppStateManager /** * 考试控制管理 @@ -21,9 +17,8 @@ internal object ExamControlManager { /** * 开启考试车辆控制窗口 */ - fun showExamControlWindow(view: View,isShow: Boolean){ - val activity = view.context as? FragmentActivity - ?: throw IllegalStateException("please ensure context is FragmentActivity.") + fun showExamControlWindow(isShow: Boolean){ + val activity = AppStateManager.currentActivity() ?: return if(examControlWindow == null){ examControlWindow = ExamControlWindow(activity) } diff --git a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/logcat/MoGoLogRecordProviderImpl.kt b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/logcat/MoGoLogRecordProviderImpl.kt index 31d0275237..c6f4ab2506 100644 --- a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/logcat/MoGoLogRecordProviderImpl.kt +++ b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/logcat/MoGoLogRecordProviderImpl.kt @@ -147,7 +147,7 @@ internal class MoGoLogRecordProviderImpl: IMoGoLogRecordProvider, builder.crashConfig( CrashConfig.Builder() .enabled(true) - .uploader(CrashLogUploader()) +// .uploader(CrashLogUploader()) .crashDir(File(context.getExternalFilesDir(null), "crash")) .expireDuration(TimeUnit.DAYS.toMillis(3)) .javaCrash(true) diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/bone/toolkit/ToolKitDataManager.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/bone/toolkit/ToolKitDataManager.kt index 673b975272..31e17a63ae 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/bone/toolkit/ToolKitDataManager.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/bone/toolkit/ToolKitDataManager.kt @@ -13,6 +13,7 @@ import com.mogo.eagle.core.function.api.och.toolkit.IToolKitItemClickListener import com.mogo.eagle.core.function.api.och.toolkit.ToolKitCustomItemAddParam import com.mogo.eagle.core.function.api.och.toolkit.ToolKitDefaultItemAddParam import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager +import com.mogo.eagle.core.function.call.hmi.CallerHmiManager import com.mogo.eagle.core.function.hmi.R import com.mogo.eagle.core.function.hmi.bone.toolkit.custom.ToolDriverRomaView import com.mogo.eagle.core.function.hmi.bone.toolkit.custom.ToolRestartSystemView @@ -161,7 +162,8 @@ object ToolKitDataManager : IToolKitItemClickListener { ToolTypeEnum.OPERATION_PANEL.name -> { ctx?.also { - SopView.sopView.toggle(it) +// SopView.sopView.toggle(it) + CallerHmiManager.toggleOperatePanel(true) } } diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoHmiProvider.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoHmiProvider.kt index a4c2ba44e4..0b42a8cffe 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoHmiProvider.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoHmiProvider.kt @@ -2,14 +2,15 @@ package com.mogo.eagle.core.function.hmi.ui import android.content.Context import android.text.TextUtils -import android.transition.Slide import android.util.Log import android.view.Gravity import android.view.View import android.view.ViewGroup -import android.view.WindowManager +import android.view.ViewStub import androidx.lifecycle.ProcessLifecycleOwner import androidx.lifecycle.lifecycleScope +import androidx.transition.Slide +import androidx.transition.TransitionManager import com.alibaba.android.arouter.facade.annotation.Route import com.mogo.commons.module.status.MogoStatusManager import com.mogo.commons.voice.AIAssist @@ -36,6 +37,7 @@ import com.mogo.eagle.core.function.api.och.toolkit.ToolKitDefaultItemAddParam import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager import com.mogo.eagle.core.function.call.v2x.CallerTrafficLightListenerManager import com.mogo.eagle.core.function.call.v2x.CallerTurnLightListenerManager +import com.mogo.eagle.core.function.hmi.R import com.mogo.eagle.core.function.hmi.bone.status.fsm.FSMStatusDetailWindowManager import com.mogo.eagle.core.function.hmi.bone.toolkit.ToolKitDataManager import com.mogo.eagle.core.function.hmi.ui.camera.RoadVideoDialog @@ -66,8 +68,6 @@ import com.zhjt.service_biz.BizConfig import kotlinx.coroutines.Job import kotlinx.coroutines.delay import kotlinx.coroutines.launch -import me.jessyan.autosize.utils.AutoSizeUtils -import java.lang.ref.WeakReference import java.util.concurrent.atomic.AtomicBoolean import java.util.concurrent.atomic.AtomicReference @@ -95,8 +95,6 @@ class MoGoHmiProvider : IMoGoHmiProvider { private val xiaozhi by lazy { XiaoZhiStateManager() } - private val operatePanel by lazy { AtomicReference>(null) } - override fun init(context: Context?) { this.context = context } @@ -451,26 +449,22 @@ class MoGoHmiProvider : IMoGoHmiProvider { return } if (show) { - if (operatePanel.get()?.get()?.isShowing() == true) { - return + var target = activity.findViewById(R.id.id_operate_panel) + if (target == null) { + val vs = activity.findViewById(R.id.vs_operate_panel) ?: throw AssertionError() + target = vs.inflate() + } + if (target != null && target.visibility != View.VISIBLE) { + TransitionManager.beginDelayedTransition(target.parent as ViewGroup, Slide(Gravity.START).also { it.duration = 150; it.addTarget(target) }) + target.visibility = View.VISIBLE + target.post { target.bringToFront() } } - MoGoPopWindow.Builder() - .attachToActivity(activity) - .gravityInActivity(Gravity.START or Gravity.TOP) - .contentView(OperatePanelLayout(activity)) - .width(AutoSizeUtils.dp2px(activity, 1000.0f)) - .height(WindowManager.LayoutParams.MATCH_PARENT) - .transition(Slide(Gravity.START), Slide(Gravity.START)) - .onDismissed { - operatePanel.set(null) - } - .build() - .also { - operatePanel.set(WeakReference(it)) - } - .show() } else { - operatePanel.get()?.get()?.hide() + val operatePanelView = activity.findViewById(R.id.id_operate_panel) + if (operatePanelView != null && operatePanelView.visibility == View.VISIBLE) { + TransitionManager.beginDelayedTransition(operatePanelView.parent as ViewGroup, Slide(Gravity.START).also { it.duration = 150; it.addTarget(operatePanelView) }) + operatePanelView.visibility = View.GONE + } } } diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/operate/OperatePanelLayout.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/operate/OperatePanelLayout.kt index 3d8708f210..79fba3c154 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/operate/OperatePanelLayout.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/operate/OperatePanelLayout.kt @@ -5,99 +5,1024 @@ import android.os.Bundle import android.util.AttributeSet import android.util.Log import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup import android.widget.LinearLayout +import androidx.annotation.CallSuper import androidx.core.content.ContextCompat +import androidx.preference.Preference import androidx.preference.PreferenceFragmentCompat +import androidx.preference.PreferenceGroup import androidx.preference.PreferenceHeaderFragmentCompat +import androidx.preference.SwitchPreferenceCompat +import androidx.preference.TwoStatePreference +import androidx.preference.forEach +import androidx.recyclerview.widget.RecyclerView +import com.mogo.eagle.core.data.config.FunctionBuildConfig +import com.mogo.eagle.core.data.config.HmiBuildConfig +import com.mogo.eagle.core.data.multidisplay.TelematicConstant +import com.mogo.eagle.core.data.obu.MogoObuConst +import com.mogo.eagle.core.function.api.devatools.mofang.IMoGoMoFangProvider +import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener +import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener.Companion.FUNC_MODE_DEMO +import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener.Companion.FUNC_MODE_RAIN +import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager +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.hmi.CallerHmiViewControlListenerManager +import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager +import com.mogo.eagle.core.function.call.obu.CallerObuApiManager +import com.mogo.eagle.core.function.call.setting.CallerSopSettingManager +import com.mogo.eagle.core.function.call.telematic.CallerTelematicManager +import com.mogo.eagle.core.function.call.unmanned.CallerUnmannedListenerManager import com.mogo.eagle.core.function.hmi.R +import com.mogo.eagle.core.function.hmi.ui.operate.preferences.PreferenceWithMoFang +import com.mogo.eagle.core.function.hmi.ui.operate.preferences.PreferenceWithSpeedSetting +import com.mogo.eagle.core.function.hmi.ui.operate.preferences.PreferenceWithUnmanInterval +import com.mogo.eagle.core.function.hmi.ui.operate.preferences.PreferenceWithWelcomeWords +import com.mogo.eagle.core.function.hmi.ui.utils.HmiActionLog.Companion.hmiAction +import com.mogo.eagle.core.function.hmi.ui.utils.SOPAnalyticsManager.clickEventAnalytics import com.mogo.eagle.core.utilcode.kotlin.onClick +import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils +import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger +import com.mogo.eagle.core.utilcode.rv.divider.CommonDividerItemDecoration +import com.mogo.eagle.core.utilcode.util.ToastUtils import kotlinx.android.synthetic.main.layout_operate_panel.view.iv_operate_panel_close +import me.jessyan.autosize.utils.AutoSizeUtils -class OperatePanelLayout: LinearLayout { +class OperatePanelLayout : LinearLayout { companion object { private const val TAG = "OperatePanelLayout" } - class PreferenceHeaderFragmentCompatImpl: PreferenceHeaderFragmentCompat() { + class PreferenceHeaderFragmentCompatImpl : PreferenceHeaderFragmentCompat() { + + private var header: PreferenceFragmentCompat? = null override fun onCreatePreferenceHeader(): PreferenceFragmentCompat { - Log.d(TAG, "--- onCreatePreferenceHeader ---") - return PreferenceHeader() + return PreferenceHeader().also { header = it } + } + + override fun onPrimaryNavigationFragmentChanged(isPrimaryNavigationFragment: Boolean) { + super.onPrimaryNavigationFragmentChanged(isPrimaryNavigationFragment) + val screen = header?.preferenceScreen + val count = screen?.preferenceCount ?: 0 + var curr = 0 + var perf: Preference? = null + while (curr < count) { + perf = screen?.getPreference(curr) + if (perf?.fragment != null) { + break + } + curr++ + } + if (perf != null) { + handleNaviBackground(perf) + } + } + + + override fun onPreferenceStartFragment(caller: PreferenceFragmentCompat, pref: Preference): Boolean { + try { + return super.onPreferenceStartFragment(caller, pref) + } finally { + handleNaviBackground(pref) + } + } + + private fun handleNaviBackground(pref: Preference) { + val position = (header?.listView?.adapter as? PreferenceGroup.PreferencePositionCallback)?.getPreferenceAdapterPosition(pref) + ?: RecyclerView.NO_POSITION + val prev = header?.listView?.getTag(R.id.operate_panel_header_last_selected) as? Int + ?: -1 + if (prev == position) { + return + } + if (position != RecyclerView.NO_POSITION) { + if (prev >= 0) { + header?.listView?.layoutManager?.findViewByPosition(prev)?.isSelected = false + } + header?.listView?.layoutManager?.findViewByPosition(position)?.isSelected = true + header?.listView?.setTag(R.id.operate_panel_header_last_selected, position) + } } } - class PreferenceHeader: PreferenceFragmentCompat() { + class PreferenceHeader : PreferenceFragmentCompat() { override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) { - Log.d(TAG, "PreferenceHeader --- onCreatePreferences ---") - setPreferencesFromResource(R.xml.operate_preference_headers, rootKey) + setPreferencesFromResource(R.xml.operate_panel_preference_headers, rootKey) } } - class V2XPreferenceFragmentCompat: PreferenceFragmentCompat() { - override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) { - Log.d(TAG, "V2XPreferenceFragmentCompat --- onCreatePreferences ---") - setPreferencesFromResource(R.xml.operate_preference_details_v2x, rootKey) + abstract class OperatePanelDetailBase : PreferenceFragmentCompat(), Preference.OnPreferenceChangeListener, Preference.OnPreferenceClickListener { + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setPreferenceChangeListener(preferenceScreen) + setPreferenceClickListener(preferenceScreen) + setDefaultVal(preferenceScreen) + setEnabled(preferenceScreen) + } + + protected open fun getDefaultVal(pref: Preference): Any? { + return null + } + + protected open fun isEnabled(pref: Preference): Boolean { + return true + } + + private fun setDefaultVal(pref: Preference) { + if (pref is PreferenceGroup) { + pref.forEach { + setDefaultVal(it) + } + } else { + if (!pref.isPersistent) { + val defVal = getDefaultVal(pref) + if (defVal != null) { + if (pref is TwoStatePreference) { + changeValue(pref, defVal as Boolean) + } else { + pref.setDefaultValue(defVal) + } + } + } else { //TODO renwj 处理持久化存储时,将持久化的值重新赋给业务层的静态变量 + } + } + } + + private fun setEnabled(pref: Preference) { + if (pref is PreferenceGroup) { + pref.forEach { + setEnabled(it) + } + } else { + val curr = isEnabled(pref) + val prev = pref.isEnabled + if (curr != prev) { + pref.isEnabled = curr + } + } + } + + private fun setPreferenceChangeListener(pref: Preference) { + if (pref is PreferenceGroup) { + pref.forEach { setPreferenceChangeListener(it) } + } else { + pref.onPreferenceChangeListener = this + } + } + + private fun setPreferenceClickListener(pref: Preference) { + if (pref is PreferenceGroup) { + pref.forEach { + setPreferenceClickListener(it) + } + } else { + pref.onPreferenceClickListener = this + } + } + + @Suppress("UNCHECKED_CAST") + fun Preference.findPreferenceReal(key: String): T? { + if (this is PreferenceGroup) { + this.forEach { + val find = it.findPreferenceReal(key) + if (find != null) { + return find + } + } + return null + } else { + return if (this.key == key) this as T else null + } + } + + fun changeValue(pref: TwoStatePreference, isChecked: Boolean) { + if (pref.isChecked != isChecked) { + pref.isChecked = isChecked + pref.callChangeListener(isChecked) + } + } + + @CallSuper + override fun onCreateRecyclerView(inflater: LayoutInflater, parent: ViewGroup, savedInstanceState: Bundle?): RecyclerView { + val rv = inflater.inflate(R.layout.layout_operate_panel_detail_recyclerview, parent, false) as RecyclerView + rv.addItemDecoration(CommonDividerItemDecoration.Builder().spanCountTBCare(false).verticalExternalSpace(AutoSizeUtils.dp2px(parent.context, 20.0f)).verticalInnerSpace(AutoSizeUtils.dp2px(parent.context, 30.0f)).externalSpaceEnd(true).build()) + rv.background = ContextCompat.getDrawable(parent.context, R.drawable.bg_operate_panel_preference_detail) + rv.layoutManager = onCreateLayoutManager() + return rv + } + + override fun onPreferenceChange(preference: Preference, newValue: Any?): Boolean { + return !preference.isPersistent + } + + override fun onPreferenceClick(preference: Preference): Boolean { + return !preference.isPersistent } } + class V2XPreferenceFragmentCompat : OperatePanelDetailBase() { + + companion object { + private const val KEY_V2X_TOTAL_SWITCH = "v2x_total_switch" + private const val KEY_V2N_TOTAL_SWITCH = "v2n_total_switch" + private const val KEY_V2N_NEW_LINKED = "v2n_new_linked" + private const val KEY_V2N_NEW_LINKED_TO_PNC = "v2n_new_linked_to_pnc" + private const val KEY_V2N_NEW_LINKED_GREEN_WAVE = "v2n_new_linked_green_wave" + private const val KEY_V2I_TOTAL_SWITCH = "v2i_total_switch" + private const val KEY_V2I_TO_PNC = "v2i_to_pnc" + private const val KEY_V2I_RED_LIGHT_WARNING = "v2i_red_light_warning" + private const val KEY_V2I_WEAKNESS_TRAFFIC = "v2i_weakness_traffic" + private const val KEY_V2V_TOTAL_SWITCH = "v2v_total_switch" + private const val KEY_OBU_TOTAL_SWITCH = "obu_total_switch" + } - class DemoPreferenceFragmentCompat: PreferenceFragmentCompat() { override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) { - Log.d(TAG, "DemoPreferenceFragmentCompat --- onCreatePreferences ---") - setPreferencesFromResource(R.xml.operate_preference_details_demo, rootKey) + setPreferencesFromResource(R.xml.operate_panel_preference_details_v2x, rootKey) + } + + override fun getDefaultVal(pref: Preference): Any? { + when (pref.key) { + KEY_V2X_TOTAL_SWITCH -> { + return FunctionBuildConfig.v2xTotalSwitch + } + KEY_V2N_TOTAL_SWITCH -> { + return FunctionBuildConfig.v2nTotalSwitch + } + KEY_V2N_NEW_LINKED -> { + return FunctionBuildConfig.v2nNewLinked + } + KEY_V2N_NEW_LINKED_TO_PNC -> { + return FunctionBuildConfig.v2nNewLinkedToPNC + } + KEY_V2N_NEW_LINKED_GREEN_WAVE -> { + return FunctionBuildConfig.v2nGreenWave + } + KEY_V2I_TOTAL_SWITCH -> { + return HmiBuildConfig.v2iTotalSwitch + } + KEY_V2I_TO_PNC -> { + return FunctionBuildConfig.v2iToPNC + } + KEY_V2I_RED_LIGHT_WARNING -> { + return HmiBuildConfig.v2iRedLightWarning + } + KEY_V2I_WEAKNESS_TRAFFIC -> { + return HmiBuildConfig.v2iWeaknessTraffic + } + KEY_V2V_TOTAL_SWITCH -> { + return HmiBuildConfig.v2vTotalSwitch + } + KEY_OBU_TOTAL_SWITCH -> { + return CallerObuApiManager.isConnected() + } + } + return super.getDefaultVal(pref) + } + + override fun onPreferenceChange(preference: Preference, newValue: Any?): Boolean { + Log.d(TAG, "-- onPreferenceChange:($preference, $newValue)") + when (preference.key) { + KEY_V2X_TOTAL_SWITCH -> { + val isChecked = newValue as? Boolean ?: false + FunctionBuildConfig.v2xTotalSwitch = isChecked + hmiAction("V2X总开关, ", isChecked) + clickEventAnalytics("V2X总开关", isChecked) + if (isChecked) { + preferenceScreen.findPreferenceReal(KEY_V2N_TOTAL_SWITCH)?.also { changeValue(it, FunctionBuildConfig.v2nTotalSwitch) } // V2N总开关 + preferenceScreen.findPreferenceReal(KEY_V2I_TOTAL_SWITCH)?.also { changeValue(it, HmiBuildConfig.v2iTotalSwitch) } // V2I总开关 + preferenceScreen.findPreferenceReal(KEY_V2V_TOTAL_SWITCH)?.also { changeValue(it, HmiBuildConfig.v2vTotalSwitch) } // V2V总开关 + preferenceScreen.findPreferenceReal(KEY_OBU_TOTAL_SWITCH)?.also { changeValue(it, CallerObuApiManager.isConnected()) } // OBU总开关 + } else { + preferenceScreen.findPreferenceReal(KEY_V2N_TOTAL_SWITCH)?.also { changeValue(it, false) } // V2N总开关 + preferenceScreen.findPreferenceReal(KEY_V2I_TOTAL_SWITCH)?.also { changeValue(it, false) } // V2I总开关 + preferenceScreen.findPreferenceReal(KEY_V2V_TOTAL_SWITCH)?.also { changeValue(it, false) } // V2V总开关 + preferenceScreen.findPreferenceReal(KEY_OBU_TOTAL_SWITCH)?.also { changeValue(it, false) } // OBU总开关 + } + return true + } + KEY_V2N_TOTAL_SWITCH -> { + val isChecked = newValue as? Boolean ?: false + FunctionBuildConfig.v2nTotalSwitch = isChecked + hmiAction("V2N总开关, ", isChecked) + clickEventAnalytics("V2N总开关", isChecked) + if (!isChecked) { + preferenceScreen.findPreferenceReal(KEY_V2N_NEW_LINKED)?.also { changeValue(it, false) } + preferenceScreen.findPreferenceReal(KEY_V2N_NEW_LINKED_TO_PNC)?.also { changeValue(it, false) } + preferenceScreen.findPreferenceReal(KEY_V2N_NEW_LINKED_GREEN_WAVE)?.also { changeValue(it, false) } + } + return true + } + KEY_V2N_NEW_LINKED -> { + val isChecked = newValue as? Boolean ?: false + FunctionBuildConfig.v2nNewLinked = isChecked + hmiAction("V2N新链路", isChecked) + clickEventAnalytics("V2N新链路", isChecked) + return true + } + KEY_V2N_NEW_LINKED_TO_PNC -> { + val isChecked = newValue as? Boolean ?: false + FunctionBuildConfig.v2nNewLinkedToPNC = isChecked + clickEventAnalytics("V2N场景进PNC", isChecked) + hmiAction("V2N场景进PNC, ", isChecked) + CallerAutoPilotControlManager.sendV2nToPncCmd(isChecked) + return true + } + KEY_V2N_NEW_LINKED_GREEN_WAVE -> { + val isChecked = newValue as? Boolean ?: false + FunctionBuildConfig.v2nGreenWave = isChecked + hmiAction("绿波通行", isChecked) + clickEventAnalytics("绿波通行", isChecked) + CallerTelematicManager.sendMsgToAllClients(TelematicConstant.OBU_GREENWAVE_WARNING, (if (isChecked) "1" else "0").toByteArray()) + return true + } + KEY_V2I_TOTAL_SWITCH -> { + val isChecked = newValue as? Boolean ?: false + HmiBuildConfig.v2iTotalSwitch = isChecked + hmiAction("V2I总开关, ", isChecked) + clickEventAnalytics("V2I总开关", isChecked) + return true + } + KEY_V2I_TO_PNC -> { + val isChecked = newValue as? Boolean ?: false + FunctionBuildConfig.v2iToPNC = isChecked + CallerAutoPilotControlManager.sendV2iToPncCmd(isChecked) + hmiAction("V2I场景进PNC, ", isChecked) + clickEventAnalytics("V2I场景进PNC", isChecked) + return true + } + KEY_V2I_RED_LIGHT_WARNING -> { + val isChecked = newValue as? Boolean ?: false + HmiBuildConfig.v2iRedLightWarning = isChecked + CallerTelematicManager.sendMsgToAllClients(TelematicConstant.OBU_RUNREDLIGHT_WARNING, (if (isChecked) "1" else "0").toByteArray()) + clickEventAnalytics("V2I闯红灯预警", isChecked) + hmiAction("V2I闯红灯预警, ", isChecked) + return true + } + KEY_V2I_WEAKNESS_TRAFFIC -> { + val isChecked = newValue as? Boolean ?: false + HmiBuildConfig.v2iWeaknessTraffic = isChecked + clickEventAnalytics("V2I弱势交通参与者", isChecked) + hmiAction("V2I弱势交通参与者, ", isChecked) + return true + } + KEY_V2V_TOTAL_SWITCH -> { + val isChecked = newValue as? Boolean ?: false + HmiBuildConfig.v2vTotalSwitch = isChecked + clickEventAnalytics("V2V总开关", isChecked) + hmiAction("V2V总开关, ", isChecked) + return true + } + KEY_OBU_TOTAL_SWITCH -> { + val isChecked = newValue as? Boolean ?: false + if (!isChecked) { + CallerObuApiManager.disConnectObu() // 断开OBU连接 + } else { + val isObuConnected = CallerObuApiManager.isConnected() + if (isObuConnected) { + CallerObuApiManager.resetObuIpAddress(MogoObuConst.OBU_DEFAULT_IP) + } + } + clickEventAnalytics("OBU控制总开关", isChecked) + hmiAction("OBU控制总开关, ", isChecked) + return true + } + } + return super.onPreferenceChange(preference, newValue) } } - class HdMapPreferenceFragmentCompat: PreferenceFragmentCompat() { + class DemoPreferenceFragmentCompat : OperatePanelDetailBase() { + + companion object { + private const val KEY_DEMO_SWITCH = "demo_switch" + private const val KEY_RECORD_BAG_DIALOG = "record_bag_dialog" + private const val KEY_TAKE_OVER_WAKE = "take_over_wake" + } + override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) { - Log.d(TAG, "HdMapPreferenceFragmentCompat --- onCreatePreferences ---") - setPreferencesFromResource(R.xml.operate_preference_details_hdmap, rootKey) + setPreferencesFromResource(R.xml.operate_panel_preference_details_demo, rootKey) + } + + override fun getDefaultVal(pref: Preference): Any? { + when (pref.key) { + KEY_DEMO_SWITCH -> { + return FunctionBuildConfig.isDemoMode + } + KEY_RECORD_BAG_DIALOG -> { + return FunctionBuildConfig.isShowBagRecordWindow + } + KEY_TAKE_OVER_WAKE -> { + return FunctionBuildConfig.isTakeoverRemind + } + } + return super.getDefaultVal(pref) + } + + override fun onPreferenceChange(preference: Preference, newValue: Any?): Boolean { + when (preference.key) { + KEY_DEMO_SWITCH -> { + val isChecked = newValue as? Boolean ?: false + hmiAction("SOP 演示模式开关, ", !FunctionBuildConfig.isDemoMode) + clickEventAnalytics("美化模式", isChecked) + FunctionBuildConfig.isDemoMode = !FunctionBuildConfig.isDemoMode + CallerAutoPilotControlManager.setDemoMode(FunctionBuildConfig.isDemoMode) + CallerHmiViewControlListenerManager.invokeFuncMode(FUNC_MODE_DEMO, FunctionBuildConfig.isDemoMode) + CallerSopSettingManager.invokeDemoModeListener(isChecked) + if (!FunctionBuildConfig.isDemoMode) { //关闭美化模式时,通知工控机 + CallerAutoPilotControlManager.setIPCDemoMode(FunctionBuildConfig.isDemoMode) + } + } + KEY_RECORD_BAG_DIALOG -> { + val isChecked = newValue as? Boolean ?: false + FunctionBuildConfig.isShowBagRecordWindow = isChecked + hmiAction("SOP 是否展示录包弹窗, ", isChecked) + clickEventAnalytics("录包弹窗", isChecked) + } + KEY_TAKE_OVER_WAKE -> { + val isChecked = newValue as? Boolean ?: false + FunctionBuildConfig.isTakeoverRemind = isChecked + hmiAction("SOP 是否展示接管提醒, ", isChecked) + clickEventAnalytics("接管提醒", isChecked) + } + } + return super.onPreferenceChange(preference, newValue) } } - class BusinessPreferenceFragmentCompat: PreferenceFragmentCompat() { + class HdMapPreferenceFragmentCompat : OperatePanelDetailBase() { + companion object { + private const val KEY_DANGER_OBSTACLES_COLOR_MARK = "danger_obstacles_color_mark" + private const val KEY_ROUTE_GUIDE_LINE_DYNAMIC_EFFECT = "route_guide_line_dynamic_effect" + private const val KEY_POINT_CLOUD_EFFECT = "point_cloud_effect" + private const val KEY_SELF_CAR_APERTURE = "self_car_aperture" + } + override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) { - Log.d(TAG, "BusinessPreferenceFragmentCompat --- onCreatePreferences ---") - setPreferencesFromResource(R.xml.operate_preference_details_business, rootKey) + setPreferencesFromResource(R.xml.operate_panel_preference_details_hdmap, rootKey) + } + + override fun getDefaultVal(pref: Preference): Any? { + when (pref.key) { + KEY_DANGER_OBSTACLES_COLOR_MARK -> { + return FunctionBuildConfig.isPNCWarning + } + KEY_POINT_CLOUD_EFFECT -> { + return FunctionBuildConfig.isDrawPointCloudData + } + KEY_ROUTE_GUIDE_LINE_DYNAMIC_EFFECT -> { + return HmiBuildConfig.isShowRouteStrategy + } + KEY_SELF_CAR_APERTURE -> { + return FunctionBuildConfig.isDrawPointCloudData || FunctionBuildConfig.isDisplayAnimEnable + } + } + return super.getDefaultVal(pref) + } + + override fun onPreferenceChange(preference: Preference, newValue: Any?): Boolean { + when (preference.key) { + KEY_DANGER_OBSTACLES_COLOR_MARK -> { + val isChecked = newValue as? Boolean ?: false + hmiAction("SOP 危险障碍物颜色标记开关, ", isChecked) + clickEventAnalytics("危险障碍物颜色标记", isChecked) + FunctionBuildConfig.isPNCWarning = isChecked + return true + } + KEY_ROUTE_GUIDE_LINE_DYNAMIC_EFFECT -> { + val isChecked = newValue as? Boolean ?: false + hmiAction("SOP 引导线动态效果, ", isChecked) + clickEventAnalytics("引导线动态效果", isChecked) + HmiBuildConfig.isShowRouteStrategy = isChecked + CallerDevaToolsManager.setRouteDynamicColorEnable(isChecked) + return true + } + KEY_POINT_CLOUD_EFFECT -> { + val isChecked = newValue as? Boolean + ?: false //打开点云效果时,如果自车光圈是关闭状态,则自动打开自车光圈(点云是跟随光圈的 默认没有光圈就不显示点云的) + if (isChecked && !FunctionBuildConfig.isDisplayAnimEnable) { + preferenceScreen.findPreferenceReal(KEY_SELF_CAR_APERTURE)?.also { changeValue(it, true) } + } else { + preferenceScreen.findPreferenceReal(KEY_SELF_CAR_APERTURE)?.also { changeValue(it, FunctionBuildConfig.isDisplayAnimEnable) } + } + CallerAutoPilotControlManager.setIsDrawPointCloud(isChecked) + FunctionBuildConfig.isDrawPointCloudData = isChecked + CallerMapUIServiceManager.getMapUIController()?.setIsDrawPointCloud(isChecked) + CallerSopSettingManager.invokePointCloudListener(isChecked) + hmiAction("SOP 是否渲染点云数据, ", isChecked) + clickEventAnalytics("点云效果", isChecked) + return true + } + KEY_SELF_CAR_APERTURE -> { + val isChecked = newValue as? Boolean ?: false + CallerMapUIServiceManager.getMapUIController()?.setDisplayAnimEnable(isChecked) + CallerSopSettingManager.invokeCarApertureListener(isChecked) + hmiAction("SOP 是否展示自车光圈,", isChecked) + FunctionBuildConfig.isDisplayAnimEnable = isChecked + clickEventAnalytics("自车光圈", isChecked) + return true + } + } + return super.onPreferenceChange(preference, newValue) } } - class MoFangPreferenceFragmentCompat: PreferenceFragmentCompat() { + class BusinessPreferenceFragmentCompat : OperatePanelDetailBase() { + + companion object { + private const val KEY_RED_OR_GREEN_LIGHT_MARKER = "red_or_green_light_marker" + private const val KEY_RED_OR_GREEN_LIGHT_MERGE_MARKER = "red_or_green_light_merge_marker" + private const val KEY_FAULT_REPORT_TIP = "fault_report_tip" + private const val KEY_LIMIT_SPEED_MARKER = "limit_speed_marker" + private const val KEY_SELF_ROUTING_VERIFY_MODE = "self_routing_verify_mode" + private const val KEY_LOOK_AROUND_360 = "look_around_360" + private const val KEY_WEATHER_EFFECT_SWITCH = "weather_effect_switch" + private const val KEY_SYSTEM_BOOT_STATUS_SHOW = "system_boot_status_show" + private const val KEY_UNMANNED_DEMO_PULL_INTERVAL = "unmanned_demo_pull_interval" + } + + override fun getDefaultVal(pref: Preference): Any? { + when (pref.key) { + KEY_RED_OR_GREEN_LIGHT_MARKER -> { + return HmiBuildConfig.isShowTrafficLightView + } + KEY_RED_OR_GREEN_LIGHT_MERGE_MARKER -> { + return HmiBuildConfig.isShowCarSourceTrafficLightView + } + KEY_FAULT_REPORT_TIP -> { + return FunctionBuildConfig.isReportWarning + } + KEY_LIMIT_SPEED_MARKER -> { + return HmiBuildConfig.isShowLimitingVelocityView + } + KEY_SELF_ROUTING_VERIFY_MODE -> { + return CallerHmiManager.isTaxiUnmanedDriverLineRoutingVerifyMode() + } + KEY_LOOK_AROUND_360 -> { + return CallerHmiManager.isM1360LookAroundShowing() + } + KEY_WEATHER_EFFECT_SWITCH -> { + return FunctionBuildConfig.weatherEffectSwitch + } + KEY_SYSTEM_BOOT_STATUS_SHOW -> { + return HmiBuildConfig.isShowConnectionProgressView + } + KEY_UNMANNED_DEMO_PULL_INTERVAL -> { + return CallerUnmannedListenerManager.getVirtualTaskPullTaskIntervalF() + } + } + return super.getDefaultVal(pref) + } + + override fun isEnabled(pref: Preference): Boolean { + return when (pref.key) { + KEY_SELF_ROUTING_VERIFY_MODE -> { + AppIdentityModeUtils.isTaxiDriver(FunctionBuildConfig.appIdentityMode) + } + KEY_LOOK_AROUND_360 -> { + AppIdentityModeUtils.isM1(FunctionBuildConfig.appIdentityMode) + } + KEY_WEATHER_EFFECT_SWITCH -> { + AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode) + } + else -> super.isEnabled(pref) + } + } + + override fun onPreferenceClick(preference: Preference): Boolean { + if (preference.key == KEY_UNMANNED_DEMO_PULL_INTERVAL) { + val interval = PreferenceWithUnmanInterval.Interval.values().find { it.ordinal == preference.extras.getInt(PreferenceWithUnmanInterval.KEY_BUNDLE_CURRENT_INTERVAL) } + Log.d(TAG, "业务类->onPreferenceClick: $interval") + if (interval != null) { + when (interval) { + PreferenceWithUnmanInterval.Interval.FIVE_SECOND -> CallerUnmannedListenerManager.dispatchVirtualTaskPullTaskInterval(5) + PreferenceWithUnmanInterval.Interval.FIFTEEN_SECOND -> CallerUnmannedListenerManager.dispatchVirtualTaskPullTaskInterval(15) + PreferenceWithUnmanInterval.Interval.THIRTY_SECOND -> CallerUnmannedListenerManager.dispatchVirtualTaskPullTaskInterval(30) + PreferenceWithUnmanInterval.Interval.FORTY_FIVE_SECOND -> CallerUnmannedListenerManager.dispatchVirtualTaskPullTaskInterval(45) + PreferenceWithUnmanInterval.Interval.NEVER -> CallerUnmannedListenerManager.dispatchVirtualTaskPullTaskInterval(-1) + } + clickEventAnalytics("Taxi无人化演练任务拉取时间间隔",true) + } + } + return super.onPreferenceClick(preference) + } + + override fun onPreferenceChange(preference: Preference, newValue: Any?): Boolean { + when (preference.key) { + KEY_RED_OR_GREEN_LIGHT_MARKER -> { + val isChecked = newValue as? Boolean ?: false + hmiAction("SOP 红绿灯标识开关, ", isChecked) + clickEventAnalytics("红绿灯标识", isChecked) + if (isChecked) { + CallerHmiManager.showTrafficLightView() + } else { + CallerHmiManager.hideTrafficLightView() + } + return true + } + KEY_RED_OR_GREEN_LIGHT_MERGE_MARKER -> { + val isChecked = newValue as? Boolean ?: false + hmiAction("SOP 红绿灯车端来源标识开关, ", isChecked) + clickEventAnalytics("红绿灯车端融合标识", isChecked) + HmiBuildConfig.isShowCarSourceTrafficLightView = isChecked + return true + } + KEY_FAULT_REPORT_TIP -> { + val isChecked = newValue as? Boolean ?: false + hmiAction("SOP 是否开启异常上报, ", isChecked) + clickEventAnalytics("异常上报提示", isChecked) + FunctionBuildConfig.isReportWarning = isChecked + return true + } + KEY_LIMIT_SPEED_MARKER -> { + val isChecked = newValue as? Boolean ?: false + hmiAction("SOP 限速标识开关, ", isChecked) + clickEventAnalytics("限速标识", isChecked) + if (isChecked) { + HmiBuildConfig.isShowLimitingVelocityView = true + CallerHmiViewControlListenerManager.invokeVisible(IViewControlListener.LimitingVelocityView_TAG, View.VISIBLE) + } else { + HmiBuildConfig.isShowLimitingVelocityView = false + CallerHmiViewControlListenerManager.invokeVisible(IViewControlListener.LimitingVelocityView_TAG, View.GONE) + } + return true + } + KEY_SELF_ROUTING_VERIFY_MODE -> { + val isChecked = newValue as? Boolean ?: false + if (isChecked) { + if (CallerHmiManager.isTaxiUnmanedDriverPerformTask()) { + ToastUtils.showLong("请先结束当前任务") + preferenceScreen.findPreferenceReal(KEY_SELF_ROUTING_VERIFY_MODE)?.also { changeValue(it, false) } + return true + } + if (CallerHmiManager.isTaxiUnmanedDriverTakingOrders()) { + ToastUtils.showLong("请先结束接单状态") + preferenceScreen.findPreferenceReal(KEY_SELF_ROUTING_VERIFY_MODE)?.also { changeValue(it, false) } + return true + } + CallerHmiManager.setTaxiUnmanedDriverLineRoutingVerifyMode(true) + } else { + if (CallerHmiManager.isTaxiUnmanedDriverLineRoutingPerformTask()) { + ToastUtils.showLong("请先结束当前任务") + preferenceScreen.findPreferenceReal(KEY_SELF_ROUTING_VERIFY_MODE)?.also { changeValue(it, true) } + return true + } + CallerHmiManager.setTaxiUnmanedDriverLineRoutingVerifyMode(false) + } + clickEventAnalytics("自主算路验证模式", isChecked) + return true + } + KEY_LOOK_AROUND_360 -> { + val isChecked = newValue as? Boolean ?: false + if (isChecked) { + CallerHmiManager.showM1360LookAround() + } else { + CallerHmiManager.hidM1360LookAround() + } + clickEventAnalytics("360环视", isChecked) + return true + } + KEY_WEATHER_EFFECT_SWITCH -> { + val isChecked = newValue as? Boolean ?: false + FunctionBuildConfig.weatherEffectSwitch = isChecked + CallerLogger.d(TAG, "发送开关数据:${isChecked}到乘客屏") + CallerTelematicManager.sendMsgToAllClients(TelematicConstant.WEATHER_SWITCH_STATUS, (if (isChecked) "1" else "0").toByteArray()) + clickEventAnalytics("天气效果开关", isChecked) + } + KEY_SYSTEM_BOOT_STATUS_SHOW -> { + val isChecked = newValue as? Boolean ?: false + hmiAction("SOP 系统启动状态展示, ", isChecked) + clickEventAnalytics("系统启动状态展示", isChecked) + HmiBuildConfig.isShowConnectionProgressView = isChecked + CallerHmiViewControlListenerManager.updateConnectionProgressView(isChecked) + } + } + return super.onPreferenceChange(preference, newValue) + } + override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) { - Log.d(TAG, "MoFangPreferenceFragmentCompat --- onCreatePreferences ---") - setPreferencesFromResource(R.xml.operate_preference_details_mofang, rootKey) + setPreferencesFromResource(R.xml.operate_panel_preference_details_business, rootKey) } } - class VehiclesPreferenceFragmentCompat: PreferenceFragmentCompat() { - override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) { - Log.d(TAG, "VehiclesPreferenceFragmentCompat --- onCreatePreferences ---") - setPreferencesFromResource(R.xml.operate_preference_details_vehicles, rootKey) + class MoFangPreferenceFragmentCompat : OperatePanelDetailBase(), IMoGoMoFangProvider.OnMoFangStatusListener { + + companion object { + private const val TAG = "MoFangPreferenceFragmentCompat" + private const val KEY_MOFANG_CONNECT = "mofang_connect" + private const val KEY_MOFANG_COMMAND_TEST = "mofang_command_test" } + + override fun onViewCreated(view: View, savedInstanceState: Bundle?) { + super.onViewCreated(view, savedInstanceState) + CallerDevaToolsManager.mofang()?.registerMoFangStatusListener(TAG, this) + } + + override fun onDestroyView() { + super.onDestroyView() + CallerDevaToolsManager.mofang()?.unRegisterMoFangStatusListener(this) + } + + override fun onMoFangConnected() { + preferenceScreen.findPreferenceReal(KEY_MOFANG_CONNECT)?.updateStatus(PreferenceWithMoFang.MoFangConnectStatus.CONNECTED) + } + + override fun onMoFangDisconnected() { + preferenceScreen.findPreferenceReal(KEY_MOFANG_CONNECT)?.updateStatus(PreferenceWithMoFang.MoFangConnectStatus.CONNECT_START) + } + + override fun onPreferenceClick(preference: Preference): Boolean { + Log.d(TAG, "mofang -> onPreferenceClick -> $preference") + when (preference.key) { + KEY_MOFANG_CONNECT -> { + val status = PreferenceWithMoFang.MoFangConnectStatus.values().find { it.ordinal == preference.extras.getInt(PreferenceWithMoFang.KEY_CURRENT_CONNECT_STATUS) } + when (status) { + PreferenceWithMoFang.MoFangConnectStatus.CONNECT_START -> { + CallerDevaToolsManager.mofang()?.connect() + } + PreferenceWithMoFang.MoFangConnectStatus.CONNECTED -> { + CallerDevaToolsManager.mofang()?.disconnect() + } + else -> { + Log.d(TAG, "-- onPreferenceClick else --:pref -> $preference") + } + } + return true + } + } + return super.onPreferenceClick(preference) + } + + override fun getDefaultVal(pref: Preference): Any? { + if (pref.key == KEY_MOFANG_CONNECT) { + val provider = CallerDevaToolsManager.mofang() + if (provider != null) { + return if (provider.isConnected()) { + PreferenceWithMoFang.MoFangConnectStatus.CONNECTED.ordinal + } else { + PreferenceWithMoFang.MoFangConnectStatus.CONNECT_START.ordinal + } + } + } else if (pref.key == KEY_MOFANG_COMMAND_TEST) { + return CallerDevaToolsManager.mofang()?.isEnableTest() ?: false + } + return super.getDefaultVal(pref) + } + + override fun onPreferenceChange(preference: Preference, newValue: Any?): Boolean { + if (preference.key == KEY_MOFANG_COMMAND_TEST) { + val isChecked = newValue as? Boolean ?: false + CallerDevaToolsManager.mofang()?.enableTest(isChecked) + return true + } + return super.onPreferenceChange(preference, newValue) + } + + override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) { + setPreferencesFromResource(R.xml.operate_panel_preference_details_mofang, rootKey) + } + } + + class VehiclesPreferenceFragmentCompat : OperatePanelDetailBase() { + companion object { + private const val KEY_PNC_PARK_INTERSECTION_CAR = "pnc_park_intersection_car" + private const val KEY_PNC_PARK_OVERTAKE_CAR = "pnc_park_overtake_car" + private const val KEY_DETOUR_RETARD_PARK = "detour_retard_park" + private const val KEY_RAIN_DAY = "rain_day" + private const val KEY_FAULT_DECELERATION_PARK = "fault_deceleration_park" + private const val KEY_WEAK_NET_DECELERATION_PARK = "weak_net_deceleration_park" + private const val KEY_EXAM_FUNCTION_PANEL = "exam_function_panel" + private const val KEY_ALL_MERGE_MODE = "all_merge_mode" + private const val KEY_BLIND_AREA_MODE = "blind_area_mode" + private const val KEY_BEYOND_VISUAL_RANGE_MODE = "beyond_visual_range_mode" + private const val KEY_TRANSPARENT_TRANSFER_MODE = "transparent_transfer_mode" + private const val KEY_PURE_OBU_MODE = "pure_obu_mode" + private const val KEY_AUTO_PILOT_SPEED_THRESHOLDS = "auto_pilot_speed_thresholds" + private const val KEY_CHANGE_LANE_SPEED_THRESHOLDS = "change_lane_speed_thresholds" + private const val KEY_OVERTAKE_SPEED_THRESHOLDSS = "overtake_speed_thresholds" + } + + override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) { + setPreferencesFromResource(R.xml.operate_panel_preference_details_vehicles, rootKey) + } + + override fun isEnabled(pref: Preference): Boolean { + when (pref.key) { + KEY_AUTO_PILOT_SPEED_THRESHOLDS, KEY_OVERTAKE_SPEED_THRESHOLDSS -> { + return !AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode) + } + } + return super.isEnabled(pref) + } + + override fun getDefaultVal(pref: Preference): Any? { + when (pref.key) { + KEY_PNC_PARK_INTERSECTION_CAR -> { + return FunctionBuildConfig.isOpenParkVehCross + } + KEY_PNC_PARK_OVERTAKE_CAR -> { + return FunctionBuildConfig.isOpenOvertake + } + KEY_DETOUR_RETARD_PARK -> { + return FunctionBuildConfig.isDetouring + } + KEY_RAIN_DAY -> { + return FunctionBuildConfig.isRainMode + } + KEY_WEAK_NET_DECELERATION_PARK -> { + return FunctionBuildConfig.isWeakNetSlowDown + } + KEY_FAULT_DECELERATION_PARK -> { + return FunctionBuildConfig.isFaultSlowDown + } + KEY_ALL_MERGE_MODE -> { + return FunctionBuildConfig.fusionMode == 1 + } + KEY_BLIND_AREA_MODE -> { + return FunctionBuildConfig.fusionMode == 2 + } + KEY_BEYOND_VISUAL_RANGE_MODE -> { + return FunctionBuildConfig.fusionMode == 3 + } + KEY_TRANSPARENT_TRANSFER_MODE -> { + return FunctionBuildConfig.fusionMode == 4 + } + KEY_PURE_OBU_MODE -> { + return FunctionBuildConfig.fusionMode == 5 + } + KEY_CHANGE_LANE_SPEED_THRESHOLDS -> { + return setOf("3.0", "7.0", "${FunctionBuildConfig.detouringSpeed}", "0.5") + } + KEY_OVERTAKE_SPEED_THRESHOLDSS -> { + return setOf("3.0", "12.5", "${FunctionBuildConfig.overTakeSpeed}", "0.5") + } + KEY_AUTO_PILOT_SPEED_THRESHOLDS -> { //TODO renwj 自动驾驶速度阈值,旧版本没有看到 + } + } + return super.getDefaultVal(pref) + } + + override fun onPreferenceClick(preference: Preference): Boolean { + Log.d(TAG, "-- onPreferenceClick --:pref -> $preference") + when (preference.key) { + KEY_AUTO_PILOT_SPEED_THRESHOLDS -> { + FunctionBuildConfig.detouringSpeed = preference.extras.getFloat(PreferenceWithSpeedSetting.KEY_BUNDLE_CURRENT_VALUE, FunctionBuildConfig.detouringSpeed.toFloat()).toInt() + hmiAction("SOP 变道绕障的目标障碍物速度阈值", FunctionBuildConfig.detouringSpeed) + val isSuccess = CallerAutoPilotControlManager.sendDetouringSpeed(FunctionBuildConfig.detouringSpeed.toDouble()) + if (isSuccess == true) { + ToastUtils.showShort("变道绕障的目标障碍物速度阈值设置成功") + hmiAction("SOP 变道绕障的目标障碍物速度阈值设置", "成功") + } else { + ToastUtils.showShort("变道绕障的目标障碍物速度阈值设置失败") + hmiAction("SOP 变道绕障的目标障碍物速度阈值设置", "失败") + } + clickEventAnalytics("变道速度阈值", true) + } + KEY_OVERTAKE_SPEED_THRESHOLDSS -> { + FunctionBuildConfig.overTakeSpeed = preference.extras.getFloat(PreferenceWithSpeedSetting.KEY_BUNDLE_CURRENT_VALUE, FunctionBuildConfig.overTakeSpeed) + val isSuccess = CallerAutoPilotControlManager.sendOvertakeMaxSpeed(FunctionBuildConfig.overTakeSpeed.toDouble()) + if (isSuccess == true) { + ToastUtils.showShort("SOP 超车目标障碍物速度阈值设置成功") + hmiAction("SOP 超车目标障碍物速度阈值设置", "成功") + } else { + ToastUtils.showShort("SOP 超车目标障碍物速度阈值设置失败") + hmiAction("SOP 超车目标障碍物速度阈值设置", "失败") + } + clickEventAnalytics("超车速度阈值", true) + } + } + return super.onPreferenceClick(preference) + } + + override fun onPreferenceChange(preference: Preference, newValue: Any?): Boolean { + when (preference.key) { + KEY_PNC_PARK_INTERSECTION_CAR -> { + val isChecked = newValue as? Boolean ?: false + hmiAction("SOP PNC-park-会车, ", isChecked) + CallerAutoPilotControlManager.sendParkVehCross(isChecked) + FunctionBuildConfig.isOpenParkVehCross = isChecked + } + KEY_PNC_PARK_OVERTAKE_CAR -> { + val isChecked = newValue as? Boolean ?: false + hmiAction("SOP PNC-park-超车, ", isChecked) + CallerAutoPilotControlManager.sendParkVehOvertake(isChecked) + FunctionBuildConfig.isOpenOvertake = isChecked + } + KEY_DETOUR_RETARD_PARK -> { + val isChecked = newValue as? Boolean ?: false + hmiAction("SOP 绕障类功能开关, ", isChecked) + CallerAutoPilotControlManager.sendDetouring(isChecked) + FunctionBuildConfig.isDetouring = isChecked + clickEventAnalytics("绕障类功能", isChecked) + } + KEY_RAIN_DAY -> { + val isChecked = newValue as? Boolean ?: false + hmiAction("SOP 雨天模式开关, ", isChecked) + clickEventAnalytics("雨天模式", isChecked) + FunctionBuildConfig.isRainMode = isChecked + CallerAutoPilotControlManager.setRainMode(isChecked) + CallerHmiViewControlListenerManager.invokeFuncMode(FUNC_MODE_RAIN, isChecked) + CallerSopSettingManager.invokeRainModeListener(isChecked) + } + KEY_WEAK_NET_DECELERATION_PARK -> { + val isChecked = newValue as? Boolean ?: false + FunctionBuildConfig.isWeakNetSlowDown = isChecked + CallerAutoPilotControlManager.sendWeakNetSlowDown(isChecked) + hmiAction("SOP 弱网减速停车, ", isChecked) + clickEventAnalytics("弱网减速停车", isChecked) + } + KEY_FAULT_DECELERATION_PARK -> { + val isChecked = newValue as? Boolean ?: false + FunctionBuildConfig.isFaultSlowDown = isChecked + CallerAutoPilotControlManager.sendBreakdownSlowDown(isChecked) + hmiAction("SOP 故障减速停车, ", isChecked) + clickEventAnalytics("故障减速停车", isChecked) + } + KEY_EXAM_FUNCTION_PANEL -> { + val isChecked = newValue as? Boolean ?: false + FunctionBuildConfig.isShowExamWindow = isChecked + CallerDevaToolsManager.showExamControlWindow(isChecked) + hmiAction("SOP 考试功能面板, ", isChecked) + clickEventAnalytics("考试功能面板", isChecked) + } + KEY_ALL_MERGE_MODE -> { + FunctionBuildConfig.fusionMode = 1 + hmiAction("SOP 融合模式, ", FunctionBuildConfig.fusionMode) + clickEventAnalytics("融合模式", true) + CallerAutoPilotControlManager.sendFusionMode(FunctionBuildConfig.fusionMode) + } + KEY_BLIND_AREA_MODE -> { + FunctionBuildConfig.fusionMode = 2 + hmiAction("SOP 融合模式, ", FunctionBuildConfig.fusionMode) + clickEventAnalytics("融合模式", true) + CallerAutoPilotControlManager.sendFusionMode(FunctionBuildConfig.fusionMode) + } + KEY_BEYOND_VISUAL_RANGE_MODE -> { + FunctionBuildConfig.fusionMode = 3 + hmiAction("SOP 融合模式, ", FunctionBuildConfig.fusionMode) + clickEventAnalytics("融合模式", true) + CallerAutoPilotControlManager.sendFusionMode(FunctionBuildConfig.fusionMode) + } + KEY_TRANSPARENT_TRANSFER_MODE -> { + FunctionBuildConfig.fusionMode = 4 + hmiAction("SOP 融合模式, ", FunctionBuildConfig.fusionMode) + clickEventAnalytics("融合模式", true) + CallerAutoPilotControlManager.sendFusionMode(FunctionBuildConfig.fusionMode) + } + KEY_PURE_OBU_MODE -> { + FunctionBuildConfig.fusionMode = 5 + hmiAction("SOP 融合模式, ", FunctionBuildConfig.fusionMode) + clickEventAnalytics("融合模式", true) + CallerAutoPilotControlManager.sendFusionMode(FunctionBuildConfig.fusionMode) + } + } + return super.onPreferenceChange(preference, newValue) + } + } + + class WelcomeWordsPreferenceCompat : OperatePanelDetailBase() { + + + companion object { + private const val KEY_WELCOME_WORDS = "welcome_words" + } + + override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) { + setPreferencesFromResource(R.xml.operate_panel_preference_details_welcome_words, rootKey) + } + + override fun getDefaultVal(pref: Preference): Any? { + if (pref.key == KEY_WELCOME_WORDS) { + return FunctionBuildConfig.welcomeWords + } + return super.getDefaultVal(pref) + } + + override fun onPreferenceClick(preference: Preference): Boolean { + if (preference.key == KEY_WELCOME_WORDS) { + FunctionBuildConfig.welcomeWords = preference.extras.getString(PreferenceWithWelcomeWords.KEY_BUNDLE_CURRENT_EDIT_TEXT_VALUE) + hmiAction("外屏欢迎语", FunctionBuildConfig.welcomeWords ?: "") + clickEventAnalytics("外屏欢迎语", true) + } + return super.onPreferenceClick(preference) + } + } constructor(context: Context) : this(context, null) constructor(context: Context, attrs: AttributeSet?) : this(context, attrs, 0) constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int) : super(context, attrs, defStyleAttr) { orientation = VERTICAL - Log.d(TAG, "--- init ----") LayoutInflater.from(context).inflate(R.layout.layout_operate_panel, this, true) background = ContextCompat.getDrawable(context, R.drawable.bg_operate_panel) iv_operate_panel_close?.onClick { CallerHmiManager.toggleOperatePanel(false) } - } - - override fun onAttachedToWindow() { - super.onAttachedToWindow() - Log.d(TAG, "--- onAttachedToWindow ---") - } - - override fun onDetachedFromWindow() { - super.onDetachedFromWindow() - Log.d(TAG, "--- onDetachedFromWindow ---") + isClickable = true } } \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/operate/preferences/PreferenceWithMoFang.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/operate/preferences/PreferenceWithMoFang.kt new file mode 100644 index 0000000000..9c8cc6b8e2 --- /dev/null +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/operate/preferences/PreferenceWithMoFang.kt @@ -0,0 +1,69 @@ +package com.mogo.eagle.core.function.hmi.ui.operate.preferences + +import android.content.Context +import android.util.AttributeSet +import androidx.core.content.ContextCompat +import androidx.preference.Preference +import androidx.preference.PreferenceViewHolder +import com.mogo.eagle.core.function.hmi.R +import com.mogo.eagle.core.utilcode.kotlin.onClick + +class PreferenceWithMoFang: Preference { + + constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int, defStyleRes: Int) : super(context, attrs, defStyleAttr, defStyleRes) + constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int) : super(context, attrs, defStyleAttr) + constructor(context: Context, attrs: AttributeSet?) : super(context, attrs) + constructor(context: Context) : super(context) + + companion object { + const val KEY_CURRENT_CONNECT_STATUS = "key_mofang_connect_status" + } + + enum class MoFangConnectStatus { + CONNECT_START, + CONNECTED, + CONNECTING + } + + private var status: MoFangConnectStatus? = null + + override fun setDefaultValue(defaultValue: Any?) { + super.setDefaultValue(defaultValue) + status = MoFangConnectStatus.values().find { it.ordinal == defaultValue } + notifyChanged() + } + + fun updateStatus(status: MoFangConnectStatus) { + this.status = status + notifyChanged() + } + + override fun onBindViewHolder(holder: PreferenceViewHolder) { + super.onBindViewHolder(holder) + val stats = this.status ?: return + val btConnect = holder.findViewById(R.id.bt_mofang) + btConnect.setOnClickListener(null) + when(stats) { + MoFangConnectStatus.CONNECT_START -> { + btConnect.isEnabled = true + btConnect.background = ContextCompat.getDrawable(holder.itemView.context, R.drawable.icon_operate_panel_mofang_connect_start) + btConnect.onClick { + extras.putInt(KEY_CURRENT_CONNECT_STATUS, stats.ordinal) + onPreferenceClickListener?.onPreferenceClick(this) + } + } + MoFangConnectStatus.CONNECTED -> { + btConnect.isEnabled = true + btConnect.background = ContextCompat.getDrawable(holder.itemView.context, R.drawable.icon_operate_panel_mofang_disconnect) + btConnect.onClick { + extras.putInt(KEY_CURRENT_CONNECT_STATUS, stats.ordinal) + onPreferenceClickListener?.onPreferenceClick(this) + } + } + MoFangConnectStatus.CONNECTING -> { + btConnect.isEnabled = false + btConnect.background = ContextCompat.getDrawable(holder.itemView.context, R.drawable.icon_operate_panel_mofang_connect_doing) + } + } + } +} \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/operate/preferences/PreferenceWithSpeedSetting.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/operate/preferences/PreferenceWithSpeedSetting.kt new file mode 100644 index 0000000000..aa5d4c529d --- /dev/null +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/operate/preferences/PreferenceWithSpeedSetting.kt @@ -0,0 +1,95 @@ +package com.mogo.eagle.core.function.hmi.ui.operate.preferences + +import android.content.Context +import android.util.AttributeSet +import android.widget.TextView +import androidx.preference.Preference +import androidx.preference.PreferenceViewHolder +import com.mogo.eagle.core.function.hmi.R +import com.mogo.eagle.core.utilcode.kotlin.onClick +import com.mogo.eagle.core.utilcode.util.ToastUtils +import kotlin.math.max + +class PreferenceWithSpeedSetting : Preference { + + companion object { + const val KEY_BUNDLE_CURRENT_VALUE = "key_bundle_current_val" + } + + constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int, defStyleRes: Int) : super(context, attrs, defStyleAttr, defStyleRes) + constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int) : super(context, attrs, defStyleAttr) + constructor(context: Context, attrs: AttributeSet?) : super(context, attrs) + constructor(context: Context) : super(context) + + private var mDefaultValueSet: Any? = null + + override fun setDefaultValue(defaultValue: Any?) { + super.setDefaultValue(defaultValue) + mDefaultValueSet = defaultValue + notifyChanged() + } + + override fun onBindViewHolder(holder: PreferenceViewHolder) { + super.onBindViewHolder(holder) + val defaultSet = mDefaultValueSet ?: return + if (defaultSet !is Set<*> || defaultSet.size != 4) { + throw AssertionError() + } + val min = (defaultSet.elementAt(0) as String).toFloat() + val max = (defaultSet.elementAt(1) as String).toFloat() + var cur = (defaultSet.elementAt(2) as String).toFloat() + val step = (defaultSet.elementAt(3) as String).toFloat() + if (min > max) { + throw AssertionError() + } + if (min > cur) { + throw AssertionError() + } + if (cur > max) { + throw AssertionError() + } + val ll = holder.findViewById(R.id.ll_speed) + val btnOk = holder.findViewById(R.id.bt_ok) + val speedLimit = holder.findViewById(R.id.tv_speed_limit) as? TextView + if (speedLimit?.tag != null && speedLimit.tag is Float) { + cur = max(cur, speedLimit.tag as Float) + } + speedLimit?.text = cur.toString() + val minus = holder.findViewById(R.id.iv_speed_minus) + minus.setOnClickListener(null) + minus.onClick { + val minusAfter = cur - step + if (minusAfter < min) { + ToastUtils.showShort("阈值最小可为${min}m/s") + return@onClick + } + cur = minusAfter + btnOk.isEnabled = true + ll.isSelected = true + speedLimit?.tag = minusAfter + speedLimit?.text = minusAfter.toString() + } + val add = holder.findViewById(R.id.iv_speed_add) + add.setOnClickListener(null) + add.onClick { + val addAfter = cur + step + if (addAfter > max) { + ToastUtils.showShort("阈值最大可为${max}m/s") + return@onClick + } + cur = addAfter + ll.isSelected = true + btnOk.isEnabled = true + speedLimit?.tag = addAfter + speedLimit?.text = addAfter.toString() + } + btnOk.isEnabled = false + btnOk.setOnClickListener(null) + btnOk.onClick { + onPreferenceClickListener?.also { + extras.putFloat(KEY_BUNDLE_CURRENT_VALUE, cur) + it.onPreferenceClick(this) + } + } + } +} \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/operate/preferences/PreferenceWithUnmanInterval.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/operate/preferences/PreferenceWithUnmanInterval.kt new file mode 100644 index 0000000000..70672af2b0 --- /dev/null +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/operate/preferences/PreferenceWithUnmanInterval.kt @@ -0,0 +1,103 @@ +package com.mogo.eagle.core.function.hmi.ui.operate.preferences + +import android.content.Context +import android.util.AttributeSet +import android.util.Log +import android.widget.CompoundButton +import android.widget.RadioButton +import android.widget.RadioGroup +import androidx.preference.Preference +import androidx.preference.PreferenceViewHolder +import com.mogo.eagle.core.function.hmi.R + +class PreferenceWithUnmanInterval: Preference, RadioGroup.OnCheckedChangeListener { + + companion object { + const val KEY_BUNDLE_CURRENT_INTERVAL = "key_bundle_unman_interval" + private const val TAG = "PreferenceWithUnmanInterval" + } + + constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int, defStyleRes: Int) : super(context, attrs, defStyleAttr, defStyleRes) + constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int) : super(context, attrs, defStyleAttr) + constructor(context: Context, attrs: AttributeSet?) : super(context, attrs) + constructor(context: Context) : super(context) + + enum class Interval { + FIVE_SECOND, + FIFTEEN_SECOND, + THIRTY_SECOND, + FORTY_FIVE_SECOND, + NEVER + } + + + private var interval: Interval? = null + + override fun setDefaultValue(defaultValue: Any?) { + super.setDefaultValue(defaultValue) + Log.d(TAG, "--- setDefaultValue 1 ---:defaultValue -> $defaultValue") + if (defaultValue is Int) { + interval = when(defaultValue) { + 5 -> Interval.FIVE_SECOND + 15 -> Interval.FIFTEEN_SECOND + 30 -> Interval.THIRTY_SECOND + 45 -> Interval.FORTY_FIVE_SECOND + else -> Interval.NEVER + } + } + } + + override fun onBindViewHolder(holder: PreferenceViewHolder) { + super.onBindViewHolder(holder) + Log.d(TAG, "--- onBindViewHolder 1 ---:interval -> $interval") + val temp = interval?: return + Log.d(TAG, "--- onBindViewHolder 2 --- ") + val five = holder.findViewById(R.id.rb_5s) as? RadioButton + val fifteen = holder.findViewById(R.id.rb_15s) as? RadioButton + val thirty = holder.findViewById(R.id.rb_30s) as? RadioButton + val forty_five = holder.findViewById(R.id.rb_45s) as? RadioButton + val never = holder.findViewById(R.id.rb_never) as? RadioButton + when(temp) { + Interval.FIVE_SECOND -> five?.isChecked = true + Interval.FIFTEEN_SECOND -> fifteen?.isChecked = true + Interval.THIRTY_SECOND -> thirty?.isChecked = true + Interval.FORTY_FIVE_SECOND -> forty_five?.isChecked = true + Interval.NEVER -> never?.isChecked = true + } + + (holder.findViewById(R.id.rg_root) as? RadioGroup)?.also { + it.setOnCheckedChangeListener(this) + } + } + + override fun onCheckedChanged(group: RadioGroup?, checkedId: Int) { + Log.d(TAG, "--- onCheckedChanged --- ") + when(checkedId) { + R.id.rb_5s -> { + Log.d(TAG, "--- onCheckedChanged 5s--- ") + extras.putInt(KEY_BUNDLE_CURRENT_INTERVAL, Interval.FIVE_SECOND.ordinal) + onPreferenceClickListener?.onPreferenceClick(this) + } + R.id.rb_15s -> { + Log.d(TAG, "--- onCheckedChanged 15s--- ") + extras.putInt(KEY_BUNDLE_CURRENT_INTERVAL, Interval.FIFTEEN_SECOND.ordinal) + onPreferenceClickListener?.onPreferenceClick(this) + } + R.id.rb_30s -> { + Log.d(TAG, "--- onCheckedChanged 30s--- ") + extras.putInt(KEY_BUNDLE_CURRENT_INTERVAL, Interval.THIRTY_SECOND.ordinal) + onPreferenceClickListener?.onPreferenceClick(this) + } + R.id.rb_45s -> { + Log.d(TAG, "--- onCheckedChanged 45s--- ") + extras.putInt(KEY_BUNDLE_CURRENT_INTERVAL, Interval.FORTY_FIVE_SECOND.ordinal) + onPreferenceClickListener?.onPreferenceClick(this) + } + R.id.rb_never -> { + Log.d(TAG, "--- onCheckedChanged never--- ") + extras.putInt(KEY_BUNDLE_CURRENT_INTERVAL, Interval.NEVER.ordinal) + onPreferenceClickListener?.onPreferenceClick(this) + } + } + } +} \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/operate/preferences/PreferenceWithWelcomeWords.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/operate/preferences/PreferenceWithWelcomeWords.kt new file mode 100644 index 0000000000..cb6cd99e79 --- /dev/null +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/operate/preferences/PreferenceWithWelcomeWords.kt @@ -0,0 +1,56 @@ +package com.mogo.eagle.core.function.hmi.ui.operate.preferences + +import android.content.Context +import android.text.TextUtils +import android.util.AttributeSet +import android.widget.EditText +import androidx.core.widget.doOnTextChanged +import androidx.preference.Preference +import androidx.preference.PreferenceViewHolder +import com.mogo.eagle.core.function.hmi.R +import com.mogo.eagle.core.utilcode.kotlin.onClick + +class PreferenceWithWelcomeWords: Preference { + + companion object { + const val KEY_BUNDLE_CURRENT_EDIT_TEXT_VALUE = "key_bundle_current_edit_text" + } + + constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int, defStyleRes: Int) : super(context, attrs, defStyleAttr, defStyleRes) + constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int) : super(context, attrs, defStyleAttr) + constructor(context: Context, attrs: AttributeSet?) : super(context, attrs) + constructor(context: Context) : super(context) + + + private var mCurrentWelcomeWords: String? = null + + override fun setDefaultValue(defaultValue: Any?) { + super.setDefaultValue(defaultValue) + if (defaultValue is String) { + mCurrentWelcomeWords = defaultValue + notifyChanged() + } + } + + override fun onBindViewHolder(holder: PreferenceViewHolder) { + super.onBindViewHolder(holder) + val currentWelcomeWords = mCurrentWelcomeWords + val et = holder.findViewById(R.id.et_welcome_words) as? EditText + val btn_ok = holder.findViewById(R.id.bt_ok) + btn_ok.isEnabled = false + et?.doOnTextChanged { text, _, _, _ -> + if (!TextUtils.isEmpty(text)) { + btn_ok?.isEnabled = true + } else { + btn_ok?.isEnabled = false + } + } + if (!TextUtils.isEmpty(currentWelcomeWords)) { + et?.setText(currentWelcomeWords) + } + btn_ok.onClick { + extras.putString(KEY_BUNDLE_CURRENT_EDIT_TEXT_VALUE, et?.text.toString()) + onPreferenceClickListener?.onPreferenceClick(this) + } + } +} \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/SOPSettingView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/SOPSettingView.kt index c5acc363ee..d131746232 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/SOPSettingView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/SOPSettingView.kt @@ -143,21 +143,21 @@ internal class SOPSettingView @JvmOverloads constructor( */ private fun v2xSetting() { //V2X总开关 - scV2XSwitch.isChecked = FunctionBuildConfig.v2xMainSwitch + scV2XSwitch.isChecked = FunctionBuildConfig.v2xTotalSwitch scV2XSwitch.setOnCheckedChangeListener { _, isChecked -> - FunctionBuildConfig.v2xMainSwitch = isChecked + FunctionBuildConfig.v2xTotalSwitch = isChecked hmiAction("SOP V2X总开关, ", isChecked) clickEventAnalytics("V2X总开关",isChecked) if (isChecked) { //V2N总开关 - scV2NSwitch.isChecked = FunctionBuildConfig.v2nMainSwitch - hmiAction("SOP V2N总开关, ", FunctionBuildConfig.v2nMainSwitch) + scV2NSwitch.isChecked = FunctionBuildConfig.v2nTotalSwitch + hmiAction("SOP V2N总开关, ", FunctionBuildConfig.v2nTotalSwitch) //V2I总开关 - scV2ISwitch.isChecked = HmiBuildConfig.isShowObuV2iView - hmiAction("SOP V2I总开关, ", HmiBuildConfig.isShowObuV2iView) + scV2ISwitch.isChecked = HmiBuildConfig.v2iTotalSwitch + hmiAction("SOP V2I总开关, ", HmiBuildConfig.v2iTotalSwitch) //V2V总开关 - scObuV2vView.isChecked = HmiBuildConfig.isShowObuV2vView - hmiAction("SOP V2V总开关, ", HmiBuildConfig.isShowObuV2vView) + scObuV2vView.isChecked = HmiBuildConfig.v2vTotalSwitch + hmiAction("SOP V2V总开关, ", HmiBuildConfig.v2vTotalSwitch) //obu总开关 scObu.isChecked = obuConnectStatus hmiAction("SOP obu总开关, ", obuConnectStatus) @@ -187,24 +187,24 @@ internal class SOPSettingView @JvmOverloads constructor( } //V2N总开关 - scV2NSwitch.isChecked = FunctionBuildConfig.v2nMainSwitch + scV2NSwitch.isChecked = FunctionBuildConfig.v2nTotalSwitch //根据V2N状态设置子开关是否可以点击 //V2N新链路 - scNewV2NData.isEnabled = FunctionBuildConfig.v2nMainSwitch + scNewV2NData.isEnabled = FunctionBuildConfig.v2nTotalSwitch //V2N场景进PNC - scV2nPnc.isEnabled = FunctionBuildConfig.v2nMainSwitch + scV2nPnc.isEnabled = FunctionBuildConfig.v2nTotalSwitch //绿波通行(默认关闭) - scGreenWaveSop.isEnabled = FunctionBuildConfig.v2nMainSwitch + scGreenWaveSop.isEnabled = FunctionBuildConfig.v2nTotalSwitch scV2NSwitch.setOnCheckedChangeListener { compoundButton, isChecked -> clickEventAnalytics("V2N总开关",isChecked) if (isChecked) { //V2N新链路 - scNewV2NData.isChecked = FunctionBuildConfig.isNewV2NData - hmiAction("SOP 是否是V2N新链路(云->工控机->App)", FunctionBuildConfig.isNewV2NData) + scNewV2NData.isChecked = FunctionBuildConfig.v2nNewLinked + hmiAction("SOP 是否是V2N新链路(云->工控机->App)", FunctionBuildConfig.v2nNewLinked) //V2N场景进PNC - scV2nPnc.isChecked = FunctionBuildConfig.isV2NPnc - hmiAction("SOP V2N场景进PNC, ", FunctionBuildConfig.isV2NPnc) - CallerAutoPilotControlManager.sendV2nToPncCmd(FunctionBuildConfig.isV2NPnc) + scV2nPnc.isChecked = FunctionBuildConfig.v2nNewLinkedToPNC + hmiAction("SOP V2N场景进PNC, ", FunctionBuildConfig.v2nNewLinkedToPNC) + CallerAutoPilotControlManager.sendV2nToPncCmd(FunctionBuildConfig.v2nNewLinkedToPNC) //绿波通行 scGreenWaveSop.isChecked = HmiBuildConfig.isShowGreenWaveView hmiAction("SOP obu绿波通行, ", HmiBuildConfig.isShowGreenWaveView) @@ -234,37 +234,37 @@ internal class SOPSettingView @JvmOverloads constructor( if (!compoundButton.isPressed) { return@setOnCheckedChangeListener } - FunctionBuildConfig.v2nMainSwitch = isChecked + FunctionBuildConfig.v2nTotalSwitch = isChecked val map = HashMap().also { it["f1"] = isChecked - it["f2"] = FunctionBuildConfig.isNewV2NData + it["f2"] = FunctionBuildConfig.v2nNewLinked } CallerTelematicManager.sendMsgToAllClients(TelematicConstant.V2N_NEW_LINK_SWITCH, GsonUtils.toJson(map).toByteArray()) } //V2I总开关 - scV2ISwitch.isChecked = HmiBuildConfig.isShowObuV2iView //是否展示obu的v2i + scV2ISwitch.isChecked = HmiBuildConfig.v2iTotalSwitch //是否展示obu的v2i //根据V2I状态设置子开关是否可以点击 - scV2iPnc.isEnabled = HmiBuildConfig.isShowObuV2iView - scRunRedLightSop.isEnabled = HmiBuildConfig.isShowObuV2iView - scObuWeaknessTrafficSop.isEnabled = HmiBuildConfig.isShowObuV2iView + scV2iPnc.isEnabled = HmiBuildConfig.v2iTotalSwitch + scRunRedLightSop.isEnabled = HmiBuildConfig.v2iTotalSwitch + scObuWeaknessTrafficSop.isEnabled = HmiBuildConfig.v2iTotalSwitch scV2ISwitch.setOnCheckedChangeListener { compoundButton, isChecked -> clickEventAnalytics("V2I总开关",isChecked) if (isChecked) { //V2I场景进PNC - scV2iPnc.isChecked = FunctionBuildConfig.isV2IPnc - hmiAction("SOP V2I场景进PNC, ", FunctionBuildConfig.isV2IPnc) - CallerAutoPilotControlManager.sendV2iToPncCmd(FunctionBuildConfig.isV2IPnc) + scV2iPnc.isChecked = FunctionBuildConfig.v2iToPNC + hmiAction("SOP V2I场景进PNC, ", FunctionBuildConfig.v2iToPNC) + CallerAutoPilotControlManager.sendV2iToPncCmd(FunctionBuildConfig.v2iToPNC) //闯红灯预警 - scRunRedLightSop.isChecked = HmiBuildConfig.isShowRunRedLightView - hmiAction("SOP obu闯红灯预警, ", HmiBuildConfig.isShowRunRedLightView) + scRunRedLightSop.isChecked = HmiBuildConfig.v2iRedLightWarning + hmiAction("SOP obu闯红灯预警, ", HmiBuildConfig.v2iRedLightWarning) CallerTelematicManager.sendMsgToAllClients( TelematicConstant.OBU_RUNREDLIGHT_WARNING, "1".toByteArray() ) //路侧弱势交通参与者 - scObuWeaknessTrafficSop.isChecked = HmiBuildConfig.isShowObuWeaknessTrafficView - hmiAction("SOP obu弱势交通控制, ", HmiBuildConfig.isShowObuWeaknessTrafficView) + scObuWeaknessTrafficSop.isChecked = HmiBuildConfig.v2iWeaknessTraffic + hmiAction("SOP obu弱势交通控制, ", HmiBuildConfig.v2iWeaknessTraffic) } else { //V2I场景进PNC scV2iPnc.isChecked = false @@ -287,28 +287,28 @@ internal class SOPSettingView @JvmOverloads constructor( if (!compoundButton.isPressed) { return@setOnCheckedChangeListener } - HmiBuildConfig.isShowObuV2iView = isChecked + HmiBuildConfig.v2iTotalSwitch = isChecked } //V2N新链路 - scNewV2NData.isChecked = FunctionBuildConfig.isNewV2NData + scNewV2NData.isChecked = FunctionBuildConfig.v2nNewLinked scNewV2NData.setOnCheckedChangeListener { compoundButton, isChecked -> if (!compoundButton.isPressed) { return@setOnCheckedChangeListener } clickEventAnalytics("V2N新链路",isChecked) hmiAction("SOP 是否是V2N新链路(云->工控机->App)", isChecked) - FunctionBuildConfig.isNewV2NData = isChecked + FunctionBuildConfig.v2nNewLinked = isChecked val map = HashMap().also { - it["f1"] = FunctionBuildConfig.v2nMainSwitch + it["f1"] = FunctionBuildConfig.v2nTotalSwitch it["f2"] = isChecked } CallerTelematicManager.sendMsgToAllClients(TelematicConstant.V2N_NEW_LINK_SWITCH, GsonUtils.toJson(map).toByteArray()) } //V2N场景进PNC - scV2nPnc.isChecked = FunctionBuildConfig.isV2NPnc + scV2nPnc.isChecked = FunctionBuildConfig.v2nNewLinkedToPNC scV2nPnc.setOnCheckedChangeListener { compoundButton, isChecked -> if (!compoundButton.isPressed) { return@setOnCheckedChangeListener @@ -316,7 +316,7 @@ internal class SOPSettingView @JvmOverloads constructor( clickEventAnalytics("V2N场景进PNC",isChecked) hmiAction("SOP V2N场景进PNC, ", isChecked) CallerAutoPilotControlManager.sendV2nToPncCmd(isChecked) - FunctionBuildConfig.isV2NPnc = isChecked + FunctionBuildConfig.v2nNewLinkedToPNC = isChecked } //绿波通行(默认关闭) @@ -342,7 +342,7 @@ internal class SOPSettingView @JvmOverloads constructor( } //V2I场景进PNC - scV2iPnc.isChecked = FunctionBuildConfig.isV2IPnc + scV2iPnc.isChecked = FunctionBuildConfig.v2iToPNC scV2iPnc.setOnCheckedChangeListener { compoundButton, isChecked -> if (!compoundButton.isPressed) { return@setOnCheckedChangeListener @@ -350,19 +350,19 @@ internal class SOPSettingView @JvmOverloads constructor( clickEventAnalytics("V2I场景进PNC",isChecked) hmiAction("SOP V2I场景进PNC, ", isChecked) CallerAutoPilotControlManager.sendV2iToPncCmd(isChecked) - FunctionBuildConfig.isV2IPnc = isChecked + FunctionBuildConfig.v2iToPNC = isChecked } //闯红灯预警(默认关闭) - scRunRedLightSop.isChecked = HmiBuildConfig.isShowRunRedLightView + scRunRedLightSop.isChecked = HmiBuildConfig.v2iRedLightWarning scRunRedLightSop.setOnCheckedChangeListener { compoundButton, isChecked -> if (!compoundButton.isPressed) { return@setOnCheckedChangeListener } clickEventAnalytics("闯红灯预警",isChecked) hmiAction("SOP obu闯红灯预警, ", isChecked) - HmiBuildConfig.isShowRunRedLightView = isChecked - if (HmiBuildConfig.isShowRunRedLightView) { + HmiBuildConfig.v2iRedLightWarning = isChecked + if (HmiBuildConfig.v2iRedLightWarning) { CallerTelematicManager.sendMsgToAllClients( TelematicConstant.OBU_RUNREDLIGHT_WARNING, "1".toByteArray() @@ -376,25 +376,25 @@ internal class SOPSettingView @JvmOverloads constructor( } //路侧弱势交通参与者(默认开启) - scObuWeaknessTrafficSop.isChecked = HmiBuildConfig.isShowObuWeaknessTrafficView + scObuWeaknessTrafficSop.isChecked = HmiBuildConfig.v2iWeaknessTraffic scObuWeaknessTrafficSop.setOnCheckedChangeListener { compoundButton, isChecked -> if (!compoundButton.isPressed) { return@setOnCheckedChangeListener } clickEventAnalytics("路侧弱势交通参与者",isChecked) hmiAction("SOP obu弱势交通控制, ", isChecked) - HmiBuildConfig.isShowObuWeaknessTrafficView = isChecked + HmiBuildConfig.v2iWeaknessTraffic = isChecked } //V2V总开关(默认关闭) - scObuV2vView.isChecked = HmiBuildConfig.isShowObuV2vView + scObuV2vView.isChecked = HmiBuildConfig.v2vTotalSwitch scObuV2vView.setOnCheckedChangeListener { compoundButton, isChecked -> if (!compoundButton.isPressed) { return@setOnCheckedChangeListener } clickEventAnalytics("V2V总开关",isChecked) hmiAction("SOP obuV2V开关, ", isChecked) - HmiBuildConfig.isShowObuV2vView = isChecked + HmiBuildConfig.v2vTotalSwitch = isChecked } //obu总开关 @@ -599,7 +599,7 @@ internal class SOPSettingView @JvmOverloads constructor( scExamControl.isChecked = FunctionBuildConfig.isShowExamWindow scExamControl.setOnCheckedChangeListener { _, isChecked -> FunctionBuildConfig.isShowExamWindow = isChecked - CallerDevaToolsManager.showExamControlWindow(this,isChecked) + CallerDevaToolsManager.showExamControlWindow(isChecked) hmiAction("SOP 考试功能面板, ", isChecked) clickEventAnalytics("考试功能面板",isChecked) } diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/viewport/VisualAngleToggleView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/viewport/VisualAngleToggleView.kt index 4c49110a97..8cb7971cd9 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/viewport/VisualAngleToggleView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/viewport/VisualAngleToggleView.kt @@ -15,7 +15,6 @@ import com.mogo.eagle.core.function.angle.scenes.Default import com.mogo.eagle.core.function.angle.scenes.LongSight import com.mogo.eagle.core.function.api.map.angle.IMoGoVisualAngleChangeProvider import com.mogo.eagle.core.function.api.map.angle.Scene -import com.mogo.eagle.core.function.call.hmi.CallerHmiManager import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager import com.mogo.eagle.core.function.hmi.R import com.mogo.eagle.core.utilcode.kotlin.scope @@ -85,8 +84,6 @@ class VisualAngleToggleView : FrameLayout, IMoGoVisualAngleChangeProvider.OnMoGo override fun onAnimationEnd(animation: Animator, isReverse: Boolean) { super.onAnimationEnd(animation, isReverse) iv_toggle_block?.isEnabled = true - //TODO renwj - CallerHmiManager.toggleOperatePanel(false) } }) animator.interpolator = AccelerateDecelerateInterpolator() @@ -114,8 +111,6 @@ class VisualAngleToggleView : FrameLayout, IMoGoVisualAngleChangeProvider.OnMoGo override fun onAnimationEnd(animation: Animator, isReverse: Boolean) { iv_toggle_block?.isEnabled = true - //TODO renwj - CallerHmiManager.toggleOperatePanel(true) } }) animator.interpolator = AccelerateDecelerateInterpolator() diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_operate_panel_add.png b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_operate_panel_add.png new file mode 100644 index 0000000000..57787b8786 Binary files /dev/null and b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_operate_panel_add.png differ diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_operate_panel_checkbox_checked.png b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_operate_panel_checkbox_checked.png new file mode 100644 index 0000000000..70f4ea6db7 Binary files /dev/null and b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_operate_panel_checkbox_checked.png differ diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_operate_panel_checkbox_disabled.png b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_operate_panel_checkbox_disabled.png new file mode 100644 index 0000000000..796b2bbb7a Binary files /dev/null and b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_operate_panel_checkbox_disabled.png differ diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_operate_panel_checkbox_unchecked.png b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_operate_panel_checkbox_unchecked.png new file mode 100644 index 0000000000..0473f102b7 Binary files /dev/null and b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_operate_panel_checkbox_unchecked.png differ diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_operate_panel_minus.png b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_operate_panel_minus.png new file mode 100644 index 0000000000..d0da98e7c1 Binary files /dev/null and b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_operate_panel_minus.png differ diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_operate_panel_mofang_connect_doing.png b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_operate_panel_mofang_connect_doing.png new file mode 100644 index 0000000000..3595ab50cb Binary files /dev/null and b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_operate_panel_mofang_connect_doing.png differ diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_operate_panel_mofang_connect_failed.png b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_operate_panel_mofang_connect_failed.png new file mode 100644 index 0000000000..b4c1d1cc6d Binary files /dev/null and b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_operate_panel_mofang_connect_failed.png differ diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_operate_panel_mofang_connect_start.png b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_operate_panel_mofang_connect_start.png new file mode 100644 index 0000000000..7bc3fadcd4 Binary files /dev/null and b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_operate_panel_mofang_connect_start.png differ diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_operate_panel_mofang_disconnect.png b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_operate_panel_mofang_disconnect.png new file mode 100644 index 0000000000..abcb2e456f Binary files /dev/null and b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_operate_panel_mofang_disconnect.png differ diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_operate_panel_ok_disabled.png b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_operate_panel_ok_disabled.png new file mode 100644 index 0000000000..59d336f99f Binary files /dev/null and b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_operate_panel_ok_disabled.png differ diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_operate_panel_ok_enabled.png b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_operate_panel_ok_enabled.png new file mode 100644 index 0000000000..bc2217f62d Binary files /dev/null and b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_operate_panel_ok_enabled.png differ diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_operate_panel_ok_pressed.png b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_operate_panel_ok_pressed.png new file mode 100644 index 0000000000..570a86bf07 Binary files /dev/null and b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_operate_panel_ok_pressed.png differ diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_operate_panel_switch_compat_checked.png b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_operate_panel_switch_compat_checked.png new file mode 100644 index 0000000000..d9585a9f2f Binary files /dev/null and b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_operate_panel_switch_compat_checked.png differ diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_operate_panel_switch_compat_disabled.png b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_operate_panel_switch_compat_disabled.png new file mode 100644 index 0000000000..0acf98a8d6 Binary files /dev/null and b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_operate_panel_switch_compat_disabled.png differ diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_operate_panel_switch_compat_unchecked.png b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_operate_panel_switch_compat_unchecked.png new file mode 100644 index 0000000000..60b809f4e6 Binary files /dev/null and b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_operate_panel_switch_compat_unchecked.png differ diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_operate_panel_unman_interval_checked.png b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_operate_panel_unman_interval_checked.png new file mode 100644 index 0000000000..73cbdabb31 Binary files /dev/null and b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_operate_panel_unman_interval_checked.png differ diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/drawable/bg_operate_panel_checkbox.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable/bg_operate_panel_checkbox.xml new file mode 100644 index 0000000000..a09689403e --- /dev/null +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable/bg_operate_panel_checkbox.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/drawable/bg_operate_panel_edit.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable/bg_operate_panel_edit.xml new file mode 100644 index 0000000000..6b64c07192 --- /dev/null +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable/bg_operate_panel_edit.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/drawable/bg_operate_panel_edit_button.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable/bg_operate_panel_edit_button.xml new file mode 100644 index 0000000000..5e2f41f142 --- /dev/null +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable/bg_operate_panel_edit_button.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/drawable/bg_operate_panel_preference_detail.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable/bg_operate_panel_preference_detail.xml new file mode 100644 index 0000000000..21d5075519 --- /dev/null +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable/bg_operate_panel_preference_detail.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/drawable/bg_operate_panel_preference_header.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable/bg_operate_panel_preference_header.xml index b6ab109307..d5e8dae0d7 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/drawable/bg_operate_panel_preference_header.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable/bg_operate_panel_preference_header.xml @@ -6,5 +6,5 @@ - + \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/drawable/bg_operate_panel_switch_compat.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable/bg_operate_panel_switch_compat.xml new file mode 100644 index 0000000000..a00fe5a714 --- /dev/null +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable/bg_operate_panel_switch_compat.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/drawable/bg_operate_panel_welcome_words_edit.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable/bg_operate_panel_welcome_words_edit.xml new file mode 100644 index 0000000000..2972712b93 --- /dev/null +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable/bg_operate_panel_welcome_words_edit.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/drawable/bg_radio_button_operate_panel_unman_interval.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable/bg_radio_button_operate_panel_unman_interval.xml new file mode 100644 index 0000000000..f1d2a57c5b --- /dev/null +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable/bg_radio_button_operate_panel_unman_interval.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/drawable/bg_radio_group_operate_panel_unman_interval.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable/bg_radio_group_operate_panel_unman_interval.xml new file mode 100644 index 0000000000..3cc871f759 --- /dev/null +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable/bg_radio_group_operate_panel_unman_interval.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_operate_panel_detail_recyclerview.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_operate_panel_detail_recyclerview.xml new file mode 100644 index 0000000000..8ff0d51233 --- /dev/null +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_operate_panel_detail_recyclerview.xml @@ -0,0 +1,7 @@ + + \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_operate_panel_holder.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_operate_panel_holder.xml new file mode 100644 index 0000000000..6ecee10c27 --- /dev/null +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_operate_panel_holder.xml @@ -0,0 +1,5 @@ + + diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_operate_panel_preference_category_title.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_operate_panel_preference_category_title.xml index dde2caa791..0f15e27692 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_operate_panel_preference_category_title.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_operate_panel_preference_category_title.xml @@ -9,5 +9,7 @@ android:textSize="@dimen/dp_30" android:paddingTop="@dimen/dp_30" android:paddingStart="@dimen/dp_30" + android:background="@android:color/transparent" tools:text="地图效果" - android:gravity="start" /> \ No newline at end of file + android:gravity="start" + tools:ignore="RtlSymmetry,SpUsage" /> \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_operate_panel_preference_checkbox_compat.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_operate_panel_preference_checkbox_compat.xml index 18f7a152e0..ff6172eb3b 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_operate_panel_preference_checkbox_compat.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_operate_panel_preference_checkbox_compat.xml @@ -6,6 +6,7 @@ android:layout_height="wrap_content" android:paddingStart="@dimen/dp_30" android:paddingEnd="@dimen/dp_30" + android:background="@android:color/transparent" android:orientation="horizontal" tools:background="#83000000"> diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_operate_panel_preference_header.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_operate_panel_preference_header.xml index a6ed4b8461..78d511e5e8 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_operate_panel_preference_header.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_operate_panel_preference_header.xml @@ -10,5 +10,8 @@ android:paddingTop="@dimen/dp_25" android:paddingBottom="@dimen/dp_25" android:paddingStart="@dimen/dp_30" + android:layout_marginEnd="@dimen/dp_30" + android:background="@drawable/bg_operate_panel_preference_header" tools:text="地图效果" - android:gravity="start" /> \ No newline at end of file + android:gravity="start" + tools:ignore="RtlSymmetry,SpUsage" /> \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_operate_panel_preference_switch_compat.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_operate_panel_preference_switch_compat.xml index 18f7a152e0..919de4480e 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_operate_panel_preference_switch_compat.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_operate_panel_preference_switch_compat.xml @@ -7,6 +7,7 @@ android:paddingStart="@dimen/dp_30" android:paddingEnd="@dimen/dp_30" android:orientation="horizontal" + android:background="@android:color/transparent" tools:background="#83000000"> + tools:text="V2X总开关" + tools:ignore="SpUsage" /> + tools:text="V2X总开关" + tools:ignore="SpUsage" /> + android:clickable="false" + android:button="@null" + android:background="@drawable/bg_operate_panel_checkbox"/> diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_operate_panel_preference_widget_edit_with_button.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_operate_panel_preference_widget_edit_with_button.xml index 6a19ddfa51..fde0695380 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_operate_panel_preference_widget_edit_with_button.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_operate_panel_preference_widget_edit_with_button.xml @@ -1,6 +1,72 @@ - + android:orientation="horizontal" + android:layout_marginTop="@dimen/dp_20" + tools:background="#83000000"> + + + + + + + + + + + + + + +