接口联调,差网格UI
This commit is contained in:
@@ -2,19 +2,337 @@ package com.mogo.eagle.core.function.check.net;
|
||||
|
||||
import com.mogo.commons.data.BaseData;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author liujing
|
||||
* @description 描述
|
||||
* @since: 8/13/21
|
||||
*/
|
||||
public class CheckResultData extends BaseData {
|
||||
public Data data;
|
||||
private Data data;
|
||||
private boolean success;
|
||||
|
||||
public Data getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public void setData(Data data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
public boolean isSuccess() {
|
||||
return success;
|
||||
}
|
||||
|
||||
public void setSuccess(boolean success) {
|
||||
this.success = success;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "CheckResultData{" +
|
||||
"data=" + data +
|
||||
", success=" + success +
|
||||
'}';
|
||||
}
|
||||
|
||||
public static class Data {
|
||||
public vehicle mVehicle;
|
||||
private Vehicle vehicle;
|
||||
private List<SoftItem> soft;
|
||||
private List<DevicesItem> devices;
|
||||
|
||||
//
|
||||
public Vehicle getVehicle() {
|
||||
return vehicle;
|
||||
}
|
||||
|
||||
public void setVehicle(Vehicle vehicle) {
|
||||
this.vehicle = vehicle;
|
||||
}
|
||||
|
||||
public List<SoftItem> getSoft() {
|
||||
return soft;
|
||||
}
|
||||
|
||||
public void setSoft(List<SoftItem> soft) {
|
||||
this.soft = soft;
|
||||
}
|
||||
|
||||
public List<DevicesItem> getDevices() {
|
||||
return devices;
|
||||
}
|
||||
|
||||
public void setDevices(List<DevicesItem> devices) {
|
||||
this.devices = devices;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Data{" +
|
||||
"vehicle=" + vehicle +
|
||||
", soft=" + soft +
|
||||
", devices=" + devices +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
||||
public static class vehicle {
|
||||
public static class Vehicle {
|
||||
private String id;
|
||||
private String sn;
|
||||
private String vin;
|
||||
private String carBrand;
|
||||
private String carLicense;
|
||||
private String carType;
|
||||
private String userName;
|
||||
private String userPhone;
|
||||
private String carImage;
|
||||
private double createTime;
|
||||
private Integer state;
|
||||
private Integer ipcState;
|
||||
private Integer autoState;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getSn() {
|
||||
return sn;
|
||||
}
|
||||
|
||||
public void setSn(String sn) {
|
||||
this.sn = sn;
|
||||
}
|
||||
|
||||
public String getVin() {
|
||||
return vin;
|
||||
}
|
||||
|
||||
public void setVin(String vin) {
|
||||
this.vin = vin;
|
||||
}
|
||||
|
||||
public String getCarBrand() {
|
||||
return carBrand;
|
||||
}
|
||||
|
||||
public void setCarBrand(String carBrand) {
|
||||
this.carBrand = carBrand;
|
||||
}
|
||||
|
||||
public String getCarLicense() {
|
||||
return carLicense;
|
||||
}
|
||||
|
||||
public void setCarLicense(String carLicense) {
|
||||
this.carLicense = carLicense;
|
||||
}
|
||||
|
||||
public String getCarType() {
|
||||
return carType;
|
||||
}
|
||||
|
||||
public void setCarType(String carType) {
|
||||
this.carType = carType;
|
||||
}
|
||||
|
||||
public String getUserName() {
|
||||
return userName;
|
||||
}
|
||||
|
||||
public void setUserName(String userName) {
|
||||
this.userName = userName;
|
||||
}
|
||||
|
||||
public String getUserPhone() {
|
||||
return userPhone;
|
||||
}
|
||||
|
||||
public void setUserPhone(String userPhone) {
|
||||
this.userPhone = userPhone;
|
||||
}
|
||||
|
||||
public String getCarImage() {
|
||||
return carImage;
|
||||
}
|
||||
|
||||
public void setCarImage(String carImage) {
|
||||
this.carImage = carImage;
|
||||
}
|
||||
|
||||
public double getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(double createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
public Integer getState() {
|
||||
return state;
|
||||
}
|
||||
|
||||
public void setState(Integer state) {
|
||||
this.state = state;
|
||||
}
|
||||
|
||||
public Integer getIpcState() {
|
||||
return ipcState;
|
||||
}
|
||||
|
||||
public void setIpcState(Integer ipcState) {
|
||||
this.ipcState = ipcState;
|
||||
}
|
||||
|
||||
public Integer getAutoState() {
|
||||
return autoState;
|
||||
}
|
||||
|
||||
public void setAutoState(Integer autoState) {
|
||||
this.autoState = autoState;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "vehicle{" +
|
||||
"id='" + id + '\'' +
|
||||
", sn='" + sn + '\'' +
|
||||
", vin='" + vin + '\'' +
|
||||
", carBrand='" + carBrand + '\'' +
|
||||
", carLicense='" + carLicense + '\'' +
|
||||
", carType='" + carType + '\'' +
|
||||
", userName='" + userName + '\'' +
|
||||
", userPhone='" + userPhone + '\'' +
|
||||
", carImage='" + carImage + '\'' +
|
||||
", createTime='" + createTime + '\'' +
|
||||
", state='" + state + '\'' +
|
||||
", ipcState='" + ipcState + '\'' +
|
||||
", autoState='" + autoState + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
||||
public static class SoftItem {
|
||||
private String name;
|
||||
private String stateValue;
|
||||
private List<ItemClass> items;
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public Object getStateValue() {
|
||||
return stateValue;
|
||||
}
|
||||
|
||||
public void setStateValue(String stateValue) {
|
||||
this.stateValue = stateValue;
|
||||
}
|
||||
|
||||
public List<ItemClass> getItems() {
|
||||
return items;
|
||||
}
|
||||
|
||||
public void setItems(List<ItemClass> items) {
|
||||
this.items = items;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "soft{" +
|
||||
"name='" + name + '\'' +
|
||||
", stateValue=" + stateValue +
|
||||
", items=" + items +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
||||
public static class DevicesItem {
|
||||
private String name;
|
||||
private String stateValue;
|
||||
private ArrayList<ItemClass> items;
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public Object getStateValue() {
|
||||
return stateValue;
|
||||
}
|
||||
|
||||
public void setStateValue(String stateValue) {
|
||||
this.stateValue = stateValue;
|
||||
}
|
||||
|
||||
public ArrayList<ItemClass> getItems() {
|
||||
return items;
|
||||
}
|
||||
|
||||
public void setItems(ArrayList<ItemClass> items) {
|
||||
this.items = items;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "devices{" +
|
||||
"name='" + name + '\'' +
|
||||
", stateValue=" + stateValue +
|
||||
", items=" + items +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static class ItemClass {
|
||||
private String name;
|
||||
private String stateValue;
|
||||
private ArrayList items;
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public Object getStateValue() {
|
||||
return stateValue;
|
||||
}
|
||||
|
||||
public void setStateValue(String stateValue) {
|
||||
this.stateValue = stateValue;
|
||||
}
|
||||
|
||||
public ArrayList getItems() {
|
||||
return items;
|
||||
}
|
||||
|
||||
public void setItems(ArrayList items) {
|
||||
this.items = items;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "softItem{" +
|
||||
"name='" + name + '\'' +
|
||||
", stateValue=" + stateValue +
|
||||
", items=" + items +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -25,7 +25,6 @@ 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;
|
||||
@@ -34,18 +33,12 @@ import com.mogo.eagle.core.function.check.net.CheckResultData;
|
||||
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;
|
||||
@@ -126,6 +119,30 @@ public class CheckActivity extends AppCompatActivity {
|
||||
return true;
|
||||
}
|
||||
|
||||
//网络请求,获取自车检测结果(工控机上报云端)append("sn", MoGoAiCloudClientConfig.getInstance().getSn())
|
||||
public static void loadDetail() {
|
||||
final Map<String, Object> params = ParamsBuilder.of(false)
|
||||
.append("sn", "X2020210915BEAEDAE69E1E745A")//测试代码
|
||||
.build();
|
||||
CheckApiServiceFactory.getDataApiService(context).loadMonitorDetail(params)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new SubscribeImpl<CheckResultData>(RequestOptions.create(context)) {
|
||||
@Override
|
||||
public void onSuccess(CheckResultData o) {
|
||||
super.onSuccess(o);
|
||||
Log.d(TAG, "车辆自检结果是:" + o.toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String message, int code) {
|
||||
Log.d(TAG, "车辆自检失败:" + "message:" + message + "code:" + code);
|
||||
super.onError(message, code);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 自动驾驶是否存在风险
|
||||
*/
|
||||
@@ -242,30 +259,6 @@ public class CheckActivity extends AppCompatActivity {
|
||||
}
|
||||
}
|
||||
|
||||
//网络请求,获取自车检测结果(工控机上报云端)append("sn", MoGoAiCloudClientConfig.getInstance().getSn())
|
||||
public static void loadDetail() {
|
||||
final Map<String, Object> params = ParamsBuilder.of(false)
|
||||
.append("sn", "SNDFD05063")//测试代码
|
||||
.build();
|
||||
CheckApiServiceFactory.getDataApiService(context).loadMonitorDetail(params)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new SubscribeImpl<CheckResultData>(RequestOptions.create(context)) {
|
||||
@Override
|
||||
public void onSuccess(CheckResultData o) {
|
||||
super.onSuccess(o);
|
||||
Log.d(TAG, "车辆自检结果是:" + o.toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String message, int code) {
|
||||
Log.d(TAG, "车辆自检失败:" + "message:" + message + "code:" + code);
|
||||
super.onError(message, code);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
public static void start(Context context) {
|
||||
Intent starter = new Intent(context, CheckActivity.class);
|
||||
context.startActivity(starter);
|
||||
|
||||
@@ -28,6 +28,7 @@ public class CheckAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
|
||||
LayoutInflater mLayoutInflater;
|
||||
ArrayList dataArrayList;
|
||||
private Context mContext;
|
||||
private CheckInfoListDialog mCheckInfoListDialog;
|
||||
|
||||
public CheckAdapter(@NonNull Context context, @NonNull ArrayList checkArray) {
|
||||
mContext = context;
|
||||
@@ -135,29 +136,22 @@ public class CheckAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||
try {
|
||||
Object list = dataArrayList.get(position);
|
||||
if (position == 0) {
|
||||
((CheckTitleViewHolder) holder).errorImage.setImageResource(R.drawable.check_right);
|
||||
|
||||
if (list instanceof ArrayList && ((ArrayList) list).size() > 0) {
|
||||
CheckItemInfo item = (CheckItemInfo) ((ArrayList) list).get(0);
|
||||
((CheckTitleViewHolder) holder).mTextView.setText(item.getTitle());
|
||||
if (item.isUsual() == true) {
|
||||
((CheckTitleViewHolder) holder).errorImage.setImageResource(R.drawable.check_right);
|
||||
} else {
|
||||
((CheckTitleViewHolder) holder).errorImage.setImageResource(R.drawable.check_wrong);
|
||||
}
|
||||
}
|
||||
} else if (position == 1) {
|
||||
((CheckListViewHolder) holder).viewTitle.setText("硬件检测:");
|
||||
((CheckListViewHolder) holder).iconAuto.setOnClickListener(v -> {
|
||||
Log.d(TAG, "硬件检测结果:");
|
||||
mCheckInfoListDialog = new CheckInfoListDialog(mContext);
|
||||
mCheckInfoListDialog.show();
|
||||
|
||||
});
|
||||
} else if (position == 2) {
|
||||
((CheckListViewHolder) holder).viewTitle.setText("系统检测:");
|
||||
((CheckListViewHolder) holder).iconAuto.setOnClickListener(v -> {
|
||||
Log.d(TAG, "系统检测结果:");
|
||||
|
||||
mCheckInfoListDialog = new CheckInfoListDialog(mContext);
|
||||
mCheckInfoListDialog.show();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -14,20 +14,20 @@ import com.mogo.module.common.dialog.BaseFloatDialog;
|
||||
* @description 描述
|
||||
* @since: 9/22/21
|
||||
*/
|
||||
public class CheckListDialog extends BaseFloatDialog {
|
||||
public class CheckInfoListDialog extends BaseFloatDialog {
|
||||
|
||||
private RecyclerView mRecyclerView;
|
||||
private Context mContext;
|
||||
private int span;
|
||||
|
||||
|
||||
public CheckListDialog(@NonNull Context context) {
|
||||
public CheckInfoListDialog(@NonNull Context context) {
|
||||
super(context);
|
||||
mContext = context;
|
||||
initView();
|
||||
}
|
||||
|
||||
public CheckListDialog(@NonNull Context context, int themeResId) {
|
||||
public CheckInfoListDialog(@NonNull Context context, int themeResId) {
|
||||
super(context, themeResId);
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ public class CheckListDialog extends BaseFloatDialog {
|
||||
GridLayoutManager layoutManager = new GridLayoutManager(mContext, 4);
|
||||
//表示竖直显示.默认VERTICAL
|
||||
layoutManager.setOrientation(GridLayoutManager.HORIZONTAL);
|
||||
mRecyclerView.addItemDecoration(new CheckListGridItem());
|
||||
mRecyclerView.addItemDecoration(new CheckInfoListGridItemDec());
|
||||
mRecyclerView.setLayoutManager(layoutManager);
|
||||
findViewById(R.id.cancel_info_list_button).setOnClickListener(v -> {
|
||||
cancel();
|
||||
@@ -14,13 +14,13 @@ import androidx.recyclerview.widget.RecyclerView;
|
||||
* @description 描述
|
||||
* @since: 9/22/21
|
||||
*/
|
||||
class CheckListGridItem extends RecyclerView.ItemDecoration {
|
||||
class CheckInfoListGridItemDec extends RecyclerView.ItemDecoration {
|
||||
//分割线的宽度
|
||||
private static final int DIVIDER_SIZE = 5;
|
||||
|
||||
private final Paint mPaint = new Paint();
|
||||
|
||||
public CheckListGridItem() {
|
||||
public CheckInfoListGridItemDec() {
|
||||
init();
|
||||
}
|
||||
|
||||
@@ -31,7 +31,6 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_318"
|
||||
android:layout_marginBottom="@dimen/dp_70"
|
||||
android:clickable="true"
|
||||
android:descendantFocusability="blocksDescendants"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
@@ -43,8 +42,8 @@
|
||||
android:layout_width="@dimen/dp_150"
|
||||
android:layout_height="@dimen/dp_150"
|
||||
android:layout_gravity="center"
|
||||
android:clickable="true"
|
||||
android:src="@drawable/auto" />
|
||||
android:src="@drawable/auto"
|
||||
android:clickable="true"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/icon_auto_title"
|
||||
|
||||
Reference in New Issue
Block a user