diff --git a/core/function-impl/mogo-core-function-check/build.gradle b/core/function-impl/mogo-core-function-check/build.gradle index 42995ca6df..5395c43d34 100644 --- a/core/function-impl/mogo-core-function-check/build.gradle +++ b/core/function-impl/mogo-core-function-check/build.gradle @@ -43,6 +43,7 @@ dependencies { implementation rootProject.ext.dependencies.callchatprovider implementation rootProject.ext.dependencies.coroutinesandroid implementation rootProject.ext.dependencies.coroutinescore + implementation rootProject.ext.dependencies.rxandroid implementation rootProject.ext.dependencies.kotlinstdlibjdk7 implementation 'com.google.android.material:material:1.2.1' implementation project(':modules:mogo-module-common') diff --git a/core/function-impl/mogo-core-function-check/src/main/java/com/mogo/eagle/core/function/check/net/CheckApiServiceFactory.java b/core/function-impl/mogo-core-function-check/src/main/java/com/mogo/eagle/core/function/check/net/CheckApiServiceFactory.java index 6fb9e487e7..b7b459cf93 100644 --- a/core/function-impl/mogo-core-function-check/src/main/java/com/mogo/eagle/core/function/check/net/CheckApiServiceFactory.java +++ b/core/function-impl/mogo-core-function-check/src/main/java/com/mogo/eagle/core/function/check/net/CheckApiServiceFactory.java @@ -1,4 +1,10 @@ package com.mogo.eagle.core.function.check.net; +import android.content.Context; + +import com.alibaba.android.arouter.launcher.ARouter; +import com.mogo.module.common.constants.HostConst; +import com.mogo.service.MogoServicePaths; +import com.mogo.service.network.IMogoNetwork; /** * @author liujing @@ -6,5 +12,97 @@ package com.mogo.eagle.core.function.check.net; * @since: 8/13/21 */ public class CheckApiServiceFactory { + private static CheckApiServices mDevaApiService; + private static CheckApiServices mDataApiService; + private static CheckApiServices mLauncherSnapshotApiService; + private static CheckApiServices mGeoFenceCarServiceApiService; + private static CheckApiServices mRealtimeLocationApiService; + private static CheckApiServices mDataServiceApiService; + + /** + * 获取指定域名下的 API 服务 + */ + public static CheckApiServices getApiService(Context context, String netHost) { + IMogoNetwork network = (IMogoNetwork) ARouter.getInstance() + .build(MogoServicePaths.PATH_SERVICES_NETWORK) + .navigation(context); + return network.create(CheckApiServices.class, netHost); + } + + public static CheckApiServices getDevaApiService(Context context) { + if (mDevaApiService == null) { + synchronized (CheckApiServiceFactory.class) { + if (mDevaApiService == null) { + mDevaApiService = getApiService(context, HostConst.DEVA_HOST); + } + } + } + return mDevaApiService; + } + + public static CheckApiServices getDataApiService(Context context) { + if (mDataApiService == null) { + synchronized (CheckApiServiceFactory.class) { + if (mDataApiService == null) { + mDataApiService = getApiService(context, HostConst.DATA_SERVICE_HOST); + } + } + } + return mDataApiService; + } + + public static CheckApiServices getLauncherSnapshotApiService(Context context) { + if (mLauncherSnapshotApiService == null) { + synchronized (CheckApiServiceFactory.class) { + if (mLauncherSnapshotApiService == null) { + mLauncherSnapshotApiService = getApiService(context, HostConst.LAUNCHER_SNAPSHOT_HOST); + } + } + } + return mLauncherSnapshotApiService; + } + + public static CheckApiServices getGeoFenceCarServiceApiService(Context context) { + if (mGeoFenceCarServiceApiService == null) { + synchronized (CheckApiServiceFactory.class) { + if (mGeoFenceCarServiceApiService == null) { + mGeoFenceCarServiceApiService = getApiService(context, HostConst.GEOFENCE_HOST); + } + } + } + return mGeoFenceCarServiceApiService; + } + + public static CheckApiServices getRealtimeLocationApiService(Context context) { + if (mRealtimeLocationApiService == null) { + synchronized (CheckApiServiceFactory.class) { + if (mRealtimeLocationApiService == null) { + mRealtimeLocationApiService = getApiService(context, HostConst.REALTIME_LOCATION_HOST); + } + } + } + return mRealtimeLocationApiService; + } + + public static CheckApiServices getDataServiceApiService(Context context) { + if (mDataServiceApiService == null) { + synchronized (CheckApiServiceFactory.class) { + if (mDataServiceApiService == null) { + mDataServiceApiService = getApiService(context, HostConst.DATA_SERVICE_HOST); + } + } + } + return mDataServiceApiService; + } + public static CheckApiServices getStrategyPushApiService(Context context) { + if (mDataServiceApiService == null) { + synchronized (CheckApiServiceFactory.class) { + if (mDataServiceApiService == null) { + mDataServiceApiService = getApiService(context, HostConst.STRATEGY_PUSH_HOST); + } + } + } + return mDataServiceApiService; + } } diff --git a/core/function-impl/mogo-core-function-check/src/main/java/com/mogo/eagle/core/function/check/net/CheckApiServices.java b/core/function-impl/mogo-core-function-check/src/main/java/com/mogo/eagle/core/function/check/net/CheckApiServices.java index 71c4f94b30..5bd7b0afb7 100644 --- a/core/function-impl/mogo-core-function-check/src/main/java/com/mogo/eagle/core/function/check/net/CheckApiServices.java +++ b/core/function-impl/mogo-core-function-check/src/main/java/com/mogo/eagle/core/function/check/net/CheckApiServices.java @@ -1,9 +1,12 @@ package com.mogo.eagle.core.function.check.net; -import android.database.Observable; import java.util.Map; import retrofit2.http.FieldMap; +import retrofit2.http.FormUrlEncoded; +import retrofit2.http.GET; import retrofit2.http.POST; +import io.reactivex.Observable; +import retrofit2.http.QueryMap; /** * @author liujing @@ -12,6 +15,6 @@ import retrofit2.http.POST; */ public interface CheckApiServices { - @POST("/yycp-vehicle-management-service/monitor/reciveInfo") - Observable uploadCheckDetail(@FieldMap Map param); + @GET("/yycp-vehicle-management-service/monitor/license/detail") + Observable loadMonitorDetail(@QueryMap Map param); } diff --git a/core/function-impl/mogo-core-function-check/src/main/java/com/mogo/eagle/core/function/check/view/CheckActivity.java b/core/function-impl/mogo-core-function-check/src/main/java/com/mogo/eagle/core/function/check/view/CheckActivity.java index 4e55121023..3a0cedd546 100644 --- a/core/function-impl/mogo-core-function-check/src/main/java/com/mogo/eagle/core/function/check/view/CheckActivity.java +++ b/core/function-impl/mogo-core-function-check/src/main/java/com/mogo/eagle/core/function/check/view/CheckActivity.java @@ -20,28 +20,40 @@ import androidx.annotation.Nullable; import androidx.appcompat.app.AppCompatActivity; import androidx.recyclerview.widget.RecyclerView; +import com.mogo.cloud.passport.MoGoAiCloudClientConfig; +import com.mogo.commons.data.BaseData; +import com.mogo.commons.network.ParamsProvider; +import com.mogo.commons.network.SubscribeImpl; import com.mogo.commons.voice.AIAssist; import com.mogo.eagle.core.function.call.check.CallerCheckManager; import com.mogo.eagle.core.function.check.R; import com.mogo.eagle.core.function.check.model.CheckItemInfo; +import com.mogo.eagle.core.function.check.net.CheckApiServiceFactory; import com.mogo.module.common.view.ImageViewClipBounds; import com.mogo.module.common.view.SpacesItemDecoration; import com.mogo.module.service.receiver.MogoReceiver; import com.mogo.utils.CommonUtils; +import com.mogo.utils.network.RequestOptions; +import com.mogo.utils.network.utils.GsonUtil; import com.mogo.utils.network.utils.NetworkStatusUtil; import com.tencent.bugly.beta.Beta; import com.tencent.bugly.beta.UpgradeInfo; import java.math.BigDecimal; import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; import java.util.concurrent.TimeUnit; +import io.reactivex.android.schedulers.AndroidSchedulers; +import io.reactivex.schedulers.Schedulers; + /** * @author liujing * @description 车辆监控页面 * @since: 7/27/21 */ -public class CheckActivity extends AppCompatActivity { +public class CheckActivity extends AppCompatActivity { private static final String TAG = "CheckActivity"; private RecyclerView mRecyclerView; @@ -89,27 +101,14 @@ public class CheckActivity extends AppCompatActivity { mImageView.setOnClickListener(v -> { finish(); }); - //检测动画 animation(); - //版本检测 和系统检查放在第二期 -// versionCheckResult(); -// //系统检测 -// systemCheckResult(); - //软件检测 - software(); - //硬件检测 - hardware(); - //根据以上4个结果插入第一个元素(自动驾驶车辆是否存在风险) - topListTitle(); - + checkMonitor(); mRecyclerView = findViewById(R.id.check_list); mRecyclerView.setAdapter(new CheckAdapter(context, dataArrayList)); CheckLinearLayout linearLayoutManager = new CheckLinearLayout(this, CheckLinearLayout.VERTICAL, false); mRecyclerView.addItemDecoration(new SpacesItemDecoration((int) getResources().getDimension(R.dimen.check_item_space_vr))); mRecyclerView.setLayoutManager(linearLayoutManager); - - } /** @@ -118,17 +117,10 @@ public class CheckActivity extends AppCompatActivity { public static boolean checkMonitor() { dataArrayList.clear(); Log.d(TAG, "checkMonitor"); - //版本检测 -// versionCheckResult(); -// //系统检测 -// systemCheckResult(); - //软件检测 - software(); - //硬件检测 - hardware(); - //根据以上4个结果插入第一个元素(自动驾驶车辆是否存在风险) + loadDetail(); + //根据以上结果插入第一个元素(自动驾驶车辆是否存在风险) topListTitle(); - CallerCheckManager.updateMonitoringStatus(MogoReceiver.ACTION_CHECK_VEHICLE_MONITORING,false); + CallerCheckManager.updateMonitoringStatus(MogoReceiver.ACTION_CHECK_VEHICLE_MONITORING, false); return true; } @@ -248,309 +240,27 @@ public class CheckActivity extends AppCompatActivity { } } - /** - * **************************************************************************************版本检测 - */ - public static void versionCheckResult() { - ArrayList arrayVer = new ArrayList(); - //adas 检测指标 + //网络请求,获取自车检测结果(工控机上报云端) + public static void loadDetail() { + final Map query = new ParamsProvider.Builder(context) + .append("sn", MoGoAiCloudClientConfig.getInstance().getSn()) + .build(); + CheckApiServiceFactory.getDataApiService(context).loadMonitorDetail(query) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new SubscribeImpl(RequestOptions.create(context)) { + @Override + public void onSuccess(BaseData o) { + super.onSuccess(o); + Log.d(TAG, "车辆自检结果是:" + o.toString()); + } - //鹰眼当前版本 - String verCodeStr = CommonUtils.getVersionName(context, true); - Log.d(TAG, "版本检测结果:鹰眼" + verCodeStr); + @Override + public void onError(String message, int code) { + super.onError(message, code); + } + }); - //测试数据 - CheckItemInfo itemInfo = new CheckItemInfo(); - itemInfo.setViewTitle("版本检测:"); - itemInfo.setTitle("自动驾驶升级到\n 版本3.1.2.7"); - if ("不是最新版本" != null) { - itemInfo.setUsual(false); - itemInfo.setValue("版本升级"); - } else { - itemInfo.setUsual(true); - itemInfo.setValue("最新版本 无风险"); - } - arrayVer.add(itemInfo); - - CheckItemInfo yingyan = new CheckItemInfo(); - UpgradeInfo upgradeInfo = Beta.getUpgradeInfo(); - if (upgradeInfo == null) { - yingyan.setUsual(true); - yingyan.setTitle(" 鹰眼 \n版本" + verCodeStr); - yingyan.setValue("最新版本 无风险"); - } else { - yingyan.setUsual(false); - yingyan.setTitle(" 鹰眼升级到 \n版本" + upgradeInfo.versionName); - yingyan.setValue("版本升级"); - } - arrayVer.add(yingyan); - dataArrayList.add(arrayVer); - } - - /** - * **************************************************************************************系统检测 - */ - public static void systemCheckResult() { - ArrayList arrSys = new ArrayList(); - //网络 - netStatus(); - //电量 - float battery = CommonUtils.getBattery(context); - //cpu占比 - double cpu = CommonUtils.getCPU(packageName); - //内存占比 - double memory = CommonUtils.getMemory(packageName); - //风险状态 - CheckItemInfo itemInfo = new CheckItemInfo(); - itemInfo.setViewTitle("系统检测:"); - itemInfo.setTitle("自动驾驶系统"); - itemInfo.setUsual(false); - itemInfo.setValue("存在风险"); - ArrayList list = new ArrayList(); - //详细指标值 - CheckItemInfo.DetailItem item = new CheckItemInfo.DetailItem(); - item.setTitle("工控机链接状态"); - item.setValue("断开"); - list.add(item); - arrSys.add(itemInfo); - - //鹰眼测试数据 - CheckItemInfo yingyan = new CheckItemInfo(); - yingyan.setTitle("鹰眼软件"); - yingyan.setUsual(false); - yingyan.setValue("无风险"); - - CheckItemInfo.DetailItem netItem = new CheckItemInfo.DetailItem(); - netItem.setTitle("网络状态"); - netItem.setValue(String.valueOf(sNetWorkStatus.getSignalStrength())); - list.add(netItem); - - CheckItemInfo.DetailItem batteryItem = new CheckItemInfo.DetailItem(); - batteryItem.setTitle("电池状态"); - batteryItem.setValue(String.valueOf(battery)); - list.add(batteryItem); - - CheckItemInfo.DetailItem cpuItem = new CheckItemInfo.DetailItem(); - cpuItem.setTitle("CPU占比"); - cpuItem.setValue(String.valueOf(cpu)); - list.add(cpuItem); - - CheckItemInfo.DetailItem memoryItem = new CheckItemInfo.DetailItem(); - memoryItem.setTitle("内存占比"); - memoryItem.setValue(String.valueOf(memory)); - list.add(memoryItem); - yingyan.setItemList(list); - arrSys.add(yingyan); - - dataArrayList.add(arrSys); - - } - - /** - * 网络 - */ - public static NetworkStatusUtil.NetWorkStatus netStatus() { - //网络类型 - sNetWorkStatus = NetworkStatusUtil.networkState(context); - //网络强度 - if (sNetWorkStatus != null && sNetWorkStatus.getStatus() != null && sNetWorkStatus.getStatus() != "UNKNOWN") { - Log.d(TAG, "网络类型:" + sNetWorkStatus.getStatus() + "网络强度:" + sNetWorkStatus.getSignalStrength()); - if (sNetWorkStatus.getSignalStrength() <= -90) { - AIAssist.getInstance(context).speakTTSVoice("网络信号差"); - } - } else { - Log.d(TAG, "网络未连接"); - AIAssist.getInstance(context).speakTTSVoice("网络未连接"); - } - return sNetWorkStatus; - - } - - /** - * **************************************************************************************软件测试 - * 自动驾驶侧: - * 1、车控节点 - *

- * 2、轨迹地图加载节点 - *

- * 3、轨迹规划节点 - *

- * 4、定位转化节点 - *

- * 5、融合节点 - *

- * 6、yolov5节点(包含红绿灯检测) - *

- * 7、激光雷达渲染节点 - *

- * 8、摄像头驱动节点 - *

- * 9、gnss定位驱动节点 - *

- * 10、中激光驱动节点 - *

- * 11、左激光解码节点 - *

- * 12、左激光驱动节点 - *

- * 13、右激光解码节点 - *

- * 14、右激光驱动节点 - *

- * 15、监控节点 - *

- * 16、通讯交互节点 - *

- * 17、轨迹录制节点 - *

- * 18、can车辆控制节点 - *

- * 数据上报频率 什么数据的上报频率 - *

- * 时延 工控机->云 工控机->鹰眼 什么数据的时延 - */ - public static void software() { - ArrayList arrSoftware = new ArrayList(); - CheckItemInfo itemInfo = new CheckItemInfo(); - itemInfo.setViewTitle("软件检测:"); - itemInfo.setTitle("自动驾驶系统"); - itemInfo.setUsual(true); - itemInfo.setValue("无风险"); - arrSoftware.add(itemInfo); - - CheckItemInfo itemY = new CheckItemInfo(); - itemY.setTitle("鹰眼软件"); - itemY.setUsual(true); - itemY.setValue("无风险"); - arrSoftware.add(itemY); - dataArrayList.add(arrSoftware); - - time(); - } - - /** - * 时延 - * 需要产品确认哪些指标? 定位+周边识别? - */ - public static long time() { - - final long start = System.nanoTime(); - long adasDataTime = TimeUnit.NANOSECONDS.toMillis((System.nanoTime() - start)); - Log.i("ADAS数据延时", "接收数据 -> 发出 cost :" + adasDataTime + "ms"); - return adasDataTime; - } - - /** - * **************************************************************************************硬件测试 - * 1、主激光雷达 - *

- * 2、侧激光雷达-2个 - *

- * 3、ADAS长焦摄像头-前 - *

- * 4、ADAS广角摄像头-前 - *

- * 5、ADAS标准摄像头-前 - *

- * 6、ADAS广角摄像头-后 - *

- * 7、RTK设备 - *

- * 8、OBU设备 - *

- * 9、路由器 - */ - public static void hardware() { - ArrayList arrHardware = new ArrayList(); - CheckItemInfo itemInfo = new CheckItemInfo(); - itemInfo.setViewTitle("硬件检测:"); - itemInfo.setTitle("自动驾驶系统"); - itemInfo.setUsual(false); - - ArrayList detailItem = new ArrayList(); - CheckItemInfo.DetailItem padItem = new CheckItemInfo.DetailItem(); - padItem.setTitle("Pad"); - padItem.setValue("异常"); - detailItem.add(padItem); - - CheckItemInfo.DetailItem cameraTop = new CheckItemInfo.DetailItem(); - cameraTop.setTitle("摄像头_top"); - cameraTop.setValue("正常"); - detailItem.add(cameraTop); - - CheckItemInfo.DetailItem cameraMiddle = new CheckItemInfo.DetailItem(); - cameraMiddle.setTitle("摄像头_Middle"); - cameraMiddle.setValue("正常"); - detailItem.add(cameraMiddle); - - CheckItemInfo.DetailItem cameraBottom = new CheckItemInfo.DetailItem(); - cameraBottom.setTitle("摄像头_Bottom"); - cameraBottom.setValue("正常"); - detailItem.add(cameraBottom); - - CheckItemInfo.DetailItem zhuJiGuang = new CheckItemInfo.DetailItem(); - zhuJiGuang.setTitle("主机光雷达"); - zhuJiGuang.setValue("异常"); - detailItem.add(zhuJiGuang); - - - CheckItemInfo.DetailItem jiGuangLeft = new CheckItemInfo.DetailItem(); - jiGuangLeft.setTitle("左侧激光雷达"); - jiGuangLeft.setValue("异常"); - detailItem.add(jiGuangLeft); - - CheckItemInfo.DetailItem jiGuangRight = new CheckItemInfo.DetailItem(); - jiGuangRight.setTitle("右侧激光雷达"); - jiGuangRight.setValue("正常"); - detailItem.add(jiGuangRight); - - CheckItemInfo.DetailItem changjiao = new CheckItemInfo.DetailItem(); - changjiao.setTitle("ADAS长焦摄像头"); - changjiao.setValue("正常"); - detailItem.add(changjiao); - - CheckItemInfo.DetailItem guangJiaoFront = new CheckItemInfo.DetailItem(); - guangJiaoFront.setTitle("ADAS广焦摄像头-前"); - guangJiaoFront.setValue("正常"); - detailItem.add(guangJiaoFront); - - CheckItemInfo.DetailItem custom = new CheckItemInfo.DetailItem(); - custom.setTitle("ADAS标准摄像头"); - custom.setValue("正常"); - detailItem.add(custom); - - CheckItemInfo.DetailItem guangJiaoBe = new CheckItemInfo.DetailItem(); - guangJiaoBe.setTitle("ADAS广焦摄像头-后"); - guangJiaoBe.setValue("正常"); - detailItem.add(guangJiaoBe); - - CheckItemInfo.DetailItem rtk = new CheckItemInfo.DetailItem(); - rtk.setTitle("RTK设备"); - rtk.setValue("正常"); - detailItem.add(rtk); - - CheckItemInfo.DetailItem obu = new CheckItemInfo.DetailItem(); - obu.setTitle("OUB设备"); - obu.setValue("正常"); - detailItem.add(obu); - - CheckItemInfo.DetailItem luyou = new CheckItemInfo.DetailItem(); - luyou.setTitle("路由器"); - luyou.setValue("正常"); - detailItem.add(luyou); - itemInfo.setItemList(detailItem); - - arrHardware.add(itemInfo); - dataArrayList.add(arrHardware); - - } - - /** - * 检测指标上报 - */ - public void publishCheckDetail() { -// MogoApisHandler.getInstance().getApis().getNetworkApi().create(CheckApiServices.class, -// HostConst.DEVA_HOST).uploadCheckDetail(). } public static void start(Context context) { diff --git a/core/function-impl/mogo-core-function-check/src/main/java/com/mogo/eagle/core/function/check/view/CheckAdapter.java b/core/function-impl/mogo-core-function-check/src/main/java/com/mogo/eagle/core/function/check/view/CheckAdapter.java index f8e7a6b115..7d08970d31 100644 --- a/core/function-impl/mogo-core-function-check/src/main/java/com/mogo/eagle/core/function/check/view/CheckAdapter.java +++ b/core/function-impl/mogo-core-function-check/src/main/java/com/mogo/eagle/core/function/check/view/CheckAdapter.java @@ -12,10 +12,22 @@ import android.widget.TextView; import androidx.annotation.NonNull; import androidx.recyclerview.widget.RecyclerView; +import com.mogo.cloud.passport.MoGoAiCloudClientConfig; +import com.mogo.commons.data.BaseData; +import com.mogo.commons.network.ParamsProvider; +import com.mogo.commons.network.SubscribeImpl; import com.mogo.eagle.core.function.check.R; import com.mogo.eagle.core.function.check.model.CheckItemInfo; +import com.mogo.eagle.core.function.check.net.CheckApiServiceFactory; +import com.mogo.utils.network.RequestOptions; +import com.mogo.utils.network.utils.GsonUtil; import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; + +import io.reactivex.schedulers.Schedulers; +import io.reactivex.android.schedulers.AndroidSchedulers; /** * @author liujing @@ -41,10 +53,8 @@ public class CheckAdapter extends RecyclerView.Adapter if (position == 0) { return CheckItemInfo.CheckAdapterStyleEnum.ITEM_TYPE_CHECK_TITLE; - } else if (position == 1) { - return CheckItemInfo.CheckAdapterStyleEnum.ITEM_TYPE_CHECK_LIST; } - return CheckItemInfo.CheckAdapterStyleEnum.ITEM_TYPE_CHECK_IMAGE; + return CheckItemInfo.CheckAdapterStyleEnum.ITEM_TYPE_CHECK_LIST; } @NonNull @@ -56,12 +66,6 @@ public class CheckAdapter extends RecyclerView.Adapter CheckTitleViewHolder holder = new CheckTitleViewHolder(v); return holder; } - if (viewType == CheckItemInfo.CheckAdapterStyleEnum.ITEM_TYPE_CHECK_IMAGE) { - View v = mLayoutInflater.inflate(R.layout.check_hardware, parent, - false); - CheckImage holder = new CheckImage(v); - return holder; - } View v = mLayoutInflater.inflate(R.layout.check_list, parent, false); CheckListViewHolder holder = new CheckListViewHolder(v); @@ -99,17 +103,9 @@ public class CheckAdapter extends RecyclerView.Adapter //自动驾驶 iconAutoTitle = itemView.findViewById(R.id.icon_auto_title); autoRiskState = itemView.findViewById(R.id.auto_risk_state); - //鹰眼应用 - iconyingTitle = itemView.findViewById(R.id.icon_ying_title); - yingRiskState = itemView.findViewById(R.id.ying_risk_state); - itemView.setLongClickable(true); - itemView.setOnLongClickListener(v -> { - Log.d(TAG, "长按显示状态工具栏"); - Intent intent = new Intent(); - intent.putExtra("oper", 52); - return true; - }); + itemView.findViewById(R.id.auto_layout).setOnClickListener(v -> { + }); } } @@ -163,55 +159,8 @@ public class CheckAdapter extends RecyclerView.Adapter ((CheckTitleViewHolder) holder).errorImage.setImageResource(R.drawable.check_wrong); } } - } else if (position == dataArrayList.size() - 1) { - ((CheckListViewHolder) holder).viewTitle.setText("硬件检测:"); - if (list instanceof ArrayList) { - refreshHardware(holder, (ArrayList) list); - } } else { - if (list instanceof ArrayList && ((ArrayList) list).size() > 1) { - CheckItemInfo item = (CheckItemInfo) ((ArrayList) list).get(0); - ((CheckListViewHolder) holder).viewTitle.setText(item.getViewTitle()); - //自动驾驶 状态展示 - ((CheckListViewHolder) holder).iconAutoTitle.setText(item.getTitle()); - ((CheckListViewHolder) holder).autoRiskState.setText(item.getValue()); - if (item.isUsual() == true) { - ((CheckListViewHolder) holder).autoRiskState.setTextColor(mContext.getResources().getColor(R.color.check_little_btn_green)); - } else { - ((CheckListViewHolder) holder).autoRiskState.setTextColor(mContext.getResources().getColor(R.color.check_tip_error_color)); - } - if (position == 1) { - if (item.isUsual() == false) { - ((CheckListViewHolder) holder).autoRiskState.setTextColor(mContext.getResources().getColor(R.color.modules_commons_toast_text_color)); - ((CheckListViewHolder) holder).autoRiskState.setBackground(mContext.getResources().getDrawable(R.drawable.check_detail)); - ((CheckListViewHolder) holder).autoRiskState.setOnClickListener(v -> { - Log.d(TAG, "点击自动驾驶升级"); - }); - } else { - ((CheckListViewHolder) holder).autoRiskState.setTextColor(mContext.getResources().getColor(R.color.check_little_btn_green)); - } - } - //鹰眼 状态展示 - CheckItemInfo itemForYing = (CheckItemInfo) ((ArrayList) list).get(1); - ((CheckListViewHolder) holder).iconyingTitle.setText(itemForYing.getTitle()); - ((CheckListViewHolder) holder).yingRiskState.setText(itemForYing.getValue()); - if (itemForYing.isUsual() == true) { - ((CheckListViewHolder) holder).yingRiskState.setTextColor(mContext.getResources().getColor(R.color.check_little_btn_green)); - } else { - ((CheckListViewHolder) holder).yingRiskState.setTextColor(mContext.getResources().getColor(R.color.check_tip_error_color)); - } - if (position == 1) { - if (itemForYing.isUsual() == false) { - ((CheckListViewHolder) holder).yingRiskState.setTextColor(mContext.getResources().getColor(R.color.modules_commons_toast_text_color)); - ((CheckListViewHolder) holder).yingRiskState.setBackground(mContext.getResources().getDrawable(R.drawable.check_detail)); - ((CheckListViewHolder) holder).yingRiskState.setOnClickListener(v -> { - Log.d(TAG, "点击鹰眼升级"); - }); - } else { - ((CheckListViewHolder) holder).yingRiskState.setTextColor(mContext.getResources().getColor(R.color.check_little_btn_green)); - } - } - } + } } catch (Exception e) { e.printStackTrace(); diff --git a/core/function-impl/mogo-core-function-check/src/main/java/com/mogo/eagle/core/function/check/view/CheckListDialog.java b/core/function-impl/mogo-core-function-check/src/main/java/com/mogo/eagle/core/function/check/view/CheckListDialog.java new file mode 100644 index 0000000000..54b9fb53d7 --- /dev/null +++ b/core/function-impl/mogo-core-function-check/src/main/java/com/mogo/eagle/core/function/check/view/CheckListDialog.java @@ -0,0 +1,22 @@ +package com.mogo.eagle.core.function.check.view; + +import android.content.Context; + +import androidx.annotation.NonNull; + +import com.mogo.module.common.dialog.BaseFloatDialog; + +/** + * @author liujing + * @description 描述 + * @since: 9/22/21 + */ +public class CheckListDialog extends BaseFloatDialog { + public CheckListDialog(@NonNull Context context) { + super(context); + } + + public CheckListDialog(@NonNull Context context, int themeResId) { + super(context, themeResId); + } +} diff --git a/core/function-impl/mogo-core-function-check/src/main/res/layout/check_list.xml b/core/function-impl/mogo-core-function-check/src/main/res/layout/check_list.xml index 8f9869e6e8..483311ac87 100644 --- a/core/function-impl/mogo-core-function-check/src/main/res/layout/check_list.xml +++ b/core/function-impl/mogo-core-function-check/src/main/res/layout/check_list.xml @@ -3,7 +3,7 @@ xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="2360px" - android:layout_height="@dimen/dp_643" + android:layout_height="@dimen/dp_525" android:layout_marginStart="@dimen/dp_100" android:layout_marginTop="@dimen/dp_15" android:layout_marginEnd="@dimen/dp_100" @@ -30,8 +30,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="@dimen/dp_318" - android:layout_marginTop="@dimen/dp_78" - android:layout_marginBottom="@dimen/dp_108" + android:layout_marginTop="@dimen/dp_181" android:orientation="vertical" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintLeft_toLeftOf="parent" @@ -51,7 +50,7 @@ android:layout_gravity="center" android:layout_marginTop="@dimen/dp_22" android:maxLines="2" - android:text="自动驾驶升级到\n 版本" + android:text="自动驾驶" android:textColor="@color/module_commons_wm_dialog_text_textColor" android:textSize="@dimen/dp_42" app:layout_constraintTop_toBottomOf="@id/icon_auto" /> @@ -61,8 +60,9 @@ android:layout_width="@dimen/dp_260" android:layout_height="@dimen/dp_90" android:layout_gravity="center" - android:layout_marginTop="@dimen/dp_56" + android:layout_marginTop="@dimen/dp_20" android:gravity="center" + android:text="运行正常" android:textColor="@color/check_little_btn_green" android:textSize="@dimen/dp_36" app:layout_constraintTop_toTopOf="@+id/icon_auto_title" /> @@ -76,6 +76,7 @@ android:layout_marginTop="@dimen/dp_78" android:layout_marginBottom="@dimen/dp_108" android:orientation="vertical" + android:visibility="gone" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintLeft_toRightOf="@+id/auto_layout" app:layout_constraintTop_toBottomOf="@+id/title">