From dadf330a2c4c5ca01dd63d19a761c9ed291b2db3 Mon Sep 17 00:00:00 2001 From: yangyakun Date: Wed, 8 Mar 2023 09:36:48 +0800 Subject: [PATCH] =?UTF-8?q?[shuttle]=20[=E6=96=B9=E5=90=91=E7=9B=98?= =?UTF-8?q?=E4=BF=AE=E6=94=B9]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../function/hmi/ui/widget/SteeringWheelView.kt | 11 +++++++---- .../core/utilcode/mogo/AppIdentityModeUtils.kt | 15 ++++++++++++++- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/SteeringWheelView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/SteeringWheelView.kt index 9a0cecc4ff..fdbe3d9ce2 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/SteeringWheelView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/SteeringWheelView.kt @@ -19,6 +19,7 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListener import com.mogo.eagle.core.function.call.autopilot.CallerChassisGearStateListenerManager import com.mogo.eagle.core.function.call.autopilot.CallerChassisSteeringStateListenerManager import com.mogo.eagle.core.function.hmi.R +import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils.isBus import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils.isTaxi import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d @@ -46,10 +47,12 @@ class SteeringWheelView : ConstraintLayout, IMoGoChassisSteeringStateListener, constructor(context: Context) : super(context) {} constructor(context: Context, attrs: AttributeSet?) : super(context, attrs) { - if (isBus(FunctionBuildConfig.appIdentityMode)) { - LayoutInflater.from(context).inflate(R.layout.hmi_steering_wheel_bus, this) - } else { - LayoutInflater.from(context).inflate(R.layout.hmi_steering_wheel_taxi, this) + when (AppIdentityModeUtils.getProduct(FunctionBuildConfig.appIdentityMode)) { + AppIdentityModeUtils.Product.BUS -> LayoutInflater.from(context).inflate(R.layout.hmi_steering_wheel_bus, this) + AppIdentityModeUtils.Product.TAXI -> LayoutInflater.from(context).inflate(R.layout.hmi_steering_wheel_taxi, this) + AppIdentityModeUtils.Product.SWEEPER -> LayoutInflater.from(context).inflate(R.layout.hmi_steering_wheel_bus, this) + AppIdentityModeUtils.Product.SHUTTLE -> LayoutInflater.from(context).inflate(R.layout.hmi_steering_wheel_bus, this) + AppIdentityModeUtils.Product.CHARTER -> LayoutInflater.from(context).inflate(R.layout.hmi_steering_wheel_bus, this) } initView() CallerAutoPilotStatusListenerManager.addListener(TAG, mGoAutopilotStatusListener) diff --git a/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/mogo/AppIdentityModeUtils.kt b/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/mogo/AppIdentityModeUtils.kt index 641ba8d008..d143e6dfa3 100644 --- a/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/mogo/AppIdentityModeUtils.kt +++ b/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/mogo/AppIdentityModeUtils.kt @@ -227,7 +227,20 @@ object AppIdentityModeUtils { return false } + fun getProduct(appIdentityMode: String): Product { + val (bussness, _, _) = getInfo(appIdentityMode) + return when (bussness) { + TAXI -> Product.TAXI + BUS -> Product.BUS + SWEEPER -> Product.SWEEPER + SHUTTLE -> Product.SHUTTLE + CHARTER -> Product.CHARTER + else -> Product.TAXI + } + } - + enum class Product{ + BUS,TAXI,SWEEPER,SHUTTLE,CHARTER + } }