Merge branch 'check_check' into dev/dev_eagle_architecture_upgrade
This commit is contained in:
@@ -71,7 +71,7 @@ public class VehicleMonitoringManager implements ICheckProvider {
|
||||
@Override
|
||||
public boolean checkMonitor(Context context) {
|
||||
if (context != null) {
|
||||
return CheckActivity.checkMonitor();
|
||||
return CheckActivity.checkMonitor(context);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -75,6 +75,8 @@ public class CheckActivity extends AppCompatActivity {
|
||||
private ProgressBar mProgressBar;
|
||||
private final static long DURATION_TIME = 1000;
|
||||
private static CheckAdapter mCheckAdapter;
|
||||
private static boolean isFront = false;
|
||||
private static CheckDialog dialog;
|
||||
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
@@ -87,6 +89,7 @@ public class CheckActivity extends AppCompatActivity {
|
||||
* 列表View初始化
|
||||
*/
|
||||
public void initView() {
|
||||
isFront = true;
|
||||
setAnimation = new AnimatorSet();
|
||||
mImageView = findViewById(R.id.btnBack);
|
||||
scanBottomCarImage = findViewById(R.id.scan_car_image);
|
||||
@@ -100,7 +103,7 @@ public class CheckActivity extends AppCompatActivity {
|
||||
finish();
|
||||
});
|
||||
animation();
|
||||
loadDetail();
|
||||
loadDetail(context);
|
||||
mRecyclerView = findViewById(R.id.check_list);
|
||||
CheckLinearLayout linearLayoutManager =
|
||||
new CheckLinearLayout(this, CheckLinearLayout.VERTICAL, false);
|
||||
@@ -113,16 +116,16 @@ public class CheckActivity extends AppCompatActivity {
|
||||
/**
|
||||
* 自动驾驶状态下指标监测
|
||||
*/
|
||||
public static boolean checkMonitor() {
|
||||
public static boolean checkMonitor(Context context) {
|
||||
Log.d(TAG, "checkMonitor");
|
||||
loadDetail();
|
||||
loadDetail(context);
|
||||
return true;
|
||||
}
|
||||
|
||||
//网络请求,获取自车检测结果(工控机上报云端)append("sn", MoGoAiCloudClientConfig.getInstance().getSn())
|
||||
public static void loadDetail() {
|
||||
//网络请求,获取自车检测结果(工控机上报云端)
|
||||
public static void loadDetail(Context context) {
|
||||
final Map<String, Object> params = ParamsBuilder.of(false)
|
||||
.append("sn", "X2020210915BEAEDAE69E1E745A")//测试代码
|
||||
.append("sn", MoGoAiCloudClientConfig.getInstance().getSn())
|
||||
.build();
|
||||
CheckApiServiceFactory.getDataApiService(context).loadMonitorDetail(params)
|
||||
.subscribeOn(Schedulers.io())
|
||||
@@ -141,9 +144,10 @@ public class CheckActivity extends AppCompatActivity {
|
||||
}
|
||||
|
||||
if (((CheckResultData) o).getData().getVehicle().getState() == 1) {
|
||||
CallerCheckManager.updateMonitoringStatus(MogoReceiver.ACTION_CHECK_VEHICLE_MONITORING, true);
|
||||
} else {
|
||||
CallerCheckManager.updateMonitoringStatus(MogoReceiver.ACTION_CHECK_VEHICLE_MONITORING, false);
|
||||
} else {
|
||||
CallerCheckManager.updateMonitoringStatus(MogoReceiver.ACTION_CHECK_VEHICLE_MONITORING, true);
|
||||
showDialog(context);
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -152,7 +156,7 @@ public class CheckActivity extends AppCompatActivity {
|
||||
@Override
|
||||
public void onError(String message, int code) {
|
||||
super.onError(message, code);
|
||||
Log.d(TAG, "车辆自检失败,请稍后重试"+"=="+message+String.valueOf(code));
|
||||
Log.d(TAG, "车辆自检失败,请稍后重试" + "==" + message + String.valueOf(code));
|
||||
}
|
||||
});
|
||||
|
||||
@@ -272,13 +276,21 @@ public class CheckActivity extends AppCompatActivity {
|
||||
* 指标异常弹框
|
||||
*/
|
||||
public static void showDialog(Context context) {
|
||||
CheckDialog dialog = new CheckDialog(context, true);
|
||||
dialog.show();
|
||||
try {
|
||||
if (dialog != null) {
|
||||
dialog.cancel();
|
||||
}
|
||||
dialog = new CheckDialog(context, true);
|
||||
dialog.show();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
isFront = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,26 +1,33 @@
|
||||
package com.mogo.eagle.core.function.check.view;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.mogo.eagle.core.function.call.check.CallerCheckManager;
|
||||
import com.mogo.eagle.core.function.check.R;
|
||||
import com.mogo.module.common.dialog.BaseFloatDialog;
|
||||
|
||||
/**
|
||||
* @author liujing
|
||||
* @description 车辆监控弹框提示(长时间未检测或者后台任务检测出现问题的弹框)
|
||||
* 第一版本为添加长时间未检测的提示框,因为逻辑冲突,二期需求与产品确认,UI公用
|
||||
* @since: 7/30/21
|
||||
*/
|
||||
public class CheckDialog extends BaseFloatDialog {
|
||||
|
||||
private ImageView cancel;
|
||||
private boolean showWarning;
|
||||
private TextView checkDetail;
|
||||
private Context mContext;
|
||||
|
||||
public CheckDialog(@NonNull Context context, boolean hasError) {
|
||||
super(context);
|
||||
mContext = context;
|
||||
showWarning = hasError;
|
||||
initView();
|
||||
}
|
||||
@@ -35,6 +42,13 @@ public class CheckDialog extends BaseFloatDialog {
|
||||
cancel.setOnClickListener(v -> {
|
||||
cancel();
|
||||
});
|
||||
checkDetail = findViewById(R.id.check_detail);
|
||||
checkDetail.setOnClickListener(v -> {
|
||||
cancel();
|
||||
if (mContext != null) {
|
||||
CallerCheckManager.startCheckActivity(mContext);
|
||||
}
|
||||
});
|
||||
|
||||
//根据条件显示体检页面/风险提示
|
||||
if (showWarning == true) {
|
||||
|
||||
Reference in New Issue
Block a user