From 9707137c21d21aa4f6606ad7b7e93e318eebc92a Mon Sep 17 00:00:00 2001 From: lixiaopeng Date: Fri, 11 Nov 2022 17:11:22 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AE=BE=E7=BD=AE=E9=80=9F?= =?UTF-8?q?=E5=BA=A6=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hmi/ui/tools/AutoPilotAndCheckView.kt | 45 +++++++++---------- .../res/drawable/taxi_loginout_sure_bg.xml | 6 +++ .../main/res/layout/view_auto_pilot_check.xml | 19 +++++++- 3 files changed, 43 insertions(+), 27 deletions(-) create mode 100644 core/function-impl/mogo-core-function-hmi/src/main/res/drawable/taxi_loginout_sure_bg.xml diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/tools/AutoPilotAndCheckView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/tools/AutoPilotAndCheckView.kt index c6c1ce249a..562f8806d9 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/tools/AutoPilotAndCheckView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/tools/AutoPilotAndCheckView.kt @@ -7,6 +7,7 @@ import android.graphics.Color import android.graphics.drawable.ColorDrawable import android.os.Process import android.util.AttributeSet +import android.util.Log import android.view.LayoutInflater import android.view.View import android.widget.FrameLayout @@ -113,51 +114,45 @@ class AutoPilotAndCheckView @JvmOverloads constructor( // if (maxAcceleration > 0) { // tvAcceleration.text = "加速度 $maxAcceleration m/s²" // } - tvAcceleration.text = "每次调整车速±5km/h" + tvAcceleration.text = "每次调整车速±5km/h,点击确定生效" if (speedLimit > 0) { tvSpeed.text = speedLimit.toString() }else{ tvSpeed.text = "0" } + ivSpeedReduce.setOnClickListener { if(speedLimit>=5){ speedLimit -= 5 - //速度显示 - val isSuccess = CallerAutoPilotManager.setAutoPilotSpeed(speedLimit) - when { - isSuccess -> { - //速度显示 - tvSpeed.text = speedLimit.toString() - ToastUtils.showShort("车速设置成功,立即生效") - } - else -> { - ToastUtils.showShort("设置车速失败,请启动域控制器") - } - } + tvSpeed.text = speedLimit.toString() }else{ ToastUtils.showShort("车速不能再减了") } } + ivSpeedAdd.setOnClickListener { if(speedLimit<=55){ speedLimit += 5 - //速度显示 - val isSuccess = CallerAutoPilotManager.setAutoPilotSpeed(speedLimit) - when { - isSuccess -> { - //速度显示 - tvSpeed.text = speedLimit.toString() - ToastUtils.showShort("车速设置成功,立即生效") - } - else -> { - ToastUtils.showShort("设置车速失败,请启动域控制器") - } - } + tvSpeed.text = speedLimit.toString() }else{ ToastUtils.showShort("车速不能再加了") } } + //速度确认 + tvSureModify.setOnClickListener { + val isSuccess = CallerAutoPilotManager.setAutoPilotSpeed(speedLimit) + when { + isSuccess -> { + //速度显示 + tvSpeed.text = speedLimit.toString() + ToastUtils.showShort("车速设置成功,立即生效") + } + else -> { + ToastUtils.showShort("设置车速失败,请启动域控制器") + } + } + } initOchView() } diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/drawable/taxi_loginout_sure_bg.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable/taxi_loginout_sure_bg.xml new file mode 100644 index 0000000000..d681263571 --- /dev/null +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable/taxi_loginout_sure_bg.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/view_auto_pilot_check.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_auto_pilot_check.xml index a41f32557b..fcdc0ab192 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_auto_pilot_check.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_auto_pilot_check.xml @@ -241,6 +241,7 @@ /> x` + android:layout_marginStart="40px" /> + +