From 956a1a2712d1177940da0bbf3e876a49f0054739 Mon Sep 17 00:00:00 2001 From: xuxinchao Date: Wed, 22 Feb 2023 14:52:00 +0800 Subject: [PATCH] =?UTF-8?q?[opt3.0]=E8=BF=90=E8=90=A5=E9=9D=A2=E6=9D=BFUI?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../function/hmi/ui/setting/SOPSettingView.kt | 46 +- .../src/main/res/layout/view_sop_setting.xml | 543 +++++++++--------- 2 files changed, 291 insertions(+), 298 deletions(-) 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 d7f34d5901..ffd67f3131 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 @@ -45,6 +45,7 @@ internal class SOPSettingView @JvmOverloads constructor( } private fun initView() { + sopLayout.setOnClickListener { } //绕障类功能开关 tbObstacleAvoidance.isChecked = FunctionBuildConfig.isDetouring tbObstacleAvoidance.setOnCheckedChangeListener { _, isChecked -> @@ -144,7 +145,10 @@ internal class SOPSettingView @JvmOverloads constructor( // 演示模式,上一次勾选的数据 tbDemoMode.isChecked = FunctionBuildConfig.isDemoMode // 演示模式 - tbDemoMode.setOnCheckedChangeListener { _, _ -> + tbDemoMode.setOnCheckedChangeListener { compoundButton, _ -> + if(!compoundButton.isPressed){ + return@setOnCheckedChangeListener + } FunctionBuildConfig.isDemoMode = !FunctionBuildConfig.isDemoMode CallerHmiManager.updateStatusBarLeftView(FunctionBuildConfig.isDemoMode, "demoMode", DemoModeView(context)) CallerAutoPilotControlManager.setDemoMode(FunctionBuildConfig.isDemoMode) @@ -162,7 +166,10 @@ internal class SOPSettingView @JvmOverloads constructor( // 雨天模式,上一次勾选的数据 tbRainMode.isChecked = FunctionBuildConfig.isRainMode //雨天模式 - tbRainMode.setOnCheckedChangeListener { _, isChecked -> + tbRainMode.setOnCheckedChangeListener { compoundButton, isChecked -> + if(!compoundButton.isPressed){ + return@setOnCheckedChangeListener + } CallerAutoPilotControlManager.setRainMode(isChecked) FunctionBuildConfig.isRainMode = isChecked } @@ -251,11 +258,8 @@ internal class SOPSettingView @JvmOverloads constructor( private val timerTaskRefresh = object : TimerTask(){ override fun run() { UiThreadHandler.post{ - if(FunctionBuildConfig.isDemoMode){ - tbDemoMode.text = "关闭美化模式" - }else{ - tbDemoMode.text = "开启美化模式" - } + tbDemoMode.isChecked = FunctionBuildConfig.isDemoMode + tbRainMode.isChecked = FunctionBuildConfig.isRainMode } } @@ -265,39 +269,27 @@ internal class SOPSettingView @JvmOverloads constructor( when (type) { FuncBizConfig.BIZ_BEAUTY_MODE -> { tbDemoMode.isClickable = !lock - val (left,top,right,bottom) = tbDemoMode.currentPadding() - if (lock) { - tbDemoMode.background = - resources.getDrawable(R.drawable.radio_button_lock_background) - } else { - tbDemoMode.background = - resources.getDrawable(R.drawable.radio_button_normal_background_right) + if(lock){ + tbDemoMode.visibility = View.INVISIBLE + }else{ + tbDemoMode.visibility = View.VISIBLE } - tbDemoMode.setPadding(left,top,right,bottom) } FuncBizConfig.BIZ_RAIN_MODE -> { tbRainMode.isClickable = !lock - val (left,top,right,bottom) = tbRainMode.currentPadding() if (lock) { - tbRainMode.background = - resources.getDrawable(R.drawable.radio_button_lock_background) + tbRainMode.visibility = View.INVISIBLE } else { - tbRainMode.background = - resources.getDrawable(R.drawable.radio_button_normal_background_right) + tbRainMode.visibility = View.VISIBLE } - tbRainMode.setPadding(left,top,right,bottom) } FuncBizConfig.BIZ_PNC_WARNING -> { tbMarkingObstacles.isClickable = !lock - val (left,top,right,bottom) = tbMarkingObstacles.currentPadding() if (lock) { - tbMarkingObstacles.background = - resources.getDrawable(R.drawable.radio_button_lock_background) + tbMarkingObstacles.visibility = View.INVISIBLE } else { - tbMarkingObstacles.background = - resources.getDrawable(R.drawable.radio_button_normal_background_right) + tbMarkingObstacles.visibility = View.VISIBLE } - tbMarkingObstacles.setPadding(left,top,right,bottom) } } } diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_sop_setting.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_sop_setting.xml index 8c7522b317..4558cc99a4 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_sop_setting.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_sop_setting.xml @@ -1,297 +1,298 @@ - + android:background="#FFFFFF"> - + - + + - - - - - - - - - - + + - + + - + + - + + - + + - + + - + + - + - + - + - - + - + - + - + - + -