add light switch

This commit is contained in:
lixiaopeng
2022-02-21 17:38:44 +08:00
parent 51cc70eef6
commit 617a4cc9a1
7 changed files with 54 additions and 9 deletions

View File

@@ -1024,13 +1024,11 @@ class MoGoHmiFragment : MvpFragment<MoGoWarningContract.View?, WaringPresenter?>
}
}
private var isOpenTurnlight :Boolean = true
/**
* 显示转向灯效果
* 显示转向灯效果 if (HmiBuildConfig.isShowBadCaseView) {
*/
override fun showTurnLight(light: Int) {
if (isOpenTurnlight) {
if (HmiBuildConfig.isShowTurnLightView) {
//Log.d("liyz", "showTurnLight light = $light")
turnLightView.setTurnLight(light)
}
@@ -1040,15 +1038,18 @@ class MoGoHmiFragment : MvpFragment<MoGoWarningContract.View?, WaringPresenter?>
* 显示刹车效果
*/
override fun showBrakeLight(light: Int) {
if (isOpenTurnlight) {
if (HmiBuildConfig.isShowBrakeLightView) {
// Log.d("liyz", "showBrakeLight light = $light")
brakeView.setBrakeLight(light)
}
}
override fun setTurnLightFunction(isOpen: Boolean) {
isOpenTurnlight = isOpen
HmiBuildConfig.isShowTurnLightView = isOpen
}
override fun setBrakeLightFunction(isOpen: Boolean) {
HmiBuildConfig.isShowBrakeLightView = isOpen
}
/**

View File

@@ -196,6 +196,14 @@ class DebugSettingView @JvmOverloads constructor(
}
}
tbOpenBrakeLight.setOnCheckedChangeListener { buttonView, isChecked ->
if (!isChecked) {
CallerHmiManager.setBrakeLightFunction(true)
} else {
CallerHmiManager.setBrakeLightFunction(false)
}
}
changesight_top_btn.setOnClickListener {
CallerHDMapManager.setMapDAngle(0);
}

View File

@@ -171,6 +171,15 @@
android:textOn="打开「转向灯控制」"
android:textSize="@dimen/dp_24" />
<ToggleButton
android:id="@+id/tbOpenBrakeLight"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="2dp"
android:gravity="center"
android:textOff="关闭「刹车控制」"
android:textOn="打开「刹车控制」"
android:textSize="@dimen/dp_24" />
<Button
android:id="@+id/changesight_top_btn"
android:layout_width="wrap_content"