Merge branch 'dev_arch_opt_3.0' into dev_robosweeper-d_app-module_221230_1.1.0
This commit is contained in:
@@ -8,7 +8,7 @@ import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.mogo.commons.AbsMogoApplication
|
||||
import com.mogo.commons.debug.DebugConfig
|
||||
import com.mogo.eagle.core.data.EnvConfig
|
||||
import com.mogo.eagle.core.data.bindingcar.ModifyBindingcarInfo
|
||||
import com.mogo.eagle.core.data.deva.bindingcar.ModifyBindingcarInfo
|
||||
import com.mogo.eagle.core.data.constants.MogoServicePaths
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainLogParam
|
||||
import com.mogo.eagle.core.data.deva.scene.SceneModule
|
||||
@@ -30,6 +30,7 @@ import com.zhjt.mogo_core_function_devatools.mofang.MoFangManager.Companion.moFa
|
||||
import com.zhjt.mogo_core_function_devatools.monitor.MonitorManager
|
||||
import com.zhjt.mogo_core_function_devatools.monitor.db.MonitorDb
|
||||
import com.zhjt.mogo_core_function_devatools.monitor.db.MonitorDb.Companion.getDb
|
||||
import com.zhjt.mogo_core_function_devatools.report.IPCReportManager
|
||||
import com.zhjt.mogo_core_function_devatools.report.IPCReportManager.Companion.iPCReportManager
|
||||
import com.zhjt.mogo_core_function_devatools.scene.SceneManager.Companion.sceneManager
|
||||
import com.zhjt.mogo_core_function_devatools.status.StatusManager
|
||||
@@ -162,6 +163,10 @@ class DevaToolsProvider : IDevaToolsProvider {
|
||||
BadCaseManager.showBadCaseManagerWindow(context)
|
||||
}
|
||||
|
||||
override fun showReportListWindow(context: Context, isShow: Boolean) {
|
||||
iPCReportManager.showReportListWindow(context, isShow)
|
||||
}
|
||||
|
||||
override fun downLoadPackage(downloadKey: String, downloadUrl: String) {
|
||||
upgradeManager.downLoadPackage(mContext!!, downloadKey, downloadUrl)
|
||||
}
|
||||
|
||||
@@ -8,8 +8,8 @@ import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import androidx.recyclerview.widget.GridLayoutManager
|
||||
import com.mogo.eagle.core.data.badcase.RecordTypeEntity
|
||||
import com.mogo.eagle.core.data.badcase.TopicEntity
|
||||
import com.mogo.eagle.core.data.deva.badcase.RecordTypeEntity
|
||||
import com.mogo.eagle.core.data.deva.badcase.TopicEntity
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotRecordListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager
|
||||
|
||||
@@ -12,10 +12,10 @@ import android.view.View
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import bag_manager.BagManagerOuterClass
|
||||
import com.mogo.eagle.core.data.badcase.BagDescriptionEntity
|
||||
import com.mogo.eagle.core.data.badcase.BagInfoEntity
|
||||
import com.mogo.eagle.core.data.badcase.BagManagerEntity
|
||||
import com.mogo.eagle.core.data.badcase.SubBagEntity
|
||||
import com.mogo.eagle.core.data.deva.badcase.BagDescriptionEntity
|
||||
import com.mogo.eagle.core.data.deva.badcase.BagInfoEntity
|
||||
import com.mogo.eagle.core.data.deva.badcase.BagManagerEntity
|
||||
import com.mogo.eagle.core.data.deva.badcase.SubBagEntity
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotRecordListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager
|
||||
@@ -425,7 +425,7 @@ class BadCaseManagerView @JvmOverloads constructor(
|
||||
if(titleBagInfo.itemType == 1){
|
||||
val bagIterator = bagManagerEntity.bagsInfoResp.iterator()
|
||||
var hasBag = false
|
||||
var bagBagInfo: BagInfoEntity ?= null
|
||||
var bagBagInfo: BagInfoEntity?= null
|
||||
while(bagIterator.hasNext()){
|
||||
bagBagInfo = bagIterator.next()
|
||||
if(bagBagInfo.itemType == 0){
|
||||
|
||||
@@ -9,7 +9,7 @@ import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.mogo.eagle.core.data.badcase.RecordCaseEntity;
|
||||
import com.mogo.eagle.core.data.deva.badcase.RecordCaseEntity;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotRecordListener;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager;
|
||||
|
||||
@@ -14,8 +14,8 @@ import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.mogo.eagle.core.data.badcase.RecordTypeEntity;
|
||||
import com.mogo.eagle.core.data.badcase.TopicEntity;
|
||||
import com.mogo.eagle.core.data.deva.badcase.RecordTypeEntity;
|
||||
import com.mogo.eagle.core.data.deva.badcase.TopicEntity;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotRecordListener;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager;
|
||||
|
||||
@@ -13,10 +13,10 @@ import android.widget.ImageView
|
||||
import android.widget.TextView
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
|
||||
import com.mogo.eagle.core.data.app.AppConfigInfo
|
||||
import com.mogo.eagle.core.data.badcase.BagDescriptionEntity
|
||||
import com.mogo.eagle.core.data.badcase.BagInfoEntity
|
||||
import com.mogo.eagle.core.data.badcase.BagManagerEntity
|
||||
import com.mogo.eagle.core.data.badcase.RecordCaseEntity
|
||||
import com.mogo.eagle.core.data.deva.badcase.BagDescriptionEntity
|
||||
import com.mogo.eagle.core.data.deva.badcase.BagInfoEntity
|
||||
import com.mogo.eagle.core.data.deva.badcase.BagManagerEntity
|
||||
import com.mogo.eagle.core.data.deva.badcase.RecordCaseEntity
|
||||
import com.mogo.eagle.core.data.map.MogoLocation
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotRecordListener
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationWGS84Listener
|
||||
|
||||
@@ -17,8 +17,8 @@ import android.widget.TextView
|
||||
import com.google.android.flexbox.FlexboxLayout
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
|
||||
import com.mogo.eagle.core.data.app.AppConfigInfo
|
||||
import com.mogo.eagle.core.data.badcase.BagDescriptionEntity
|
||||
import com.mogo.eagle.core.data.badcase.BagManagerEntity
|
||||
import com.mogo.eagle.core.data.deva.badcase.BagDescriptionEntity
|
||||
import com.mogo.eagle.core.data.deva.badcase.BagManagerEntity
|
||||
import com.mogo.eagle.core.data.map.MogoLocation
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
|
||||
import com.mogo.eagle.core.data.msgbox.RecordBagMsg
|
||||
|
||||
@@ -10,8 +10,8 @@ import android.widget.EditText
|
||||
import android.widget.ImageView
|
||||
import android.widget.TextView
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.mogo.eagle.core.data.badcase.BagDescriptionEntity
|
||||
import com.mogo.eagle.core.data.badcase.BagInfoEntity
|
||||
import com.mogo.eagle.core.data.deva.badcase.BagDescriptionEntity
|
||||
import com.mogo.eagle.core.data.deva.badcase.BagInfoEntity
|
||||
import com.zhjt.mogo_core_function_devatools.R
|
||||
import java.text.DecimalFormat
|
||||
|
||||
@@ -163,7 +163,7 @@ class BagManagerListAdapter: RecyclerView.Adapter<RecyclerView.ViewHolder>() {
|
||||
|
||||
interface BagClickListener{
|
||||
//选择Bag包
|
||||
fun onClick(bagInfoEntity: BagInfoEntity,isChecked: Boolean)
|
||||
fun onClick(bagInfoEntity: BagInfoEntity, isChecked: Boolean)
|
||||
//上报BI平台
|
||||
fun uploadBI(bagInfoEntity: BagInfoEntity)
|
||||
//编辑Bag包描述信息
|
||||
|
||||
@@ -5,7 +5,7 @@ import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.TextView
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.mogo.eagle.core.data.badcase.RecordCaseEntity
|
||||
import com.mogo.eagle.core.data.deva.badcase.RecordCaseEntity
|
||||
import com.zhjt.mogo_core_function_devatools.R
|
||||
|
||||
/**
|
||||
|
||||
@@ -5,7 +5,7 @@ import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.TextView
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.mogo.eagle.core.data.badcase.RecordTypeEntity
|
||||
import com.mogo.eagle.core.data.deva.badcase.RecordTypeEntity
|
||||
import com.zhjt.mogo_core_function_devatools.R
|
||||
|
||||
/**
|
||||
|
||||
@@ -5,7 +5,7 @@ import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.CheckBox
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.mogo.eagle.core.data.badcase.TopicEntity
|
||||
import com.mogo.eagle.core.data.deva.badcase.TopicEntity
|
||||
import com.zhjt.mogo_core_function_devatools.R
|
||||
|
||||
/**
|
||||
@@ -61,7 +61,7 @@ class TopicListAdapter: RecyclerView.Adapter<TopicListAdapter.TopicListHolder>()
|
||||
}
|
||||
}
|
||||
|
||||
private fun moveItem(topicEntity: TopicEntity,removePos: Int,insertedPos: Int){
|
||||
private fun moveItem(topicEntity: TopicEntity, removePos: Int, insertedPos: Int){
|
||||
data?.remove(topicEntity)
|
||||
notifyItemRemoved(removePos)
|
||||
notifyItemRangeChanged(removePos, itemCount - removePos)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.zhjt.mogo_core_function_devatools.badcase.consts
|
||||
|
||||
import com.mogo.eagle.core.data.badcase.BagInfoEntity
|
||||
import com.mogo.eagle.core.data.deva.badcase.BagInfoEntity
|
||||
|
||||
/**
|
||||
* @author XuXinChao
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.zhjt.mogo_core_function_devatools.binding;
|
||||
|
||||
import com.mogo.eagle.core.data.bindingcar.BindingCarInfo;
|
||||
import com.mogo.eagle.core.data.bindingcar.ModifyBindingcarInfo;
|
||||
import com.mogo.eagle.core.data.deva.bindingcar.BindingCarInfo;
|
||||
import com.mogo.eagle.core.data.deva.bindingcar.ModifyBindingcarInfo;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import okhttp3.RequestBody;
|
||||
|
||||
@@ -6,7 +6,7 @@ import android.util.Log
|
||||
import com.elegant.utils.UiThreadHandler
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
|
||||
import com.mogo.eagle.core.data.app.AppConfigInfo.role
|
||||
import com.mogo.eagle.core.data.bindingcar.ModifyBindingcarInfo
|
||||
import com.mogo.eagle.core.data.deva.bindingcar.ModifyBindingcarInfo
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.config.HmiBuildConfig
|
||||
import com.mogo.eagle.core.data.obu.MogoObuConst
|
||||
|
||||
@@ -4,9 +4,9 @@ import android.content.Context
|
||||
import com.mogo.commons.constants.HostConst
|
||||
import com.mogo.commons.constants.SharedPrefsConstants
|
||||
import com.mogo.commons.debug.DebugConfig
|
||||
import com.mogo.eagle.core.data.bindingcar.BindingCarInfo
|
||||
import com.mogo.eagle.core.data.bindingcar.BindingCarRequest
|
||||
import com.mogo.eagle.core.data.bindingcar.ModifyBindingcarInfo
|
||||
import com.mogo.eagle.core.data.deva.bindingcar.BindingCarInfo
|
||||
import com.mogo.eagle.core.data.deva.bindingcar.BindingCarRequest
|
||||
import com.mogo.eagle.core.data.deva.bindingcar.ModifyBindingcarInfo
|
||||
import com.mogo.eagle.core.data.config.HdMapBuildConfig
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager.showBindingCarDialog
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager.showModifyBindingCarDialog
|
||||
@@ -183,10 +183,6 @@ class BindingCarNetWorkManager private constructor() {
|
||||
CallerMapUIServiceManager.getMapUIController()?.changeCurrentIcon(R.raw.huanwei)
|
||||
HdMapBuildConfig.currentCarVrIconRes = R.raw.huanwei
|
||||
}
|
||||
else -> {
|
||||
CallerMapUIServiceManager.getMapUIController()?.changeCurrentIcon(R.raw.chuzuche)
|
||||
HdMapBuildConfig.currentCarVrIconRes = R.raw.chuzuche
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -9,8 +9,8 @@ import android.content.Intent
|
||||
import android.content.IntentFilter
|
||||
import android.view.KeyEvent
|
||||
import com.mogo.commons.context.ContextHolderUtil
|
||||
import com.mogo.eagle.core.data.mofang.MfConstants
|
||||
import com.mogo.eagle.core.function.api.mofang.IMoGoMoFangListener
|
||||
import com.mogo.eagle.core.data.deva.mofang.MfConstants
|
||||
import com.mogo.eagle.core.function.api.devatools.mofang.IMoGoMoFangListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager.sendOperatorChangeLaneLeft
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager.sendOperatorChangeLaneRight
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager.sendOperatorSetAcceleratedSpeed
|
||||
@@ -33,7 +33,7 @@ import java.util.*
|
||||
* 魔方连接状态和设备管理
|
||||
*/
|
||||
@SuppressLint("StaticFieldLeak")
|
||||
class MoFangManager private constructor() : IMoGoMoFangListener{
|
||||
class MoFangManager private constructor() : IMoGoMoFangListener {
|
||||
|
||||
companion object {
|
||||
val moFangManager: MoFangManager by lazy(mode = LazyThreadSafetyMode.SYNCHRONIZED) {
|
||||
@@ -163,7 +163,8 @@ class MoFangManager private constructor() : IMoGoMoFangListener{
|
||||
* 魔方按键处理
|
||||
*/
|
||||
override fun onMofangHandle(keyCode: Int, action: Int): Boolean {
|
||||
val bluetoothName = SharedPrefsMgr.getInstance(ContextHolderUtil.getContext()).getString(MfConstants.BLUETOOTH_NAME)
|
||||
val bluetoothName = SharedPrefsMgr.getInstance(ContextHolderUtil.getContext()).getString(
|
||||
MfConstants.BLUETOOTH_NAME)
|
||||
if (bluetoothName == "MINI_KEYBOARD") {
|
||||
if (!isPressEnd) {
|
||||
isPressEnd = true
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
package com.zhjt.mogo_core_function_devatools.report
|
||||
|
||||
import android.app.Activity
|
||||
import android.content.Context
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxType
|
||||
import com.mogo.eagle.core.data.report.ReportEntity
|
||||
import com.mogo.eagle.core.data.deva.report.ReportEntity
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
||||
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager
|
||||
@@ -37,6 +39,11 @@ class IPCReportManager : IMoGoAutopilotStatusListener {
|
||||
|
||||
}
|
||||
|
||||
//工控机上报列表悬浮窗
|
||||
private var reportListFloatWindow: ReportListFloatWindow? = null
|
||||
//工控机节点上报列表
|
||||
private val reportList = arrayListOf<ReportEntity>()
|
||||
|
||||
fun initServer(){
|
||||
//乘客屏不显示监控信息弹窗,只在司机端提示
|
||||
if(AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)){
|
||||
@@ -45,6 +52,19 @@ class IPCReportManager : IMoGoAutopilotStatusListener {
|
||||
}
|
||||
}
|
||||
|
||||
fun showReportListWindow(context: Context, isShow: Boolean){
|
||||
if(isShow){
|
||||
//打开工控机上报列表
|
||||
reportListFloatWindow =
|
||||
ReportListFloatWindow(context as Activity)
|
||||
reportListFloatWindow?.showFloatWindow()
|
||||
reportListFloatWindow?.refreshData(reportList)
|
||||
}else {
|
||||
//关闭工控机上报列表
|
||||
reportListFloatWindow?.hideFloatWindow()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*工控机监控节点上报
|
||||
*/
|
||||
@@ -61,6 +81,18 @@ class IPCReportManager : IMoGoAutopilotStatusListener {
|
||||
CallerMsgBoxManager.saveMsgBox(MsgBoxBean(MsgBoxType.REPORT, reportEntity))
|
||||
}
|
||||
|
||||
if (reportList.size > 49) {
|
||||
reportList.removeLast()
|
||||
}
|
||||
reportList.add(
|
||||
0,
|
||||
ReportEntity(
|
||||
TimeUtils.millis2String(System.currentTimeMillis()),
|
||||
it.src, it.level, it.msg, it.code, it.resultList, it.actionsList
|
||||
)
|
||||
)
|
||||
reportListFloatWindow?.refreshData(reportList)
|
||||
|
||||
// //Error 弹窗并有提示音
|
||||
// if(it.resultList.contains(RESULT_AUTOPILOT_DISABLE)
|
||||
// || it.resultList.contains(RESULT_AUTOPILOT_SYSTEM_UNSTARTED)
|
||||
|
||||
@@ -0,0 +1,107 @@
|
||||
package com.zhjt.mogo_core_function_devatools.report
|
||||
|
||||
import android.app.Activity
|
||||
import android.graphics.PixelFormat
|
||||
import android.util.DisplayMetrics
|
||||
import android.view.*
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.mogo.eagle.core.data.deva.report.ReportEntity
|
||||
import com.mogo.eagle.core.utilcode.util.BarUtils
|
||||
import com.zhjt.mogo_core_function_devatools.R
|
||||
import com.zhjt.mogo_core_function_devatools.report.adapter.ReportListAdapter
|
||||
|
||||
/**
|
||||
* @author XuXinChao
|
||||
* @description 工控机上报列表面板
|
||||
* @since: 2022/4/13
|
||||
*/
|
||||
class ReportListFloatWindow constructor(activity: Activity) : View.OnTouchListener{
|
||||
|
||||
private var mActivity: Activity = activity
|
||||
private var mWindowParams: WindowManager.LayoutParams? = null
|
||||
private var mWindowManager: WindowManager? = null
|
||||
private lateinit var rvReportList: RecyclerView
|
||||
private var reportListAdapter: ReportListAdapter?=null
|
||||
|
||||
private lateinit var mFloatLayout: View
|
||||
private var mInViewX = 0f
|
||||
private var mInViewY = 0f
|
||||
private var mDownInScreenX = 0f
|
||||
private var mDownInScreenY = 0f
|
||||
private var mInScreenX = 0f
|
||||
private var mInScreenY = 0f
|
||||
|
||||
init {
|
||||
initFloatWindow();
|
||||
}
|
||||
|
||||
private fun initFloatWindow() {
|
||||
mFloatLayout = LayoutInflater.from(mActivity).inflate(R.layout.view_report_list, null) as View
|
||||
mFloatLayout.setOnTouchListener(this)
|
||||
rvReportList= mFloatLayout.findViewById(R.id.rv_report_list)
|
||||
mWindowParams = WindowManager.LayoutParams()
|
||||
mWindowManager = mActivity.windowManager
|
||||
mWindowParams?.let {
|
||||
it.format = PixelFormat.RGBA_8888
|
||||
it.flags = WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE
|
||||
it.gravity = Gravity.START or Gravity.TOP
|
||||
it.width = 800
|
||||
it.height = 1000
|
||||
it.alpha = 0.9f
|
||||
}
|
||||
reportListAdapter= ReportListAdapter(mActivity)
|
||||
rvReportList.layoutManager = LinearLayoutManager(mActivity,
|
||||
LinearLayoutManager.VERTICAL,false)
|
||||
rvReportList.adapter = reportListAdapter
|
||||
}
|
||||
|
||||
fun refreshData(data:List<ReportEntity>){
|
||||
reportListAdapter?.setDada(data)
|
||||
reportListAdapter?.notifyDataSetChanged()
|
||||
}
|
||||
|
||||
override fun onTouch(v: View?, motionEvent: MotionEvent?): Boolean {
|
||||
when (motionEvent?.action) {
|
||||
MotionEvent.ACTION_DOWN -> {
|
||||
// 获取相对View的坐标,即以此View左上角为原点
|
||||
mInViewX = motionEvent.x
|
||||
mInViewY = motionEvent.y
|
||||
// 获取相对屏幕的坐标,即以屏幕左上角为原点
|
||||
mDownInScreenX = motionEvent.rawX
|
||||
mDownInScreenY = motionEvent.rawY - BarUtils.getStatusBarHeight()
|
||||
mInScreenX = motionEvent.rawX
|
||||
mInScreenY = motionEvent.rawY - BarUtils.getStatusBarHeight()
|
||||
}
|
||||
MotionEvent.ACTION_MOVE -> {
|
||||
// 更新浮动窗口位置参数
|
||||
mInScreenX = motionEvent.rawX
|
||||
mInScreenY = motionEvent.rawY - BarUtils.getStatusBarHeight()
|
||||
mWindowParams!!.x = (mInScreenX - mInViewX).toInt()
|
||||
mWindowParams!!.y = (mInScreenY - mInViewY).toInt()
|
||||
// 手指移动的时候更新小悬浮窗的位置
|
||||
mWindowManager!!.updateViewLayout(mFloatLayout, mWindowParams)
|
||||
}
|
||||
// MotionEvent.ACTION_UP -> // 如果手指离开屏幕时,xDownInScreen和xInScreen相等,且yDownInScreen和yInScreen相等,则视为触发了单击事件。
|
||||
// if (mDownInScreenX === mInScreenX && mDownInScreenY === mInScreenY) {
|
||||
// }
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
fun showFloatWindow() {
|
||||
if (mFloatLayout.parent == null) {
|
||||
val metrics = DisplayMetrics()
|
||||
// 默认固定位置,靠屏幕右边缘的中间
|
||||
mWindowManager!!.defaultDisplay.getMetrics(metrics)
|
||||
mWindowParams!!.x = metrics.widthPixels
|
||||
mWindowParams!!.y = metrics.heightPixels / 2 - BarUtils.getStatusBarHeight()
|
||||
mWindowManager!!.addView(mFloatLayout, mWindowParams)
|
||||
}
|
||||
}
|
||||
|
||||
fun hideFloatWindow() {
|
||||
if (mFloatLayout.parent != null) mWindowManager!!.removeView(mFloatLayout)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
package com.zhjt.mogo_core_function_devatools.report.adapter
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Context
|
||||
import android.graphics.Color
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.TextView
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.mogo.eagle.core.data.deva.report.ReportEntity
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
|
||||
import com.zhjt.mogo_core_function_devatools.R
|
||||
|
||||
/**
|
||||
* @author XuXinChao
|
||||
* @description 工控机上报列表适配器
|
||||
* @since: 2022/4/13
|
||||
*/
|
||||
class ReportListAdapter(context: Context) :
|
||||
RecyclerView.Adapter<ReportListAdapter.ReportListHolder>() {
|
||||
|
||||
private var context: Context? = context
|
||||
private var data:List<ReportEntity>? = null
|
||||
|
||||
public fun setDada( data: List<ReportEntity>?){
|
||||
this.data = data
|
||||
}
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ReportListHolder {
|
||||
val view = LayoutInflater.from(parent.context)
|
||||
.inflate(R.layout.item_report_detail, parent, false)
|
||||
return ReportListHolder(view)
|
||||
}
|
||||
|
||||
@SuppressLint("SetTextI18n")
|
||||
override fun onBindViewHolder(holder: ReportListHolder, position: Int) {
|
||||
data?.let { it ->
|
||||
val reportEntity = it[position]
|
||||
reportEntity.let {
|
||||
holder.tvReportTime.text = "上报时间:${it.time}"
|
||||
holder.tvReportSrc.text = "src:${it.src}"
|
||||
holder.tvReportLevel.text = "level:${it.level}"
|
||||
holder.tvReportMsg.text = "msg:${it.msg}"
|
||||
holder.tvReportCode.text = "code:${it.code}"
|
||||
var resultStr = "result:"
|
||||
for (result in it.resultList) {
|
||||
resultStr = "$resultStr$result${CallerAutoPilotControlManager.getReportResultDesc(result)} "
|
||||
}
|
||||
holder.tvReportResult.text = resultStr
|
||||
var actionStr = "action:"
|
||||
for (action in it.actionsList) {
|
||||
actionStr = "$actionStr$action${CallerAutoPilotControlManager.getReportActionDesc(action)} "
|
||||
}
|
||||
holder.tvReportActions.text = actionStr
|
||||
|
||||
if ("error" == it.level) {
|
||||
//字体为红色,吐司提示
|
||||
holder.tvReportTime.setTextColor(Color.RED)
|
||||
holder.tvReportSrc.setTextColor(Color.RED)
|
||||
holder.tvReportLevel.setTextColor(Color.RED)
|
||||
holder.tvReportMsg.setTextColor(Color.RED)
|
||||
holder.tvReportCode.setTextColor(Color.RED)
|
||||
holder.tvReportResult.setTextColor(Color.RED)
|
||||
holder.tvReportActions.setTextColor(Color.RED)
|
||||
} else {
|
||||
holder.tvReportTime.setTextColor(Color.WHITE)
|
||||
holder.tvReportSrc.setTextColor(Color.WHITE)
|
||||
holder.tvReportLevel.setTextColor(Color.WHITE)
|
||||
holder.tvReportMsg.setTextColor(Color.WHITE)
|
||||
holder.tvReportCode.setTextColor(Color.WHITE)
|
||||
holder.tvReportResult.setTextColor(Color.WHITE)
|
||||
holder.tvReportActions.setTextColor(Color.WHITE)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
override fun getItemCount() = data?.size ?: 0
|
||||
|
||||
class ReportListHolder(itemView: View) : RecyclerView.ViewHolder(itemView){
|
||||
var tvReportTime: TextView = itemView.findViewById(R.id.tvReportTime)
|
||||
var tvReportSrc: TextView = itemView.findViewById(R.id.tvReportSrc)
|
||||
var tvReportLevel: TextView = itemView.findViewById(R.id.tvReportLevel)
|
||||
var tvReportMsg: TextView = itemView.findViewById(R.id.tvReportMsg)
|
||||
var tvReportCode: TextView = itemView.findViewById(R.id.tvReportCode)
|
||||
var tvReportResult: TextView = itemView.findViewById(R.id.tvReportResult)
|
||||
var tvReportActions: TextView = itemView.findViewById(R.id.tvReportActions)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -5,7 +5,7 @@ import com.mogo.aicloud.services.socket.IMogoOnMessageListener
|
||||
import com.mogo.aicloud.services.socket.MogoAiCloudSocketManager
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClient
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo
|
||||
import com.mogo.eagle.core.data.bindingcar.IPCUpgradeStateInfo
|
||||
import com.mogo.eagle.core.data.deva.bindingcar.IPCUpgradeStateInfo
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsListenerManager
|
||||
|
||||
@@ -3,18 +3,16 @@ package com.zhjt.mogo_core_function_devatools.upgrade;
|
||||
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_BINDING;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.Log;
|
||||
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
|
||||
import com.mogo.commons.constants.HostConst;
|
||||
import com.mogo.eagle.core.data.bindingcar.UpgradeAppInfo;
|
||||
import com.mogo.eagle.core.data.obu.MogoObuConst;
|
||||
import com.mogo.eagle.core.data.deva.bindingcar.UpgradeAppInfo;
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager;
|
||||
import com.mogo.eagle.core.function.call.obu.CallerObuApiManager;
|
||||
import com.mogo.eagle.core.network.MoGoRetrofitFactory;
|
||||
import com.mogo.eagle.core.network.utils.GsonUtil;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.util.AppUtils;
|
||||
|
||||
import io.reactivex.Observer;
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.annotations.NonNull;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.zhjt.mogo_core_function_devatools.upgrade;
|
||||
|
||||
import com.mogo.eagle.core.data.bindingcar.UpgradeAppInfo;
|
||||
import com.mogo.eagle.core.data.deva.bindingcar.UpgradeAppInfo;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import okhttp3.RequestBody;
|
||||
|
||||
@@ -7,7 +7,7 @@ import android.content.Context;
|
||||
import com.elegant.utils.UiThreadHandler;
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
|
||||
import com.mogo.commons.constants.HostConst;
|
||||
import com.mogo.eagle.core.data.bindingcar.UpgradeAppInfo;
|
||||
import com.mogo.eagle.core.data.deva.bindingcar.UpgradeAppInfo;
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager;
|
||||
import com.mogo.eagle.core.network.MoGoRetrofitFactory;
|
||||
import com.mogo.eagle.core.network.utils.GsonUtil;
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.7 KiB |
@@ -0,0 +1,69 @@
|
||||
<?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">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvReportTime"
|
||||
android:textColor="#1A1A1A"
|
||||
android:textSize="24dp"
|
||||
android:layout_margin="@dimen/dp_10"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvReportSrc"
|
||||
android:textColor="#1A1A1A"
|
||||
android:textSize="24dp"
|
||||
android:layout_margin="@dimen/dp_10"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvReportLevel"
|
||||
android:textColor="#1A1A1A"
|
||||
android:textSize="24dp"
|
||||
android:layout_margin="@dimen/dp_10"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvReportMsg"
|
||||
android:textColor="#1A1A1A"
|
||||
android:textSize="24dp"
|
||||
android:layout_margin="@dimen/dp_10"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvReportCode"
|
||||
android:textColor="#1A1A1A"
|
||||
android:textSize="24dp"
|
||||
android:layout_margin="@dimen/dp_10"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvReportResult"
|
||||
android:textColor="#1A1A1A"
|
||||
android:textSize="24dp"
|
||||
android:layout_margin="@dimen/dp_10"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvReportActions"
|
||||
android:textColor="#1A1A1A"
|
||||
android:textSize="24dp"
|
||||
android:layout_margin="@dimen/dp_10"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="#F0F0F0" />
|
||||
|
||||
</LinearLayout>
|
||||
@@ -0,0 +1,31 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="840dp"
|
||||
android:layout_height="584dp"
|
||||
android:orientation="vertical"
|
||||
>
|
||||
|
||||
<ImageView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/icon_drag"
|
||||
android:padding="15dp"
|
||||
android:layout_gravity="center_horizontal"
|
||||
/>
|
||||
|
||||
<com.mogo.eagle.core.widget.RoundConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#3B4577"
|
||||
app:roundLayoutRadius="10dp">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv_report_list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
</com.mogo.eagle.core.widget.RoundConstraintLayout>
|
||||
|
||||
</LinearLayout>
|
||||
Reference in New Issue
Block a user