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 + } }