Merge branch 'check_check' into dev/dev_eagle_architecture_upgrade
This commit is contained in:
3
.idea/gradle.xml
generated
3
.idea/gradle.xml
generated
@@ -4,7 +4,7 @@
|
||||
<component name="GradleSettings">
|
||||
<option name="linkedExternalProjectsSettings">
|
||||
<GradleProjectSettings>
|
||||
<option name="testRunner" value="GRADLE" />
|
||||
<option name="testRunner" value="PLATFORM" />
|
||||
<option name="distributionType" value="DEFAULT_WRAPPED" />
|
||||
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||
<option name="modules">
|
||||
@@ -79,6 +79,7 @@
|
||||
</set>
|
||||
</option>
|
||||
<option name="resolveModulePerSourceSet" value="false" />
|
||||
<option name="useQualifiedModuleNames" value="true" />
|
||||
</GradleProjectSettings>
|
||||
</option>
|
||||
</component>
|
||||
|
||||
@@ -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')
|
||||
|
||||
@@ -126,6 +126,11 @@ public class CheckItemInfo implements Serializable {
|
||||
int ITEM_TYPE_CHECK_LIST = 1;
|
||||
int ITEM_TYPE_CHECK_IMAGE = 2;
|
||||
}
|
||||
|
||||
public interface CheckInfoStyle {
|
||||
String CHECK_INFO_STYLE_DEVICES = "devices";
|
||||
String CHECK_INFO_STYLE_SOFT = "soft";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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<CheckResultData> uploadCheckDetail(@FieldMap Map<String, String> param);
|
||||
@GET("/yycp-vehicle-management-service/monitor/license/detail")
|
||||
Observable<CheckResultData> loadMonitorDetail(@QueryMap Map<String, Object> param);
|
||||
}
|
||||
|
||||
@@ -2,10 +2,277 @@ 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 {
|
||||
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 {
|
||||
private Vehicle vehicle;
|
||||
private List<CheckListItem> soft;
|
||||
private List<CheckListItem> devices;
|
||||
private Integer deviceState = 1;//硬件状态
|
||||
private Integer softState = 0;//系统(软件)状态
|
||||
|
||||
public Vehicle getVehicle() {
|
||||
return vehicle;
|
||||
}
|
||||
|
||||
public void setVehicle(Vehicle vehicle) {
|
||||
this.vehicle = vehicle;
|
||||
}
|
||||
|
||||
public List<CheckListItem> getSoft() {
|
||||
return soft;
|
||||
}
|
||||
|
||||
public void setSoft(List<CheckListItem> soft) {
|
||||
this.soft = soft;
|
||||
}
|
||||
|
||||
public List<CheckListItem> getDevices() {
|
||||
return devices;
|
||||
}
|
||||
|
||||
public void setDevices(List<CheckListItem> devices) {
|
||||
this.devices = devices;
|
||||
}
|
||||
|
||||
public Integer getSoftState() {
|
||||
return softState;
|
||||
}
|
||||
|
||||
public void setSoftState(Integer softState) {
|
||||
this.softState = softState;
|
||||
}
|
||||
|
||||
public Integer getDeviceState() {
|
||||
return deviceState;
|
||||
}
|
||||
|
||||
public void setDeviceState(Integer deviceState) {
|
||||
this.deviceState = deviceState;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Data{" +
|
||||
"vehicle=" + vehicle +
|
||||
", soft=" + soft +
|
||||
", devices=" + devices +
|
||||
", softState=" + softState +
|
||||
", deviceState=" + deviceState +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
||||
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 CheckListItem {
|
||||
private String name;
|
||||
private String stateValue;
|
||||
private List<CheckResultData.CheckListItem> 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 getItems() {
|
||||
return items;
|
||||
}
|
||||
|
||||
public void setItems(List items) {
|
||||
this.items = items;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "soft{" +
|
||||
"name='" + name + '\'' +
|
||||
", stateValue=" + stateValue +
|
||||
", items=" + items +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -20,32 +20,41 @@ import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.mogo.commons.voice.AIAssist;
|
||||
import com.elegant.network.ParamsBuilder;
|
||||
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.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.eagle.core.function.check.net.CheckResultData;
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils;
|
||||
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.TipToast;
|
||||
import com.mogo.utils.network.RequestOptions;
|
||||
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.concurrent.TimeUnit;
|
||||
import java.util.Map;
|
||||
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.schedulers.Schedulers;
|
||||
|
||||
/**
|
||||
* @author liujing
|
||||
* @description 车辆监控页面
|
||||
* @description 车辆监控页面首页
|
||||
* @since: 7/27/21
|
||||
*/
|
||||
public class CheckActivity extends AppCompatActivity {
|
||||
public class CheckActivity extends AppCompatActivity {
|
||||
|
||||
private static final String TAG = "CheckActivity";
|
||||
private RecyclerView mRecyclerView;
|
||||
private static ArrayList dataArrayList = new ArrayList();
|
||||
private static RecyclerView mRecyclerView;
|
||||
private static CheckResultData sCheckResultData;
|
||||
private static Context context;
|
||||
private static NetworkStatusUtil.NetWorkStatus sNetWorkStatus;
|
||||
private ImageView mImageView;
|
||||
@@ -64,7 +73,8 @@ public class CheckActivity extends AppCompatActivity {
|
||||
private float movement = 1162f;
|
||||
//进度条
|
||||
private ProgressBar mProgressBar;
|
||||
private final static long DURATION_TIME = 3000;
|
||||
private final static long DURATION_TIME = 1000;
|
||||
private static CheckAdapter mCheckAdapter;
|
||||
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
@@ -89,60 +99,63 @@ public class CheckActivity extends AppCompatActivity {
|
||||
mImageView.setOnClickListener(v -> {
|
||||
finish();
|
||||
});
|
||||
//检测动画
|
||||
animation();
|
||||
//版本检测 和系统检查放在第二期
|
||||
// versionCheckResult();
|
||||
// //系统检测
|
||||
// systemCheckResult();
|
||||
//软件检测
|
||||
software();
|
||||
//硬件检测
|
||||
hardware();
|
||||
//根据以上4个结果插入第一个元素(自动驾驶车辆是否存在风险)
|
||||
topListTitle();
|
||||
|
||||
loadDetail();
|
||||
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);
|
||||
|
||||
|
||||
mCheckAdapter = new CheckAdapter(context, sCheckResultData);
|
||||
mRecyclerView.setAdapter(mCheckAdapter);
|
||||
}
|
||||
|
||||
/**
|
||||
* 自动驾驶状态下指标监测
|
||||
*/
|
||||
public static boolean checkMonitor() {
|
||||
dataArrayList.clear();
|
||||
Log.d(TAG, "checkMonitor");
|
||||
//版本检测
|
||||
// versionCheckResult();
|
||||
// //系统检测
|
||||
// systemCheckResult();
|
||||
//软件检测
|
||||
software();
|
||||
//硬件检测
|
||||
hardware();
|
||||
//根据以上4个结果插入第一个元素(自动驾驶车辆是否存在风险)
|
||||
topListTitle();
|
||||
CallerCheckManager.updateMonitoringStatus(MogoReceiver.ACTION_CHECK_VEHICLE_MONITORING,false);
|
||||
loadDetail();
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 自动驾驶是否存在风险
|
||||
*/
|
||||
private static void topListTitle() {
|
||||
ArrayList list = new ArrayList(1);
|
||||
CheckItemInfo info = new CheckItemInfo();
|
||||
info.setUsual(false);
|
||||
info.setTitle("自动驾驶车辆存在风险");
|
||||
info.setStyle(CheckItemInfo.CheckAdapterStyleEnum.ITEM_TYPE_CHECK_TITLE);
|
||||
list.add(info);
|
||||
dataArrayList.add(0, list);
|
||||
//网络请求,获取自车检测结果(工控机上报云端)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());
|
||||
ThreadUtils.runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (o != null && mCheckAdapter != null) {
|
||||
mCheckAdapter.mCheckResultData = o;
|
||||
mCheckAdapter.notifyDataSetChanged();
|
||||
}
|
||||
|
||||
if (((CheckResultData) o).getData().getVehicle().getState() == 1) {
|
||||
CallerCheckManager.updateMonitoringStatus(MogoReceiver.ACTION_CHECK_VEHICLE_MONITORING, true);
|
||||
} else {
|
||||
CallerCheckManager.updateMonitoringStatus(MogoReceiver.ACTION_CHECK_VEHICLE_MONITORING, false);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String message, int code) {
|
||||
super.onError(message, code);
|
||||
Log.d(TAG, "车辆自检失败,请稍后重试"+"=="+message+String.valueOf(code));
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -166,10 +179,12 @@ public class CheckActivity extends AppCompatActivity {
|
||||
* **************************************************************************************检测动画
|
||||
*/
|
||||
public void animation() {
|
||||
ObjectAnimator animatorX = ObjectAnimator.ofFloat(scanLineImage, "translationX", scanBottomCarImage.getWidth(), 0);
|
||||
ObjectAnimator animatorAl = ObjectAnimator.ofFloat(scanLineImage, "alpha", 0, 1);
|
||||
ObjectAnimator animatorX = ObjectAnimator.ofFloat(scanLineImage, "translationX",
|
||||
scanBottomCarImage.getWidth(), 0);
|
||||
ObjectAnimator animatorAl = ObjectAnimator.ofFloat(scanLineImage, "alpha",
|
||||
0, 1);
|
||||
setAnimation.playTogether(animatorX, animatorAl);
|
||||
setAnimation.setDuration(800);
|
||||
setAnimation.setDuration(DURATION_TIME);
|
||||
setAnimation.start();
|
||||
setAnimation.addListener(new AnimatorListenerAdapter() {
|
||||
@Override
|
||||
@@ -248,311 +263,6 @@ public class CheckActivity extends AppCompatActivity {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* **************************************************************************************版本检测
|
||||
*/
|
||||
public static void versionCheckResult() {
|
||||
ArrayList arrayVer = new ArrayList();
|
||||
//adas 检测指标
|
||||
|
||||
//鹰眼当前版本
|
||||
String verCodeStr = CommonUtils.getVersionName(context, true);
|
||||
Log.d(TAG, "版本检测结果:鹰眼" + verCodeStr);
|
||||
|
||||
//测试数据
|
||||
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、车控节点
|
||||
* <p>
|
||||
* 2、轨迹地图加载节点
|
||||
* <p>
|
||||
* 3、轨迹规划节点
|
||||
* <p>
|
||||
* 4、定位转化节点
|
||||
* <p>
|
||||
* 5、融合节点
|
||||
* <p>
|
||||
* 6、yolov5节点(包含红绿灯检测)
|
||||
* <p>
|
||||
* 7、激光雷达渲染节点
|
||||
* <p>
|
||||
* 8、摄像头驱动节点
|
||||
* <p>
|
||||
* 9、gnss定位驱动节点
|
||||
* <p>
|
||||
* 10、中激光驱动节点
|
||||
* <p>
|
||||
* 11、左激光解码节点
|
||||
* <p>
|
||||
* 12、左激光驱动节点
|
||||
* <p>
|
||||
* 13、右激光解码节点
|
||||
* <p>
|
||||
* 14、右激光驱动节点
|
||||
* <p>
|
||||
* 15、监控节点
|
||||
* <p>
|
||||
* 16、通讯交互节点
|
||||
* <p>
|
||||
* 17、轨迹录制节点
|
||||
* <p>
|
||||
* 18、can车辆控制节点
|
||||
* <p>
|
||||
* 数据上报频率 什么数据的上报频率
|
||||
* <p>
|
||||
* 时延 工控机->云 工控机->鹰眼 什么数据的时延
|
||||
*/
|
||||
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、主激光雷达
|
||||
* <p>
|
||||
* 2、侧激光雷达-2个
|
||||
* <p>
|
||||
* 3、ADAS长焦摄像头-前
|
||||
* <p>
|
||||
* 4、ADAS广角摄像头-前
|
||||
* <p>
|
||||
* 5、ADAS标准摄像头-前
|
||||
* <p>
|
||||
* 6、ADAS广角摄像头-后
|
||||
* <p>
|
||||
* 7、RTK设备
|
||||
* <p>
|
||||
* 8、OBU设备
|
||||
* <p>
|
||||
* 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) {
|
||||
Intent starter = new Intent(context, CheckActivity.class);
|
||||
context.startActivity(starter);
|
||||
@@ -569,7 +279,6 @@ public class CheckActivity extends AppCompatActivity {
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
dataArrayList.clear();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.mogo.eagle.core.function.check.view;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
@@ -9,31 +8,34 @@ import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.CheckResult;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
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.CheckResultData;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
|
||||
/**
|
||||
* @author liujing
|
||||
* @description 检测界面单元格
|
||||
* @description 检测首页单元格
|
||||
* @since: 7/27/21
|
||||
*/
|
||||
public class CheckAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
|
||||
|
||||
private static final String TAG = "CheckActivity";
|
||||
LayoutInflater mLayoutInflater;
|
||||
ArrayList dataArrayList;
|
||||
CheckResultData mCheckResultData;
|
||||
private Context mContext;
|
||||
private static CheckInfoListDialog mCheckInfoListDialog;
|
||||
|
||||
public CheckAdapter(@NonNull Context context, @NonNull ArrayList checkArray) {
|
||||
public CheckAdapter(@NonNull Context context, @NonNull CheckResultData checkResult) {
|
||||
mContext = context;
|
||||
mCheckResultData = checkResult;
|
||||
mLayoutInflater = LayoutInflater.from(context);
|
||||
dataArrayList = checkArray;
|
||||
Log.d(TAG, dataArrayList.toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -41,10 +43,8 @@ public class CheckAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
|
||||
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 +56,6 @@ public class CheckAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
|
||||
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);
|
||||
@@ -77,8 +71,8 @@ public class CheckAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
|
||||
|
||||
public CheckTitleViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
errorImage = itemView.findViewById(R.id.error_tip_image);
|
||||
mTextView = itemView.findViewById(R.id.error_title);
|
||||
errorImage = itemView.findViewById(R.id.check_tip_image);
|
||||
mTextView = itemView.findViewById(R.id.check_title);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -89,151 +83,81 @@ public class CheckAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
|
||||
private TextView viewTitle;
|
||||
private TextView iconAutoTitle;
|
||||
private TextView autoRiskState;
|
||||
|
||||
private TextView iconyingTitle;
|
||||
private TextView yingRiskState;
|
||||
private ImageView iconAuto;
|
||||
|
||||
public CheckListViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
viewTitle = itemView.findViewById(R.id.list_item_title);
|
||||
//自动驾驶
|
||||
iconAuto = itemView.findViewById(R.id.icon_auto);
|
||||
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;
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 硬件检测
|
||||
*/
|
||||
class CheckImage extends RecyclerView.ViewHolder {
|
||||
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);
|
||||
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) {
|
||||
if (mCheckResultData == null || mCheckResultData.getData() == null) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
Object list = dataArrayList.get(position);
|
||||
if (position == 0) {
|
||||
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);
|
||||
}
|
||||
if (mCheckResultData.getData().getVehicle().getState() == 1) {
|
||||
((CheckTitleViewHolder) holder).errorImage.setImageResource(R.drawable.check_right);
|
||||
((CheckTitleViewHolder) holder).mTextView.setText("车辆自检正常");
|
||||
} else {
|
||||
((CheckTitleViewHolder) holder).errorImage.setImageResource(R.drawable.check_wrong);
|
||||
((CheckTitleViewHolder) holder).mTextView.setText("车辆存在异常项");
|
||||
}
|
||||
} else if (position == dataArrayList.size() - 1) {
|
||||
} else if (position == 1) {
|
||||
((CheckListViewHolder) holder).viewTitle.setText("硬件检测:");
|
||||
if (list instanceof ArrayList) {
|
||||
refreshHardware(holder, (ArrayList) list);
|
||||
if (mCheckResultData.getData().getDeviceState() == 1) {
|
||||
((CheckListViewHolder) holder).autoRiskState.setTextColor(
|
||||
(mContext.getResources().getColor(R.color.check_little_btn_green)));
|
||||
((CheckListViewHolder) holder).autoRiskState.setText("运行正常");
|
||||
} else {
|
||||
((CheckListViewHolder) holder).autoRiskState.setTextColor(
|
||||
(mContext.getResources().getColor(R.color.check_icon_error_color)));
|
||||
((CheckListViewHolder) holder).autoRiskState.setText("存在异常项");
|
||||
}
|
||||
} 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));
|
||||
}
|
||||
((CheckListViewHolder) holder).iconAuto.setOnClickListener(v -> {
|
||||
Log.d(TAG, "硬件检测结果:");
|
||||
if (mCheckInfoListDialog != null){
|
||||
mCheckInfoListDialog.dismiss();
|
||||
}
|
||||
mCheckInfoListDialog = new CheckInfoListDialog(mContext, CheckItemInfo.CheckInfoStyle.CHECK_INFO_STYLE_DEVICES, mCheckResultData);
|
||||
mCheckInfoListDialog.show();
|
||||
|
||||
});
|
||||
} else if (position == 2) {
|
||||
((CheckListViewHolder) holder).viewTitle.setText("系统检测:");
|
||||
if (mCheckResultData.getData().getSoftState() == 1) {
|
||||
((CheckListViewHolder) holder).autoRiskState.setTextColor(
|
||||
(mContext.getResources().getColor(R.color.check_little_btn_green)));
|
||||
((CheckListViewHolder) holder).autoRiskState.setText("运行正常");
|
||||
} else {
|
||||
((CheckListViewHolder) holder).autoRiskState.setTextColor(
|
||||
(mContext.getResources().getColor(R.color.check_icon_error_color)));
|
||||
((CheckListViewHolder) holder).autoRiskState.setText("存在异常项");
|
||||
}
|
||||
((CheckListViewHolder) holder).iconAuto.setOnClickListener(v -> {
|
||||
Log.d(TAG, "系统检测结果:");
|
||||
if (mCheckInfoListDialog != null){
|
||||
mCheckInfoListDialog.dismiss();
|
||||
}
|
||||
mCheckInfoListDialog = new CheckInfoListDialog(mContext, CheckItemInfo.CheckInfoStyle.CHECK_INFO_STYLE_SOFT, mCheckResultData);
|
||||
mCheckInfoListDialog.show();
|
||||
});
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 硬件检测指标
|
||||
*
|
||||
* @param list
|
||||
*/
|
||||
public void refreshHardware(@NonNull RecyclerView.ViewHolder holder, ArrayList list) {
|
||||
if (list.size() > 0) {
|
||||
CheckItemInfo info = (CheckItemInfo) list.get(0);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return dataArrayList.size();
|
||||
return 3;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ import com.mogo.module.common.dialog.BaseFloatDialog;
|
||||
|
||||
/**
|
||||
* @author liujing
|
||||
* @description 车辆监控弹框提示
|
||||
* @description 车辆监控弹框提示(长时间未检测或者后台任务检测出现问题的弹框)
|
||||
* @since: 7/30/21
|
||||
*/
|
||||
public class CheckDialog extends BaseFloatDialog {
|
||||
|
||||
@@ -0,0 +1,110 @@
|
||||
package com.mogo.eagle.core.function.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.eagle.core.function.check.R;
|
||||
import com.mogo.eagle.core.function.check.net.CheckResultData;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author liujing
|
||||
* @description 点击自动驾驶icon显示各个检测指标结果
|
||||
* @since: 9/23/21
|
||||
*/
|
||||
public class CheckInfoAdapter extends RecyclerView.Adapter {
|
||||
private static final String TAG = "CheckInfoAdapter";
|
||||
LayoutInflater mLayoutInflater;
|
||||
private Context mContext;
|
||||
private String mStyle;
|
||||
private List<CheckResultData.CheckListItem> showData;
|
||||
|
||||
public CheckInfoAdapter(Context context, String style, List checkResultData) {
|
||||
mContext = context;
|
||||
mStyle = style;
|
||||
showData = checkResultData;
|
||||
mLayoutInflater = LayoutInflater.from(context);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View v = mLayoutInflater.inflate(R.layout.check_info_adapter, parent,
|
||||
false);
|
||||
CheckInfoAdapter.CheckInfoViewHolder holder = new CheckInfoAdapter.CheckInfoViewHolder(v);
|
||||
return holder;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||
if (position == 0 || position == 2) {
|
||||
((CheckInfoViewHolder) holder).checkIcon.setVisibility(View.GONE);
|
||||
((CheckInfoViewHolder) holder).mTextView.setText("模块名称");
|
||||
} else if (position == 1 || position == 3) {
|
||||
((CheckInfoViewHolder) holder).checkIcon.setVisibility(View.GONE);
|
||||
((CheckInfoViewHolder) holder).mTextView.setText("运行状态");
|
||||
} else {
|
||||
try {
|
||||
if ((position - 4) < showData.size() * 2) {
|
||||
int index = (position - 4) / 2;
|
||||
CheckResultData.CheckListItem positionItem = showData.get(index);
|
||||
if (isEven(position) == true) {//偶数隐藏图片显示检测指标
|
||||
((CheckInfoViewHolder) holder).checkIcon.setVisibility(View.GONE);
|
||||
((CheckInfoViewHolder) holder).mTextView.setText(positionItem.getName());
|
||||
} else {//奇数显示图片和检测指标结果
|
||||
((CheckInfoViewHolder) holder).checkIcon.setVisibility(View.VISIBLE);
|
||||
String state = (String) positionItem.getStateValue();
|
||||
if (state.equals("1")) {
|
||||
((CheckInfoViewHolder) holder).mTextView.setText("正常");
|
||||
((CheckInfoViewHolder) holder).checkIcon.setImageResource(R.drawable.check_right);
|
||||
} else if ((state.equals("0"))) {
|
||||
((CheckInfoViewHolder) holder).mTextView.setText("异常");
|
||||
((CheckInfoViewHolder) holder).checkIcon.setImageResource(R.drawable.check_wrong);
|
||||
} else {
|
||||
((CheckInfoViewHolder) holder).mTextView.setText(state);
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public boolean isEven(int position) {
|
||||
if (position % 2 == 0) {
|
||||
System.out.println("偶数");
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return showData.size() * 2 + 4;
|
||||
}
|
||||
|
||||
public class CheckInfoViewHolder extends RecyclerView.ViewHolder {
|
||||
private ImageView checkIcon;
|
||||
private TextView mTextView;
|
||||
|
||||
public CheckInfoViewHolder(View v) {
|
||||
super(v);
|
||||
checkIcon = v.findViewById(R.id.info_check_icon);
|
||||
mTextView = v.findViewById(R.id.info_result_tx);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,232 @@
|
||||
package com.mogo.eagle.core.function.check.view;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.TypedArray;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.Paint;
|
||||
import android.graphics.Rect;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.graphics.drawable.GradientDrawable;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import androidx.recyclerview.widget.StaggeredGridLayoutManager;
|
||||
|
||||
/**
|
||||
* @author liujing
|
||||
* @description 网格布局网格绘制类
|
||||
* @since: 9/22/21
|
||||
*/
|
||||
public class CheckInfoGridItemDivider extends RecyclerView.ItemDecoration {
|
||||
private String TAG = getClass().getSimpleName();
|
||||
private static final int[] ATTRS = new int[]{android.R.attr.listDivider};
|
||||
private Drawable divider;
|
||||
|
||||
public CheckInfoGridItemDivider(Context context) {
|
||||
final TypedArray a = context.obtainStyledAttributes(ATTRS);
|
||||
divider = a.getDrawable(0);
|
||||
a.recycle();
|
||||
}
|
||||
|
||||
public CheckInfoGridItemDivider(Drawable drawable) {
|
||||
divider = drawable;
|
||||
}
|
||||
|
||||
public CheckInfoGridItemDivider(int height, int color) {
|
||||
GradientDrawable shapeDrawable = new GradientDrawable();
|
||||
shapeDrawable.setColor(color);
|
||||
shapeDrawable.setShape(GradientDrawable.RECTANGLE);
|
||||
shapeDrawable.setSize(height, height);
|
||||
divider = shapeDrawable;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onDraw(Canvas c, RecyclerView parent, RecyclerView.State state) {
|
||||
|
||||
drawHorizontal(c, parent);
|
||||
drawVertical(c, parent);
|
||||
|
||||
}
|
||||
|
||||
private int getSpanCount(RecyclerView parent) {
|
||||
// 列数
|
||||
int spanCount = -1;
|
||||
RecyclerView.LayoutManager layoutManager = parent.getLayoutManager();
|
||||
if (layoutManager instanceof GridLayoutManager) {
|
||||
|
||||
spanCount = ((GridLayoutManager) layoutManager).getSpanCount();
|
||||
} else if (layoutManager instanceof StaggeredGridLayoutManager) {
|
||||
spanCount = ((StaggeredGridLayoutManager) layoutManager)
|
||||
.getSpanCount();
|
||||
}
|
||||
return spanCount;
|
||||
}
|
||||
|
||||
public void drawHorizontal(Canvas c, RecyclerView parent) {
|
||||
int childCount = parent.getChildCount(); //获取可见item的数量
|
||||
int spanCount = getSpanCount(parent);
|
||||
for (int i = 0; i < childCount; i++) {
|
||||
final View child = parent.getChildAt(i);
|
||||
final RecyclerView.LayoutParams params = (RecyclerView.LayoutParams) child
|
||||
.getLayoutParams();
|
||||
final int left = child.getLeft() - params.leftMargin;
|
||||
final int right = child.getRight() + params.rightMargin
|
||||
+ divider.getIntrinsicWidth();
|
||||
final int top = child.getBottom() + params.bottomMargin;
|
||||
final int bottom = top + divider.getIntrinsicHeight();
|
||||
divider.setBounds(left, top, right, bottom);
|
||||
divider.draw(c);
|
||||
if (i < spanCount) { //画第一行顶部的分割线
|
||||
drawHorizontalForFirstRow(c, child);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void drawHorizontalForFirstRow(Canvas c, View child) {
|
||||
final RecyclerView.LayoutParams params = (RecyclerView.LayoutParams) child
|
||||
.getLayoutParams();
|
||||
int left = child.getLeft() - params.leftMargin - divider.getIntrinsicWidth();
|
||||
int top = child.getTop() - params.topMargin - divider.getIntrinsicHeight();
|
||||
int right = child.getRight() + params.rightMargin + divider.getIntrinsicWidth();
|
||||
int bottom = top + divider.getIntrinsicHeight();
|
||||
divider.setBounds(left, top, right, bottom);
|
||||
divider.draw(c);
|
||||
}
|
||||
|
||||
private void drawVerticalForFirstColum(Canvas c, View child) {
|
||||
final RecyclerView.LayoutParams params = (RecyclerView.LayoutParams) child
|
||||
.getLayoutParams();//在父布局的
|
||||
int left = child.getLeft() - params.leftMargin - divider.getIntrinsicWidth();
|
||||
int top = child.getTop() - params.topMargin;
|
||||
int right = child.getLeft() - params.leftMargin;
|
||||
int bottom = top + child.getHeight() + divider.getIntrinsicHeight();
|
||||
divider.setBounds(left, top, right, bottom);
|
||||
divider.draw(c);
|
||||
}
|
||||
|
||||
//待修改为右侧
|
||||
private void drawVerticalForLastColum(Canvas c, View child) {
|
||||
final RecyclerView.LayoutParams params = (RecyclerView.LayoutParams) child
|
||||
.getLayoutParams();
|
||||
int left = child.getRight() - params.leftMargin - divider.getIntrinsicWidth();
|
||||
int top = child.getTop() - params.topMargin;
|
||||
int right = child.getRight() - params.leftMargin + divider.getIntrinsicWidth();
|
||||
int bottom = top + child.getHeight() + divider.getIntrinsicHeight();
|
||||
divider.setBounds(left, top, right, bottom);
|
||||
divider.draw(c);
|
||||
}
|
||||
|
||||
public void drawVertical(Canvas c, RecyclerView parent) {
|
||||
final int childCount = parent.getChildCount();
|
||||
for (int i = 0; i < childCount; i++) {
|
||||
final View child = parent.getChildAt(i);
|
||||
|
||||
final RecyclerView.LayoutParams params = (RecyclerView.LayoutParams) child
|
||||
.getLayoutParams();
|
||||
final int top = child.getTop() - params.topMargin;
|
||||
final int bottom = child.getBottom() + params.bottomMargin;
|
||||
final int left = child.getRight() + params.rightMargin;
|
||||
final int right = left + divider.getIntrinsicWidth();
|
||||
divider.setBounds(left, top, right, bottom);
|
||||
divider.draw(c);
|
||||
if (isFirstColum(parent, i, getSpanCount(parent))) { //画第一列左边分割线
|
||||
drawVerticalForFirstColum(c, child);
|
||||
}
|
||||
if (isLastColum(parent, i, getSpanCount(parent), childCount)) {//画最后一列右侧分割线
|
||||
drawVerticalForLastColum(c, child);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isLastColum(RecyclerView parent, int pos, int spanCount,
|
||||
int childCount) {
|
||||
RecyclerView.LayoutManager layoutManager = parent.getLayoutManager();
|
||||
if (layoutManager instanceof GridLayoutManager) {
|
||||
if ((pos + 1) % spanCount == 0)// 如果是最后一列,则不需要绘制右边
|
||||
{
|
||||
return true;
|
||||
}
|
||||
} else if (layoutManager instanceof StaggeredGridLayoutManager) {
|
||||
int orientation = ((StaggeredGridLayoutManager) layoutManager)
|
||||
.getOrientation();
|
||||
if (orientation == StaggeredGridLayoutManager.VERTICAL) {
|
||||
if ((pos + 1) % spanCount == 0)// 如果是最后一列,则不需要绘制右边
|
||||
{
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
childCount = childCount - childCount % spanCount;
|
||||
if (pos >= childCount)// 如果是最后一列,则不需要绘制右边
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean isLastRaw(RecyclerView parent, int pos, int spanCount,
|
||||
int childCount) {
|
||||
RecyclerView.LayoutManager layoutManager = parent.getLayoutManager();
|
||||
if (layoutManager instanceof GridLayoutManager) {
|
||||
childCount = childCount - childCount % spanCount;
|
||||
if (pos >= childCount)// 如果是最后一行,则不需要绘制底部
|
||||
return true;
|
||||
} else if (layoutManager instanceof StaggeredGridLayoutManager) {
|
||||
int orientation = ((StaggeredGridLayoutManager) layoutManager)
|
||||
.getOrientation();
|
||||
if (orientation == StaggeredGridLayoutManager.VERTICAL) {
|
||||
childCount = childCount - childCount % spanCount;
|
||||
// 如果是最后一行,则不需要绘制底部
|
||||
if (pos >= childCount)
|
||||
return true;
|
||||
} else {
|
||||
// 如果是最后一行,则不需要绘制底部
|
||||
if ((pos + 1) % spanCount == 0) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
//是否为第一列
|
||||
private boolean isFirstColum(RecyclerView parent, int pos, int spanCount) {
|
||||
RecyclerView.LayoutManager layoutManager = parent.getLayoutManager();
|
||||
if (layoutManager instanceof GridLayoutManager) { //网格布局
|
||||
if ((pos + 1) % spanCount == 1) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
//是否为第一行
|
||||
private boolean isFirstRaw(int pos, int spanCount) {
|
||||
if (pos < spanCount) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getItemOffsets(Rect outRect, int itemPosition,
|
||||
RecyclerView parent) {
|
||||
int spanCount = getSpanCount(parent); //列数
|
||||
|
||||
if (itemPosition == 0) { //第一行第一个,四边都画
|
||||
outRect.set(divider.getIntrinsicWidth(), divider.getIntrinsicHeight(),
|
||||
divider.getIntrinsicWidth(), divider.getIntrinsicHeight());
|
||||
} else if (isFirstRaw(itemPosition, spanCount)) { //第一行,画上下右三边
|
||||
outRect.set(0, divider.getIntrinsicHeight(), divider.getIntrinsicWidth(), divider.getIntrinsicHeight());
|
||||
} else if (isFirstColum(parent, itemPosition, spanCount)) { //第一列,画左右下三边
|
||||
outRect.set(divider.getIntrinsicWidth(), 0, divider.getIntrinsicWidth(), divider.getIntrinsicHeight());
|
||||
} else { //其他,画右下两边
|
||||
outRect.set(0, 0, divider.getIntrinsicWidth(), divider.getIntrinsicHeight());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,116 @@
|
||||
package com.mogo.eagle.core.function.check.view;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
import android.util.Log;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
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.CheckResultData;
|
||||
import com.mogo.module.common.dialog.BaseFloatDialog;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author liujing
|
||||
* @description 检测指标详情弹框
|
||||
* @since: 9/22/21
|
||||
*/
|
||||
public class CheckInfoListDialog extends BaseFloatDialog {
|
||||
|
||||
private static final String TAG = "CheckInfoListDialog";
|
||||
private RecyclerView mRecyclerView;
|
||||
private Context mContext;
|
||||
private TextView titleView;
|
||||
private int span;
|
||||
private String mStyle;
|
||||
private CheckResultData mCheckResultData;
|
||||
private List<CheckResultData.CheckListItem> result = new ArrayList<>();
|
||||
|
||||
|
||||
public CheckInfoListDialog(@NonNull Context context, String style, CheckResultData checkResultData) {
|
||||
super(context);
|
||||
mContext = context;
|
||||
mStyle = style;
|
||||
mCheckResultData = checkResultData;
|
||||
initView();
|
||||
}
|
||||
|
||||
public CheckInfoListDialog(@NonNull Context context, int themeResId) {
|
||||
super(context, themeResId);
|
||||
}
|
||||
|
||||
public void initView() {
|
||||
setContentView(R.layout.check_info_list);
|
||||
mRecyclerView = findViewById(R.id.check_list_recycler);
|
||||
titleView = findViewById(R.id.check_info_title);
|
||||
if (mStyle.equals(CheckItemInfo.CheckInfoStyle.CHECK_INFO_STYLE_DEVICES)) {
|
||||
titleView.setText("硬件自检结果");
|
||||
} else {
|
||||
titleView.setText("系统自检结果");
|
||||
}
|
||||
//网格布局
|
||||
GridLayoutManager layoutManager = new GridLayoutManager(mContext, 4);
|
||||
mRecyclerView.setLayoutManager(layoutManager);
|
||||
layoutManager.setOrientation(GridLayoutManager.VERTICAL);
|
||||
//网格绘制
|
||||
try {
|
||||
CheckInfoGridItemDivider gridLayoutDivider = new CheckInfoGridItemDivider(1,
|
||||
(mContext.getResources().getColor(R.color.check_info_position_line_color)));
|
||||
mRecyclerView.addItemDecoration(gridLayoutDivider);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
List resultData = showInfoResult();
|
||||
mRecyclerView.setAdapter(new CheckInfoAdapter(mContext, mStyle, resultData));
|
||||
//关闭按钮
|
||||
findViewById(R.id.cancel_info_list_button).setOnClickListener(v -> {
|
||||
cancel();
|
||||
});
|
||||
}
|
||||
|
||||
public List showInfoResult() {
|
||||
if (result.size() > 0) {
|
||||
result.clear();
|
||||
}
|
||||
try {
|
||||
List<CheckResultData.CheckListItem> checkListResult = new ArrayList();
|
||||
try {
|
||||
if (mStyle.equals(CheckItemInfo.CheckInfoStyle.CHECK_INFO_STYLE_DEVICES)) {
|
||||
checkListResult = mCheckResultData.getData().getDevices();
|
||||
} else {
|
||||
checkListResult = mCheckResultData.getData().getSoft();
|
||||
}
|
||||
for (CheckResultData.CheckListItem item : checkListResult) {
|
||||
if (item.getStateValue() != null) {
|
||||
result.addAll(checkListResult);
|
||||
}
|
||||
if (item.getItems() != null) {
|
||||
result.addAll(item.getItems());
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
Log.d(TAG, "检测指标结果值===" + result.toString());
|
||||
} catch (Exception e) {
|
||||
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public void cancel() {
|
||||
super.dismiss();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dismiss() {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="#767FCD"/>
|
||||
<stroke android:width="3px"/>
|
||||
</shape>
|
||||
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<stroke
|
||||
android:width="3px"
|
||||
android:color="@color/check_info_shape_color" />
|
||||
<padding
|
||||
android:bottom="2px"
|
||||
android:left="2px"
|
||||
android:right="2px"
|
||||
android:top="2px" />
|
||||
</shape>
|
||||
@@ -14,7 +14,7 @@
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/btnBack"
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
<?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="@dimen/dp_405"
|
||||
android:layout_height="@dimen/dp_127">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/info_check_icon"
|
||||
android:layout_width="@dimen/dp_40"
|
||||
android:layout_height="@dimen/dp_40"
|
||||
android:layout_marginLeft="@dimen/dp_40"
|
||||
android:src="@drawable/check_right" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/info_result_tx"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="检测中"
|
||||
android:gravity="center"
|
||||
android:textAlignment="center"
|
||||
android:textColor="#fff"
|
||||
android:textSize="@dimen/dp_38"
|
||||
android:layout_marginLeft="@dimen/dp_27"
|
||||
app:layout_constraintLeft_toRightOf="@+id/info_check_icon" />
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -0,0 +1,45 @@
|
||||
<?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="1900px"
|
||||
android:layout_height="1140px"
|
||||
android:layout_gravity="center"
|
||||
android:background="@drawable/check_dialog_back">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/cancel_info_list_button"
|
||||
android:layout_width="@dimen/dp_106"
|
||||
android:layout_height="@dimen/dp_106"
|
||||
android:layout_marginLeft="@dimen/dp_30"
|
||||
android:layout_marginTop="@dimen/dp_30"
|
||||
android:src="@drawable/module_common_icon_close"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/check_info_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_69"
|
||||
android:gravity="center"
|
||||
android:text="自检结果"
|
||||
android:textColor="#fff"
|
||||
android:textSize="@dimen/dp_42"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/check_list_recycler"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="@dimen/dp_143"
|
||||
android:layout_marginTop="@dimen/dp_184"
|
||||
android:layout_marginRight="@dimen/dp_143"
|
||||
android:layout_marginBottom="@dimen/dp_80"
|
||||
android:background="@drawable/check_recycler_shape"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -3,11 +3,11 @@
|
||||
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"
|
||||
android:layout_marginBottom="@dimen/dp_15"
|
||||
android:layout_marginBottom="@dimen/dp_35"
|
||||
android:background="@drawable/check_list_item_back">
|
||||
|
||||
<TextView
|
||||
@@ -17,7 +17,7 @@
|
||||
android:layout_marginStart="@dimen/dp_80"
|
||||
android:layout_marginLeft="@dimen/dp_50"
|
||||
android:layout_marginTop="@dimen/dp_50"
|
||||
android:text="版本检测:(以下 1 项需要优化,版本升级后需要重启设备)"
|
||||
android:text="硬件检测:"
|
||||
android:textColor="@color/module_commons_wm_dialog_text_textColor"
|
||||
android:textSize="@dimen/dp_42"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
@@ -30,8 +30,8 @@
|
||||
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_marginBottom="@dimen/dp_70"
|
||||
android:descendantFocusability="blocksDescendants"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
@@ -42,7 +42,8 @@
|
||||
android:layout_width="@dimen/dp_150"
|
||||
android:layout_height="@dimen/dp_150"
|
||||
android:layout_gravity="center"
|
||||
android:src="@drawable/auto" />
|
||||
android:src="@drawable/auto"
|
||||
android:clickable="true"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/icon_auto_title"
|
||||
@@ -51,7 +52,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" />
|
||||
@@ -59,10 +60,11 @@
|
||||
<TextView
|
||||
android:id="@+id/auto_risk_state"
|
||||
android:layout_width="@dimen/dp_260"
|
||||
android:layout_height="@dimen/dp_90"
|
||||
android:layout_height="wrap_content"
|
||||
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 +78,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">
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
android:layout_marginBottom="@dimen/dp_15">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/error_tip_image"
|
||||
android:id="@+id/check_tip_image"
|
||||
android:layout_width="@dimen/dp_140"
|
||||
android:layout_height="@dimen/dp_140"
|
||||
android:layout_marginStart="@dimen/dp_856"
|
||||
@@ -18,14 +18,14 @@
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/error_title"
|
||||
android:id="@+id/check_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_65"
|
||||
android:layout_marginTop="@dimen/dp_20"
|
||||
android:text="自动驾驶车辆存在风险"
|
||||
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" />
|
||||
app:layout_constraintLeft_toRightOf="@+id/check_tip_image"
|
||||
app:layout_constraintTop_toTopOf="@+id/check_tip_image" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -8,5 +8,9 @@
|
||||
<color name="check_little_btn_solid_green">#997AFF87</color>
|
||||
<color name="check_little_btn_green">#7AFF87</color>
|
||||
<color name="check_list_item_back">#242B59</color>
|
||||
<color name="check_icon_error_color">#EE3132</color>
|
||||
<color name="check_info_position_line_color">#666DA5</color>
|
||||
<color name="check_info_shape_color">#767FCD</color>
|
||||
|
||||
|
||||
</resources>
|
||||
@@ -6,5 +6,6 @@
|
||||
@android:drawable/progress_indeterminate_horizontal
|
||||
</item>
|
||||
<item name="android:progressDrawable">@drawable/check_progress</item>
|
||||
<item name="android:listDivider">@drawable/check_driver</item>
|
||||
</style>
|
||||
</resources>
|
||||
@@ -338,6 +338,7 @@
|
||||
android:id="@+id/error_tip_image"
|
||||
android:layout_width="@dimen/dp_40"
|
||||
android:layout_height="@dimen/dp_40"
|
||||
android:visibility="invisible"
|
||||
android:src="@drawable/check_error_image"
|
||||
app:layout_constraintRight_toRightOf="@+id/module_ext_enter_check"
|
||||
app:layout_constraintTop_toTopOf="@+id/module_ext_enter_check" />
|
||||
|
||||
Reference in New Issue
Block a user