[8.5.0]
[升级功能]
This commit is contained in:
@@ -68,6 +68,7 @@
|
|||||||
app:layout_constraintTop_toBottomOf="@id/unmanned_more_title" />
|
app:layout_constraintTop_toBottomOf="@id/unmanned_more_title" />
|
||||||
|
|
||||||
<com.mogo.eagle.core.function.hmi.bone.unmanned.UnmannedToolLogoutView
|
<com.mogo.eagle.core.function.hmi.bone.unmanned.UnmannedToolLogoutView
|
||||||
|
android:id="@+id/unmannedToolLogoutView"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="@dimen/dp_100"
|
android:layout_height="@dimen/dp_100"
|
||||||
android:layout_marginStart="@dimen/dp_36"
|
android:layout_marginStart="@dimen/dp_36"
|
||||||
@@ -77,4 +78,14 @@
|
|||||||
app:layout_constraintStart_toStartOf="@id/unmanned_guideline_more_left"
|
app:layout_constraintStart_toStartOf="@id/unmanned_guideline_more_left"
|
||||||
app:layout_constraintTop_toBottomOf="@id/unmannedToolStopServiceView" />
|
app:layout_constraintTop_toBottomOf="@id/unmannedToolStopServiceView" />
|
||||||
|
|
||||||
|
<com.mogo.eagle.core.function.hmi.bone.unmanned.UnmannedUpgradeView
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="@dimen/dp_100"
|
||||||
|
android:layout_marginStart="@dimen/dp_36"
|
||||||
|
android:layout_marginTop="@dimen/dp_40"
|
||||||
|
android:layout_marginEnd="@dimen/dp_36"
|
||||||
|
app:layout_constraintEnd_toEndOf="@id/unmanned_guideline_more_right"
|
||||||
|
app:layout_constraintStart_toStartOf="@id/unmanned_guideline_more_left"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/unmannedToolLogoutView" />
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
@@ -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()
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:id="@+id/clCheckSystem"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/viewCheckShutDown"
|
||||||
|
android:layout_width="@dimen/dp_100"
|
||||||
|
android:layout_height="@dimen/dp_100"
|
||||||
|
android:contentDescription="@string/check_system_shut_down"
|
||||||
|
android:scaleType="fitXY"
|
||||||
|
android:src="@drawable/icon_toolkit_item_stop_service"
|
||||||
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
tools:src="@drawable/icon_toolkit_item_stop_service_background" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tvUpgrade"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="@dimen/dp_10"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:gravity="center"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:text="@string/tab_version_update"
|
||||||
|
android:textColor="@color/color_FFFFFF"
|
||||||
|
android:textSize="@dimen/sp_40"
|
||||||
|
app:layout_constraintBottom_toBottomOf="@id/viewCheckShutDown"
|
||||||
|
app:layout_constraintStart_toEndOf="@id/viewCheckShutDown"
|
||||||
|
app:layout_constraintTop_toTopOf="@id/viewCheckShutDown" />
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
Reference in New Issue
Block a user