调试窗修改
添加应用包管理中心
This commit is contained in:
@@ -85,8 +85,8 @@ class DevaToolsProvider : IDevaToolsProvider {
|
||||
upgradeManager.getPackageUrls(versionName)
|
||||
}
|
||||
|
||||
override fun downLoadPackage(downLoadKey: String) {
|
||||
// upgradeManager.downLoadPackage(mContext!!, downLoadKey)
|
||||
override fun downLoadPackage(downloadKey: String,downloadUrl: String) {
|
||||
upgradeManager.downLoadPackage(mContext!!, downloadKey,downloadUrl)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -36,14 +36,14 @@ class UpgradeManager : IDownload {
|
||||
})
|
||||
}
|
||||
|
||||
fun downLoadPackage(context: Context, downLoadKey: String) {
|
||||
fun downLoadPackage(context: Context, downloadKey: String,downloadUrl: String) {
|
||||
// val downLoadUrl = map?.get(downLoadKey)
|
||||
// downLoadUrl?.let {
|
||||
DownloadUtils.downLoad(
|
||||
context,
|
||||
"https://scm-1255510688.cos.ap-beijing.myqcloud.com/test/com.mogo.launcher.f/2.5.1.1009/IntelligentPilot_v2.5.1.1009_20220216_[fPadLenovoOchTaxi-launcher-online]_debug.apk",
|
||||
downloadUrl,
|
||||
Config.downLoadPath,
|
||||
downLoadKey,
|
||||
downloadKey,
|
||||
5,
|
||||
this
|
||||
)
|
||||
|
||||
@@ -11,6 +11,7 @@ import android.view.View
|
||||
import androidx.annotation.RequiresApi
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClient
|
||||
import com.mogo.commons.AbsMogoApplication
|
||||
import com.mogo.commons.debug.DebugConfig
|
||||
@@ -23,6 +24,7 @@ import com.mogo.eagle.core.data.deva.scene.SceneModule
|
||||
import com.mogo.eagle.core.data.enums.TrafficTypeEnum
|
||||
import com.mogo.eagle.core.data.map.MogoLocation
|
||||
import com.mogo.eagle.core.data.obu.ObuStatusInfo
|
||||
import com.mogo.eagle.core.data.upgrade.UpgradeVersionEntity
|
||||
import com.mogo.eagle.core.function.api.autopilot.*
|
||||
import com.mogo.eagle.core.function.api.devatools.IMoGoDevaToolsListener
|
||||
import com.mogo.eagle.core.function.api.map.listener.IMoGoMapLocationListener
|
||||
@@ -43,6 +45,7 @@ import com.mogo.eagle.core.function.hmi.ui.logcatch.ILogViewListener
|
||||
import com.mogo.eagle.core.function.hmi.ui.logcatch.LogInfoView
|
||||
import com.mogo.eagle.core.function.hmi.ui.tools.AdUpgradeDialog
|
||||
import com.mogo.eagle.core.function.hmi.ui.tools.DockerRebootDialog
|
||||
import com.mogo.eagle.core.function.hmi.ui.upgrade.UpgradeListAdapter
|
||||
import com.mogo.eagle.core.utilcode.kotlin.onClick
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.LogLevel
|
||||
@@ -58,6 +61,7 @@ import kotlinx.android.synthetic.main.view_debug_setting.view.*
|
||||
import mogo.telematics.pad.MessagePad
|
||||
import mogo_msg.MogoReportMsg
|
||||
import java.util.*
|
||||
import kotlin.collections.ArrayList
|
||||
|
||||
/**
|
||||
* @author xiaoyuzhou
|
||||
@@ -116,6 +120,16 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
//OBU连接状态
|
||||
private var obuConnectStatus: Boolean = false
|
||||
|
||||
//渠道包标签
|
||||
private var onlineSelected: Boolean = true
|
||||
private var qaSelected: Boolean = true
|
||||
|
||||
private var upgradeListAdapter: UpgradeListAdapter?=null
|
||||
|
||||
private val upgradeVersionList by lazy{
|
||||
ArrayList<UpgradeVersionEntity>()
|
||||
}
|
||||
|
||||
private val mapUiController by lazy {
|
||||
CallerMapUIServiceManager.getMapUIController()
|
||||
}
|
||||
@@ -257,6 +271,9 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 鹰眼参数配置
|
||||
*/
|
||||
tbEagleEyeController.setOnCheckedChangeListener { buttonView, isChecked ->
|
||||
if(isChecked){
|
||||
buttonView.setCompoundDrawables(null, null, iconDown, null)
|
||||
@@ -345,7 +362,20 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 应用包管理中心
|
||||
*/
|
||||
btnApkCenter.setOnCheckedChangeListener { buttonView, isChecked ->
|
||||
if(isChecked){
|
||||
buttonView.setCompoundDrawables(null, null, iconDown, null)
|
||||
//展示应用包管理中心
|
||||
apkCenterLayout.visibility = View.VISIBLE
|
||||
} else {
|
||||
buttonView.setCompoundDrawables(null, null, iconRight, null)
|
||||
//隐藏应用包管理中心
|
||||
apkCenterLayout.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
|
||||
lastVisualAngleMode = mapUiController?.currentMapVisualAngle
|
||||
|
||||
@@ -408,6 +438,8 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
setHmiCheckedChangeListener()
|
||||
//日志中心事件点击监听
|
||||
setLogCheckedChangeListener()
|
||||
//APK包管理中心配置
|
||||
setApkCenterListener()
|
||||
|
||||
//OBU配置信息
|
||||
tvObuInfo.text = CallerObuListenerManager.getObuStatusInfoJsonString()
|
||||
@@ -1043,7 +1075,17 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
override fun upgradeVersionUrls(urls: Map<String, String>?) {
|
||||
|
||||
//版本信息更新
|
||||
urls?.let {
|
||||
upgradeVersionList.clear()
|
||||
it.iterator().forEach {map ->
|
||||
val name = if(map.key.contains("{")) map.key.replace("{","") else map.key
|
||||
val url = if(map.value.contains("}")) map.value.replace("}","") else map.value
|
||||
upgradeVersionList.add(UpgradeVersionEntity(name,url))
|
||||
}
|
||||
upgradeListAdapter?.setDada(dataFilter(upgradeVersionList))
|
||||
upgradeListAdapter?.notifyDataSetChanged()
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -1141,6 +1183,75 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* APK包管理
|
||||
*/
|
||||
private fun setApkCenterListener(){
|
||||
val layoutManager: LinearLayoutManager = object : LinearLayoutManager(context,
|
||||
VERTICAL, false) {
|
||||
override fun canScrollVertically(): Boolean {
|
||||
// 直接禁止垂直滑动
|
||||
return false
|
||||
}
|
||||
}
|
||||
rvUpgradeVersionList.layoutManager =layoutManager
|
||||
|
||||
upgradeListAdapter = UpgradeListAdapter(context,upgradeVersionList,
|
||||
object:UpgradeListAdapter.ClickListener{
|
||||
override fun downloadApk(name: String,url: String) {
|
||||
//下载包
|
||||
CallerDevaToolsManager.downLoadPackage(name,url)
|
||||
ToastUtils.showLong("开始下载APK,稍后可前往downloads文件夹查看")
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
rvUpgradeVersionList.adapter = upgradeListAdapter
|
||||
|
||||
ivApkSearch.setOnClickListener {
|
||||
val searchStr = etApkSearch.text.toString()
|
||||
if(searchStr.isEmpty()){
|
||||
ToastUtils.showShort("请输入正确的搜索关键字")
|
||||
}else{
|
||||
CallerDevaToolsManager.getUpgradeVersionUrls(searchStr)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//Online
|
||||
cbApkOnline.setOnCheckedChangeListener { _, isChecked ->
|
||||
onlineSelected = isChecked
|
||||
upgradeListAdapter?.setDada(dataFilter(upgradeVersionList))
|
||||
upgradeListAdapter?.notifyDataSetChanged()
|
||||
}
|
||||
//QA
|
||||
cbApkQa.setOnCheckedChangeListener { _, isChecked ->
|
||||
qaSelected = isChecked
|
||||
upgradeListAdapter?.setDada(dataFilter(upgradeVersionList))
|
||||
upgradeListAdapter?.notifyDataSetChanged()
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据包数据过滤器
|
||||
*/
|
||||
private fun dataFilter(list: ArrayList<UpgradeVersionEntity>): ArrayList<UpgradeVersionEntity> {
|
||||
val tempList = ArrayList<UpgradeVersionEntity>()
|
||||
list?.let {
|
||||
it.iterator().forEach { entity->
|
||||
if(onlineSelected && entity.name.contains("online")){
|
||||
tempList.add(entity)
|
||||
}
|
||||
if(qaSelected && entity.name.contains("qa")){
|
||||
tempList.add(entity)
|
||||
}
|
||||
}
|
||||
}
|
||||
return tempList
|
||||
}
|
||||
|
||||
private fun logViewDestroy() {
|
||||
logInfoView?.let {
|
||||
it.dismiss()
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.upgrade
|
||||
|
||||
|
||||
import android.content.Context
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.TextView
|
||||
import androidx.recyclerview.widget.RecyclerView.Adapter
|
||||
import androidx.recyclerview.widget.RecyclerView.ViewHolder
|
||||
import com.mogo.eagle.core.data.upgrade.UpgradeVersionEntity
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.function.hmi.ui.upgrade.UpgradeListAdapter.UpgradeListHolder
|
||||
|
||||
/**
|
||||
* @author XuXinChao
|
||||
* @description APK升级包列表适配器
|
||||
* @since: 2022/3/25
|
||||
*/
|
||||
class UpgradeListAdapter: Adapter<UpgradeListHolder> {
|
||||
|
||||
private var context: Context? = null
|
||||
private var data:List<UpgradeVersionEntity>? = null
|
||||
private var clickListener: ClickListener? = null
|
||||
|
||||
constructor(
|
||||
context: Context,
|
||||
data: List<UpgradeVersionEntity>?,
|
||||
clickListener: ClickListener? = null
|
||||
) {
|
||||
this.context = context
|
||||
this.data = data
|
||||
this.clickListener = clickListener
|
||||
}
|
||||
|
||||
public fun setDada( data: List<UpgradeVersionEntity>?){
|
||||
this.data = data
|
||||
}
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): UpgradeListHolder {
|
||||
val view = LayoutInflater.from(parent.context)
|
||||
.inflate(R.layout.item_upgrade_version, parent, false)
|
||||
return UpgradeListHolder(view)
|
||||
}
|
||||
|
||||
override fun onBindViewHolder(holder: UpgradeListHolder, position: Int) {
|
||||
data?.let {
|
||||
val upgradeVersionEntity = it[position]
|
||||
holder.tvUpgradeApkName.text=upgradeVersionEntity.name
|
||||
holder.tvUpgradeApkName.setOnClickListener {
|
||||
clickListener?.downloadApk(upgradeVersionEntity.name,upgradeVersionEntity.url)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun getItemCount() = data?.size ?: 0
|
||||
|
||||
class UpgradeListHolder(itemView: View) : ViewHolder(itemView) {
|
||||
var tvUpgradeApkName: TextView = itemView.findViewById(R.id.tvUpgradeApkName)
|
||||
}
|
||||
|
||||
interface ClickListener{
|
||||
fun downloadApk(name:String,url:String)
|
||||
}
|
||||
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 2.1 KiB |
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginEnd="10dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvUpgradeApkName"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="16sp"
|
||||
android:textColor="@color/color_FF2966EC"
|
||||
android:padding="10dp"
|
||||
/>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="#F0F0F0"
|
||||
android:layout_marginTop="3dp"
|
||||
android:layout_marginBottom="3dp"/>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
@@ -118,7 +118,7 @@
|
||||
|
||||
</ScrollView>
|
||||
|
||||
<ScrollView
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:id="@+id/svLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
@@ -1538,9 +1538,105 @@
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<ToggleButton
|
||||
android:id="@+id/btnApkCenter"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="@dimen/dp_10"
|
||||
android:background="@drawable/radio_button_normal_background_right"
|
||||
android:drawableEnd="@drawable/icon_right"
|
||||
android:padding="@dimen/dp_20"
|
||||
android:textOff="应用包管理中心"
|
||||
android:textOn="应用包管理中心"
|
||||
/>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/apkCenterLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivApkSearch"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
android:src="@drawable/icon_search"
|
||||
android:padding="10dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatEditText
|
||||
android:id="@+id/etApkSearch"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toLeftOf="@id/ivApkSearch"
|
||||
app:layout_constraintTop_toTopOf="@id/ivApkSearch"
|
||||
app:layout_constraintBottom_toBottomOf="@id/ivApkSearch"
|
||||
android:layout_marginStart="@dimen/dp_30"
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
android:layout_marginEnd="@dimen/dp_20"
|
||||
android:layout_marginBottom="@dimen/dp_10"
|
||||
android:background="@drawable/debug_setting_edit_bg"
|
||||
android:gravity="center"
|
||||
android:textColor="#1A1A1A"
|
||||
android:textSize="14sp"
|
||||
android:hint="请输入搜索关键字如版本号等"
|
||||
/>
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/cbApkOnline"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="@dimen/dp_10"
|
||||
android:text="Online"
|
||||
android:textColor="#000"
|
||||
android:textSize="@dimen/dp_24"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toLeftOf="@id/cbApkQa"
|
||||
app:layout_constraintTop_toBottomOf="@id/ivApkSearch"
|
||||
android:checked="true"
|
||||
/>
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/cbApkQa"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="@dimen/dp_10"
|
||||
android:text="QA"
|
||||
android:textColor="#000"
|
||||
android:textSize="@dimen/dp_24"
|
||||
app:layout_constraintLeft_toRightOf="@id/cbApkOnline"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/ivApkSearch"
|
||||
android:checked="true"
|
||||
/>
|
||||
|
||||
<View
|
||||
android:id="@+id/apkSearchDivider"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="#F0F0F0"
|
||||
app:layout_constraintTop_toBottomOf="@id/cbApkQa"
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
/>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rvUpgradeVersionList"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toBottomOf="@id/apkSearchDivider"
|
||||
android:nestedScrollingEnabled="false"
|
||||
/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</ScrollView>
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
Reference in New Issue
Block a user