[8.2.2][feat]新增B2美化呈现开关

This commit is contained in:
chenfufeng
2025-09-05 16:51:35 +08:00
parent cbc38ea577
commit ee303ec357
4 changed files with 34 additions and 0 deletions

View File

@@ -387,6 +387,13 @@ class TeleMsgHandler : IMsgHandler {
)
}
TelematicConstant.CONTROL_B2_PRETTIFY_SWITCH -> {
CallerTelematicListenerManager.invokeReceivedMsg(
TelematicConstant.CONTROL_B2_PRETTIFY_SWITCH,
it.body
)
}
TelematicConstant.SHOW_TRAFFIC_LIGHT -> {
val trafficLightJson = String(it.body)
CallerTrafficLightListenerManager.invokeTrafficLightStatus(

View File

@@ -878,6 +878,7 @@ class OperatePanelLayout : LinearLayout {
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"
private const val KEY_MOGO_PRETTIFY_SWITCH = "mogo_prettify_switch"
}
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
@@ -915,6 +916,9 @@ class OperatePanelLayout : LinearLayout {
KEY_TAKE_OVER_WAKE -> {
return FunctionBuildConfig.isTakeoverRemind
}
KEY_MOGO_PRETTIFY_SWITCH -> {
return false
}
}
return super.getDefaultVal(pref)
}
@@ -952,6 +956,21 @@ class OperatePanelLayout : LinearLayout {
clickEventAnalytics("接管提醒", isChecked)
return true
}
KEY_MOGO_PRETTIFY_SWITCH -> {
val isChecked = newValue as? Boolean ?: false
if (isChecked) {
CallerTelematicManager.sendMsgToAllClients(
TelematicConstant.CONTROL_B2_PRETTIFY_SWITCH,
"1".toByteArray()
)
} else {
CallerTelematicManager.sendMsgToAllClients(
TelematicConstant.CONTROL_B2_PRETTIFY_SWITCH,
"0".toByteArray()
)
}
return true
}
}
return super.onPreferenceChange(preference, newValue)
}

View File

@@ -19,5 +19,12 @@
android:persistent="false"
android:layout="@layout/layout_operate_panel_preference_switch_compat"
android:widgetLayout="@layout/layout_operate_panel_preference_widget_switch_compat"/>
<SwitchPreferenceCompat
android:key="mogo_prettify_switch"
android:title="B2乘客屏驾驶状态美化呈现"
android:persistent="false"
android:enabled="true"
android:layout="@layout/layout_operate_panel_preference_switch_compat"
android:widgetLayout="@layout/layout_operate_panel_preference_widget_switch_compat"/>
</PreferenceCategory>
</androidx.preference.PreferenceScreen>