[add] 检测页面资源添加 自定义view添加
@@ -9,6 +9,9 @@ import java.util.ArrayList;
|
||||
* @since: 7/28/21
|
||||
*/
|
||||
public class CheckItemInfo implements Serializable {
|
||||
//view类型
|
||||
private int style;
|
||||
//view标题
|
||||
private String title;
|
||||
//项目指标描述 如:版本升级/存在风险等
|
||||
private String value;
|
||||
@@ -48,6 +51,14 @@ public class CheckItemInfo implements Serializable {
|
||||
this.usual = unusual;
|
||||
}
|
||||
|
||||
public int getStyle() {
|
||||
return style;
|
||||
}
|
||||
|
||||
public void setStyle(int style) {
|
||||
this.style = style;
|
||||
}
|
||||
|
||||
public static class DetailItem implements Serializable {
|
||||
private String title;
|
||||
private String value;
|
||||
@@ -68,130 +79,14 @@ public class CheckItemInfo implements Serializable {
|
||||
this.value = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 系统检测-鹰眼
|
||||
*/
|
||||
class SystemResultForYingYan implements Serializable {
|
||||
//版本
|
||||
private String version;
|
||||
//电量
|
||||
private String battery;
|
||||
//网络
|
||||
private String netStatus;
|
||||
//cpu占比
|
||||
private String cpu;
|
||||
//内存占比
|
||||
private String memory;
|
||||
|
||||
public String getVersion() {
|
||||
return version;
|
||||
}
|
||||
|
||||
public void setVersion(String version) {
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public String getBattery() {
|
||||
return battery;
|
||||
}
|
||||
|
||||
public void setBattery(String battery) {
|
||||
this.battery = battery;
|
||||
}
|
||||
|
||||
public String getNetStatus() {
|
||||
return netStatus;
|
||||
}
|
||||
|
||||
public void setNetStatus(String netStatus) {
|
||||
this.netStatus = netStatus;
|
||||
}
|
||||
|
||||
public String getCpu() {
|
||||
return cpu;
|
||||
}
|
||||
|
||||
public void setCpu(String cpu) {
|
||||
this.cpu = cpu;
|
||||
}
|
||||
|
||||
public String getMemory() {
|
||||
return memory;
|
||||
}
|
||||
|
||||
public void setMemory(String memory) {
|
||||
this.memory = memory;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "SystemResultForYingYan{" +
|
||||
"version='" + version + '\'' +
|
||||
", battery='" + battery + '\'' +
|
||||
", netStatus='" + netStatus + '\'' +
|
||||
", cpu='" + cpu + '\'' +
|
||||
", memory='" + memory + '\'' +
|
||||
'}';
|
||||
public interface CheckAdapterStyleEnum {
|
||||
int ITEM_TYPE_CHECK_TITLE = 0;
|
||||
int ITEM_TYPE_CHECK_LIST = 1;
|
||||
int ITEM_TYPE_CHECK_IMAGE = 2;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 系统检查-自动驾驶系统
|
||||
*/
|
||||
class SystemResultForADAS implements Serializable {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 软件检测-鹰眼
|
||||
*/
|
||||
class SoftwareForYingYan implements Serializable {
|
||||
//数据时延
|
||||
private long adasDataTime;
|
||||
//定位时延
|
||||
private long locationTime;
|
||||
|
||||
public long getAdasDataTime() {
|
||||
return adasDataTime;
|
||||
}
|
||||
|
||||
public void setAdasDataTime(long adasDataTime) {
|
||||
this.adasDataTime = adasDataTime;
|
||||
}
|
||||
|
||||
public long getLocationTime() {
|
||||
return locationTime;
|
||||
}
|
||||
|
||||
public void setLocationTime(long locationTime) {
|
||||
this.locationTime = locationTime;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "SoftwareForYingYan{" +
|
||||
"adasDataTime=" + adasDataTime +
|
||||
", locationTime=" + locationTime +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 软件检测-ADAS
|
||||
*/
|
||||
class SoftwareForADAS implements Serializable {
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 硬件检测-ADAS
|
||||
*/
|
||||
class HardwareForADAS implements Serializable {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -62,6 +62,8 @@ public class CheckActivity extends AppCompatActivity {
|
||||
software();
|
||||
//硬件
|
||||
hardware();
|
||||
//根据以上4个结果插入第一个元素
|
||||
usualTitle();
|
||||
|
||||
mRecyclerView = findViewById(R.id.check_list);
|
||||
mRecyclerView.setAdapter(new CheckAdapter(context, dataArrayList));
|
||||
@@ -73,6 +75,18 @@ public class CheckActivity extends AppCompatActivity {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 自动驾驶是否存在风险
|
||||
*/
|
||||
private void usualTitle() {
|
||||
ArrayList list = new ArrayList(1);
|
||||
CheckItemInfo info = new CheckItemInfo();
|
||||
info.setUsual(false);
|
||||
info.setStyle(CheckItemInfo.CheckAdapterStyleEnum.ITEM_TYPE_CHECK_TITLE);
|
||||
list.add(info);
|
||||
dataArrayList.add(0,list);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param context
|
||||
* @return 当前应用的版本名称
|
||||
@@ -152,25 +166,25 @@ public class CheckActivity extends AppCompatActivity {
|
||||
CheckItemInfo.DetailItem netItem = new CheckItemInfo.DetailItem();
|
||||
netItem.setTitle("网络状态");
|
||||
netItem.setValue(mSignalStrength);
|
||||
itemInfo.setItemList(netItem);
|
||||
yingyan.setItemList(netItem);
|
||||
|
||||
CheckItemInfo.DetailItem batteryItem = new CheckItemInfo.DetailItem();
|
||||
batteryItem.setTitle("电池状态");
|
||||
batteryItem.setValue(String.valueOf(battery));
|
||||
itemInfo.setItemList(batteryItem);
|
||||
yingyan.setItemList(batteryItem);
|
||||
|
||||
CheckItemInfo.DetailItem cpuItem = new CheckItemInfo.DetailItem();
|
||||
cpuItem.setTitle("CPU占比");
|
||||
cpuItem.setValue(String.valueOf(cpu));
|
||||
itemInfo.setItemList(cpuItem);
|
||||
yingyan.setItemList(cpuItem);
|
||||
|
||||
CheckItemInfo.DetailItem memoryItem = new CheckItemInfo.DetailItem();
|
||||
memoryItem.setTitle("内存占比");
|
||||
memoryItem.setValue(String.valueOf(memory));
|
||||
itemInfo.setItemList(cpuItem);
|
||||
|
||||
yingyan.setItemList(cpuItem);
|
||||
arrayList.add(yingyan);
|
||||
|
||||
dataArrayList.add(arrayList);
|
||||
|
||||
}
|
||||
|
||||
@@ -270,6 +284,7 @@ public class CheckActivity extends AppCompatActivity {
|
||||
* 9、路由器
|
||||
*/
|
||||
public void hardware() {
|
||||
ArrayList list = new ArrayList();
|
||||
CheckItemInfo itemInfo = new CheckItemInfo();
|
||||
itemInfo.setTitle("(下面 1 项存在异常)");
|
||||
itemInfo.setUsual(false);
|
||||
@@ -323,6 +338,8 @@ public class CheckActivity extends AppCompatActivity {
|
||||
luyou.setTitle("路由器");
|
||||
luyou.setValue("正常");
|
||||
itemInfo.setItemList(luyou);
|
||||
list.add(itemInfo);
|
||||
dataArrayList.add(list);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,12 +1,19 @@
|
||||
package com.mogo.module.check.view;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.mogo.module.check.R;
|
||||
import com.mogo.module.check.model.CheckItemInfo;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
@@ -16,18 +23,84 @@ import java.util.ArrayList;
|
||||
*/
|
||||
public class CheckAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
|
||||
|
||||
private static final String TAG = "CheckActivity";
|
||||
LayoutInflater mLayoutInflater;
|
||||
ArrayList dataArrayList;
|
||||
|
||||
public CheckAdapter(@NonNull Context context, @NonNull ArrayList checkArray){
|
||||
public CheckAdapter(@NonNull Context context, @NonNull ArrayList checkArray) {
|
||||
mLayoutInflater = LayoutInflater.from(context);
|
||||
dataArrayList = checkArray;
|
||||
Log.d(TAG, dataArrayList.toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemViewType(int position) {
|
||||
if (position == 0) {
|
||||
return CheckItemInfo.CheckAdapterStyleEnum.ITEM_TYPE_CHECK_TITLE;
|
||||
|
||||
} else if (position == 4) {
|
||||
return CheckItemInfo.CheckAdapterStyleEnum.ITEM_TYPE_CHECK_IMAGE;
|
||||
}
|
||||
return CheckItemInfo.CheckAdapterStyleEnum.ITEM_TYPE_CHECK_LIST;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
return null;
|
||||
if (viewType == CheckItemInfo.CheckAdapterStyleEnum.ITEM_TYPE_CHECK_TITLE) {
|
||||
View v = mLayoutInflater.inflate(R.layout.check_titel, parent,
|
||||
false);
|
||||
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);
|
||||
return holder;
|
||||
}
|
||||
|
||||
/**
|
||||
* 顶部view列表
|
||||
*/
|
||||
class CheckTitleViewHolder extends RecyclerView.ViewHolder {
|
||||
private ImageView errorImage;
|
||||
private TextView mTextView;
|
||||
|
||||
public CheckTitleViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
// errorImage = itemView.findViewById(R.id.error_image);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 顶部view列表
|
||||
*/
|
||||
class CheckListViewHolder extends RecyclerView.ViewHolder {
|
||||
private ImageView errorImage;
|
||||
private TextView mTextView;
|
||||
|
||||
public CheckListViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
// errorImage = itemView.findViewById(R.id.error_image);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 顶部view列表
|
||||
*/
|
||||
class CheckImage extends RecyclerView.ViewHolder {
|
||||
private ImageView mImageView;
|
||||
|
||||
public CheckImage(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
// errorImage = itemView.findViewById(R.id.error_image);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -37,6 +110,8 @@ public class CheckAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return 0;
|
||||
return 5;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
BIN
modules/mogo-module-check/src/main/res/drawable/auto.png
Normal file
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 3.3 KiB |
BIN
modules/mogo-module-check/src/main/res/drawable/camera_usual.png
Normal file
|
After Width: | Height: | Size: 4.7 KiB |
|
After Width: | Height: | Size: 6.2 KiB |
|
After Width: | Height: | Size: 5.4 KiB |
|
After Width: | Height: | Size: 4.7 KiB |
BIN
modules/mogo-module-check/src/main/res/drawable/obu_unusual.png
Normal file
|
After Width: | Height: | Size: 5.5 KiB |
BIN
modules/mogo-module-check/src/main/res/drawable/oub_usual.png
Normal file
|
After Width: | Height: | Size: 4.5 KiB |
BIN
modules/mogo-module-check/src/main/res/drawable/pad_unusual.png
Normal file
|
After Width: | Height: | Size: 5.6 KiB |
BIN
modules/mogo-module-check/src/main/res/drawable/rtk_unusual.png
Normal file
|
After Width: | Height: | Size: 5.3 KiB |
BIN
modules/mogo-module-check/src/main/res/drawable/rtk_usual.png
Normal file
|
After Width: | Height: | Size: 4.0 KiB |
BIN
modules/mogo-module-check/src/main/res/drawable/yingyan.png
Normal file
|
After Width: | Height: | Size: 22 KiB |
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 16 KiB |
53
modules/mogo-module-check/src/main/res/layout/check_list.xml
Normal file
@@ -0,0 +1,53 @@
|
||||
<?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:layout_width="2360px"
|
||||
android:layout_height="@dimen/dp_643">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_80"
|
||||
android:layout_marginLeft="@dimen/dp_50"
|
||||
android:layout_marginTop="@dimen/dp_50"
|
||||
android:text="版本检测:"
|
||||
android:textColor="@color/module_commons_wm_dialog_text_textColor"
|
||||
android:textSize="@dimen/dp_42"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/detail_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_50"
|
||||
android:text="(以下 1 项需要优化,版本升级后需要重启设备)"
|
||||
android:textColor="@color/module_commons_wm_dialog_text_textColor"
|
||||
android:textSize="@dimen/dp_42"
|
||||
app:layout_constraintLeft_toRightOf="@id/title"
|
||||
app:layout_constraintTop_toTopOf="@id/title" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/icon_auto"
|
||||
android:layout_width="@dimen/dp_150"
|
||||
android:layout_height="@dimen/dp_150"
|
||||
android:layout_marginStart="@dimen/dp_318"
|
||||
android:layout_marginTop="@dimen/dp_78"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
android:src="@drawable/auto"
|
||||
app:layout_constraintTop_toBottomOf="@+id/title" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/icon_auto_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_22"
|
||||
android:text="自动驾驶升级到版本3.1.2.7"
|
||||
android:textColor="@color/module_commons_wm_dialog_text_textColor"
|
||||
android:textSize="@dimen/dp_42"
|
||||
app:layout_constraintTop_toBottomOf="@id/icon_auto" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -0,0 +1,27 @@
|
||||
<?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"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/error_tip_image"
|
||||
android:layout_width="@dimen/dp_140"
|
||||
android:layout_height="@dimen/dp_140"
|
||||
android:layout_marginStart="@dimen/dp_856"
|
||||
android:layout_marginTop="@dimen/dp_250"
|
||||
android:src="@drawable/check_wrong"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/error_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_65"
|
||||
android:text="自动驾驶车辆存在风险"
|
||||
android:textColor="@color/module_commons_wm_dialog_text_textColor"
|
||||
android:textSize="@dimen/dp_64"
|
||||
app:layout_constraintLeft_toRightOf="@+id/error_tip_image"
|
||||
app:layout_constraintTop_toTopOf="@+id/error_tip_image" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||