From 62c682c446ea8b891414a00e01b9ed7b821ef321 Mon Sep 17 00:00:00 2001 From: yangyakun Date: Tue, 24 Mar 2026 15:42:42 +0800 Subject: [PATCH] =?UTF-8?q?[8.5.0]=20[=E5=8D=87=E7=BA=A7=E5=8A=9F=E8=83=BD?= =?UTF-8?q?]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/res/layout/shuttle_unmanned_more.xml | 11 ++++ .../hmi/bone/unmanned/UnmannedUpgradeView.kt | 64 +++++++++++++++++++ .../res/layout/unmanned_view_tool_upgrade.xml | 35 ++++++++++ 3 files changed, 110 insertions(+) create mode 100644 core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/bone/unmanned/UnmannedUpgradeView.kt create mode 100644 core/function-impl/mogo-core-function-hmi/src/main/res/layout/unmanned_view_tool_upgrade.xml diff --git a/OCH/shuttle/driver_unmanned/src/main/res/layout/shuttle_unmanned_more.xml b/OCH/shuttle/driver_unmanned/src/main/res/layout/shuttle_unmanned_more.xml index 1dedf22e66..3822ff008d 100644 --- a/OCH/shuttle/driver_unmanned/src/main/res/layout/shuttle_unmanned_more.xml +++ b/OCH/shuttle/driver_unmanned/src/main/res/layout/shuttle_unmanned_more.xml @@ -68,6 +68,7 @@ app:layout_constraintTop_toBottomOf="@id/unmanned_more_title" /> + + \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/bone/unmanned/UnmannedUpgradeView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/bone/unmanned/UnmannedUpgradeView.kt new file mode 100644 index 0000000000..b2ce05935a --- /dev/null +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/bone/unmanned/UnmannedUpgradeView.kt @@ -0,0 +1,64 @@ +package com.mogo.eagle.core.function.hmi.bone.unmanned + +import android.content.Context +import android.util.AttributeSet +import android.view.LayoutInflater +import androidx.constraintlayout.widget.ConstraintLayout +import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager +import com.mogo.eagle.core.function.hmi.R +import com.mogo.eagle.core.utilcode.kotlin.onClick +import com.mogo.eagle.core.function.hmi.ui.utils.HmiActionLog +import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant +import com.mogo.eagle.core.utilcode.util.ToastUtils +import kotlinx.android.synthetic.main.unmanned_view_tool_upgrade.view.tvUpgrade + + +/** + * 一件停服 + */ +class UnmannedUpgradeView @JvmOverloads constructor( + context: Context, + attrs: AttributeSet? = null, + defStyleAttr: Int = 0 +) : ConstraintLayout(context, attrs, defStyleAttr) { + + companion object { + const val TAG = "UnmannedToolStopServiceView" + } + + init { + LayoutInflater.from(context).inflate(R.layout.unmanned_view_tool_upgrade, this, true) + initView() + } + + private fun initView() { + //一键停服 + tvUpgrade.onClick { + HmiActionLog.hmiAction( + "${SceneConstant.M_HMI}${TAG}", + "pad version view clicked" + ) + val provider = CallerDevaToolsManager.upgradeProvider() + if (provider?.isDownloading() == true) { +// ToastUtils.showShort("正在下载最新版本,请稍候再试...") + ToastUtils.showShort(R.string.module_mogo_core_function_hmi_downloading_new_version) + return@onClick + } + CallerDevaToolsManager.queryAppUpgrade { upgradeStatus, errorInfo -> + if (!upgradeStatus && !errorInfo.isNullOrEmpty()) { + ToastUtils.showShort(errorInfo) + } + } + } + + } + + override fun onAttachedToWindow() { + super.onAttachedToWindow() + } + + override fun onDetachedFromWindow() { + super.onDetachedFromWindow() + } + +} \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/unmanned_view_tool_upgrade.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/unmanned_view_tool_upgrade.xml new file mode 100644 index 0000000000..a49061244e --- /dev/null +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/unmanned_view_tool_upgrade.xml @@ -0,0 +1,35 @@ + + + + + + + + \ No newline at end of file