测试数据
This commit is contained in:
@@ -11,9 +11,9 @@ import java.util.ArrayList;
|
||||
public class CheckItemInfo implements Serializable {
|
||||
//view类型
|
||||
private int style;
|
||||
//view标题
|
||||
//view标题 版本检测 系统检测...
|
||||
private String title;
|
||||
//项目指标描述 如:版本升级/存在风险等
|
||||
|
||||
private String value;
|
||||
private DetailItem itemList;
|
||||
//是否存在异常
|
||||
@@ -47,8 +47,8 @@ public class CheckItemInfo implements Serializable {
|
||||
return usual;
|
||||
}
|
||||
|
||||
public void setUsual(boolean unusual) {
|
||||
this.usual = unusual;
|
||||
public void setUsual(boolean usual) {
|
||||
this.usual = usual;
|
||||
}
|
||||
|
||||
public int getStyle() {
|
||||
|
||||
@@ -119,7 +119,7 @@ public class CheckActivity extends AppCompatActivity {
|
||||
//测试数据
|
||||
CheckItemInfo itemInfo = new CheckItemInfo();
|
||||
itemInfo.setUsual(true);
|
||||
itemInfo.setTitle("自动驾驶升级到版本3.1.2.7");
|
||||
itemInfo.setTitle("自动驾驶升级到\\n 版本3.1.2.7");
|
||||
if ("不是最新版本" != null) {
|
||||
itemInfo.setValue("版本升级");
|
||||
}
|
||||
@@ -127,7 +127,7 @@ public class CheckActivity extends AppCompatActivity {
|
||||
|
||||
CheckItemInfo yingyan = new CheckItemInfo();
|
||||
yingyan.setUsual(true);
|
||||
yingyan.setTitle("鹰眼版本3.2");
|
||||
yingyan.setTitle(" 鹰眼\\n版本" + verCodeStr);
|
||||
yingyan.setValue("最新版本 无风险");
|
||||
arrayList.add(yingyan);
|
||||
dataArrayList.add(arrayList);
|
||||
@@ -146,12 +146,12 @@ public class CheckActivity extends AppCompatActivity {
|
||||
double cpu = CommonUtils.getCPU(packageName);
|
||||
//内存占比
|
||||
double memory = CommonUtils.getMemory(packageName);
|
||||
//自动驾驶测试数据
|
||||
//风险状态
|
||||
CheckItemInfo itemInfo = new CheckItemInfo();
|
||||
itemInfo.setTitle("自动驾驶系统");
|
||||
itemInfo.setUsual(false);
|
||||
itemInfo.setValue("存在风险");
|
||||
|
||||
//详细指标值
|
||||
CheckItemInfo.DetailItem item = new CheckItemInfo.DetailItem();
|
||||
item.setTitle("工控机链接状态");
|
||||
item.setValue("断开");
|
||||
|
||||
@@ -26,8 +26,10 @@ public class CheckAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
|
||||
private static final String TAG = "CheckActivity";
|
||||
LayoutInflater mLayoutInflater;
|
||||
ArrayList dataArrayList;
|
||||
private Context mContext;
|
||||
|
||||
public CheckAdapter(@NonNull Context context, @NonNull ArrayList checkArray) {
|
||||
mContext = context;
|
||||
mLayoutInflater = LayoutInflater.from(context);
|
||||
dataArrayList = checkArray;
|
||||
Log.d(TAG, dataArrayList.toString());
|
||||
@@ -74,38 +76,110 @@ public class CheckAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
|
||||
|
||||
public CheckTitleViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
// errorImage = itemView.findViewById(R.id.error_image);
|
||||
errorImage = itemView.findViewById(R.id.error_tip_image);
|
||||
mTextView = itemView.findViewById(R.id.error_title);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 顶部view列表
|
||||
* 版本->软件检测
|
||||
*/
|
||||
class CheckListViewHolder extends RecyclerView.ViewHolder {
|
||||
private ImageView errorImage;
|
||||
private TextView mTextView;
|
||||
private TextView viewTitle;
|
||||
private TextView detailTitle;
|
||||
private TextView iconAutoTitle;
|
||||
private TextView autoRiskState;
|
||||
|
||||
private TextView yingDetailTitle;
|
||||
private TextView iconyingTitle;
|
||||
private TextView yingRiskState;
|
||||
|
||||
public CheckListViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
// errorImage = itemView.findViewById(R.id.error_image);
|
||||
viewTitle = itemView.findViewById(R.id.list_item_title);
|
||||
detailTitle = itemView.findViewById(R.id.detail_title);
|
||||
//自动驾驶
|
||||
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);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 顶部view列表
|
||||
* 硬件检测
|
||||
*/
|
||||
class CheckImage extends RecyclerView.ViewHolder {
|
||||
private ImageView mImageView;
|
||||
private ImageView pad;
|
||||
private ImageView jiaoJiGuangTop;
|
||||
private TextView jiaoJiGuangTopText;
|
||||
private ImageView jiaoJiGuangBottom;
|
||||
private TextView jiaoJiGuangBottomText;
|
||||
private ImageView zhuJiGuang;
|
||||
private ImageView rtk;
|
||||
private ImageView cameraTop;
|
||||
private ImageView cameraMiddle;
|
||||
private ImageView cameraBottom;
|
||||
private ImageView cameraBehind;
|
||||
private ImageView luyouqi;
|
||||
private ImageView obu;
|
||||
|
||||
public CheckImage(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
// errorImage = itemView.findViewById(R.id.error_image);
|
||||
pad = itemView.findViewById(R.id.pad);
|
||||
jiaoJiGuangTop = itemView.findViewById(R.id.jiaoJiGuangTop);
|
||||
jiaoJiGuangTopText = itemView.findViewById(R.id.jiaoJiGuangTop_txt);
|
||||
jiaoJiGuangBottom = itemView.findViewById(R.id.jiaoJiGuangBottom);
|
||||
jiaoJiGuangBottomText = itemView.findViewById(R.id.jiaoJiGuangBottom_txt);
|
||||
zhuJiGuang = itemView.findViewById(R.id.zhujiguang);
|
||||
rtk = itemView.findViewById(R.id.rtk);
|
||||
cameraTop = itemView.findViewById(R.id.top);
|
||||
cameraMiddle = itemView.findViewById(R.id.middle);
|
||||
cameraBottom = itemView.findViewById(R.id.bottom);
|
||||
cameraBehind = itemView.findViewById(R.id.camera_begind);
|
||||
luyouqi = itemView.findViewById(R.id.luyouqi);
|
||||
obu = itemView.findViewById(R.id.obu);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||
|
||||
try {
|
||||
Object list = dataArrayList.get(position);
|
||||
if (position == 0) {
|
||||
((CheckTitleViewHolder) holder).mTextView.setText("自动驾驶车辆正常");
|
||||
// ((CheckTitleViewHolder) holder).errorImage.;
|
||||
} else if (position == dataArrayList.size() - 1) {
|
||||
((CheckListViewHolder) holder).viewTitle.setText("硬件检测:");
|
||||
} else {
|
||||
switch (position) {
|
||||
case 1:
|
||||
((CheckListViewHolder) holder).viewTitle.setText("版本检测:");
|
||||
break;
|
||||
case 2:
|
||||
((CheckListViewHolder) holder).viewTitle.setText("系统检测:");
|
||||
break;
|
||||
case 3:
|
||||
((CheckListViewHolder) holder).viewTitle.setText("软件检测:");
|
||||
break;
|
||||
}
|
||||
((CheckListViewHolder) holder).detailTitle.setText("(以下 1 项需要优化,版本升级后需要重启设备)");
|
||||
if (list instanceof ArrayList && ((ArrayList) list).size() > 1) {
|
||||
CheckItemInfo item = (CheckItemInfo) ((ArrayList) list).get(0);
|
||||
((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));
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -113,5 +187,4 @@ public class CheckAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
|
||||
return 5;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
android:background="@drawable/check_list_item_back">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
android:id="@+id/list_item_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_80"
|
||||
@@ -32,27 +32,93 @@
|
||||
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" />
|
||||
app:layout_constraintLeft_toRightOf="@id/list_item_title"
|
||||
app:layout_constraintTop_toTopOf="@id/list_item_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"
|
||||
android:src="@drawable/auto"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/title" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/icon_auto_title"
|
||||
<!--自动驾驶应用-->
|
||||
<LinearLayout
|
||||
android:id="@+id/auto_layout"
|
||||
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" />
|
||||
android:layout_marginLeft="@dimen/dp_318"
|
||||
android:layout_marginTop="@dimen/dp_78"
|
||||
android:layout_marginBottom="@dimen/dp_108"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/title">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/icon_auto"
|
||||
android:layout_width="@dimen/dp_150"
|
||||
android:layout_height="@dimen/dp_150"
|
||||
android:layout_gravity="center"
|
||||
android:src="@drawable/auto" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/icon_auto_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginTop="@dimen/dp_22"
|
||||
android:maxLines="2"
|
||||
android:text="自动驾驶升级到\n 版本"
|
||||
android:textColor="@color/module_commons_wm_dialog_text_textColor"
|
||||
android:textSize="@dimen/dp_42"
|
||||
app:layout_constraintTop_toBottomOf="@id/icon_auto" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/auto_risk_state"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginTop="@dimen/dp_56"
|
||||
android:textColor="@color/check_little_btn_green"
|
||||
android:textSize="@dimen/dp_36"
|
||||
app:layout_constraintTop_toTopOf="@+id/icon_auto_title" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ying_layout"
|
||||
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:orientation="vertical"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toRightOf="@+id/auto_layout"
|
||||
app:layout_constraintTop_toBottomOf="@+id/title">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/icon_ying"
|
||||
android:layout_width="@dimen/dp_150"
|
||||
android:layout_height="@dimen/dp_150"
|
||||
android:layout_gravity="center"
|
||||
android:src="@drawable/yingyan" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/icon_ying_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginTop="@dimen/dp_22"
|
||||
android:text=" 鹰眼\n版本"
|
||||
android:textAlignment="center"
|
||||
android:textColor="@color/module_commons_wm_dialog_text_textColor"
|
||||
android:textSize="@dimen/dp_42"
|
||||
app:layout_constraintTop_toBottomOf="@id/icon_auto" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/ying_risk_state"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginTop="@dimen/dp_56"
|
||||
android:textColor="@color/check_little_btn_green"
|
||||
android:textSize="@dimen/dp_36"
|
||||
app:layout_constraintTop_toTopOf="@+id/icon_auto_title" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
Reference in New Issue
Block a user