[add] 弹框临时测试入口添加 路由接口增加
This commit is contained in:
@@ -1,35 +0,0 @@
|
||||
package com.mogo.module.check;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.os.PersistableBundle;
|
||||
import android.widget.Button;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
/**
|
||||
* @author liujing
|
||||
* @description 检测页面
|
||||
* @since: 7/27/21
|
||||
*/
|
||||
public class CheckActivity extends AppCompatActivity {
|
||||
|
||||
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_check);
|
||||
|
||||
findViewById(R.id.btnBack).setOnClickListener(v -> {
|
||||
finish();
|
||||
});
|
||||
}
|
||||
|
||||
public static void start(Context context) {
|
||||
Intent starter = new Intent(context, CheckActivity.class);
|
||||
context.startActivity(starter);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -18,8 +18,8 @@ import com.mogo.utils.logger.Logger;
|
||||
*/
|
||||
@Route(path = MogoServicePaths.PATH_CHECK)
|
||||
public class CheckProvider implements ICheckProvider {
|
||||
private static final String TAG = "CheckProvider";
|
||||
private Context mContext;
|
||||
private static final String TAG = "CheckProvider";
|
||||
private Context mContext;
|
||||
|
||||
|
||||
@Override
|
||||
@@ -34,4 +34,11 @@ public class CheckProvider implements ICheckProvider {
|
||||
CheckActivity.start(context);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showCheckDialog(Context context) {
|
||||
if (context != null) {
|
||||
CheckActivity.showDialog(context);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,12 +13,15 @@ import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.mogo.module.check.R;
|
||||
import com.mogo.module.check.model.CheckItemInfo;
|
||||
import com.mogo.module.check.net.CheckApiServices;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.module.common.MogoModulePaths;
|
||||
import com.mogo.module.common.constants.HostConst;
|
||||
import com.mogo.module.common.view.SpacesItemDecoration;
|
||||
import com.mogo.service.MogoServicePaths;
|
||||
import com.mogo.utils.CommonUtils;
|
||||
import com.mogo.utils.network.utils.NetworkStatusUtil;
|
||||
import com.tencent.bugly.beta.Beta;
|
||||
@@ -418,6 +421,15 @@ public class CheckActivity extends AppCompatActivity {
|
||||
context.startActivity(starter);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 指标异常弹框
|
||||
*/
|
||||
public static void showDialog(Context context) {
|
||||
CheckDialog dialog = new CheckDialog(context, true);
|
||||
dialog.show();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
|
||||
@@ -1,22 +1,59 @@
|
||||
package com.mogo.module.check.view;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.mogo.module.check.R;
|
||||
import com.mogo.module.common.dialog.BaseFloatDialog;
|
||||
|
||||
/**
|
||||
* @author liujing
|
||||
* @description 检测提示弹框
|
||||
* @description 车辆监控弹框提示
|
||||
* @since: 7/30/21
|
||||
*/
|
||||
public class CheckDialog extends BaseFloatDialog {
|
||||
public CheckDialog(@NonNull Context context) {
|
||||
|
||||
private ImageView cancel;
|
||||
private boolean showError;
|
||||
|
||||
public CheckDialog(@NonNull Context context, boolean hasError) {
|
||||
super(context);
|
||||
showError = hasError;
|
||||
initView();
|
||||
}
|
||||
|
||||
public CheckDialog(@NonNull Context context, int themeResId) {
|
||||
super(context, themeResId);
|
||||
}
|
||||
|
||||
public void initView() {
|
||||
setContentView(R.layout.check_dialog);
|
||||
cancel = findViewById(R.id.cancel_button);
|
||||
cancel.setOnClickListener(v -> {
|
||||
cancel();
|
||||
});
|
||||
|
||||
//根据条件显示体检页面/风险提示
|
||||
if (showError == true) {
|
||||
findViewById(R.id.error_view).setVisibility(View.VISIBLE);
|
||||
findViewById(R.id.check_view).setVisibility(View.INVISIBLE);
|
||||
|
||||
} else {
|
||||
findViewById(R.id.error_view).setVisibility(View.INVISIBLE);
|
||||
findViewById(R.id.check_view).setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
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="#1E3282"/>
|
||||
<corners android:radius="30px"/>
|
||||
</shape>
|
||||
@@ -4,7 +4,8 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="1529px"
|
||||
android:layout_height="720px"
|
||||
android:layout_gravity="center">
|
||||
android:layout_gravity="center"
|
||||
android:background="@drawable/check_dialog_back">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/cancel_button"
|
||||
@@ -20,18 +21,17 @@
|
||||
android:id="@+id/imageView"
|
||||
android:layout_width="@dimen/dp_795"
|
||||
android:layout_height="@dimen/dp_484"
|
||||
android:layout_marginEnd="@dimen/check_image_right"
|
||||
android:layout_marginBottom="@dimen/check_image_bottom"
|
||||
android:layout_marginEnd="@dimen/dp_50"
|
||||
android:layout_marginBottom="@dimen/dp_78"
|
||||
android:src="@drawable/check_tip_image"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/error_view"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_79"
|
||||
android:layout_marginStart="@dimen/dp_97"
|
||||
android:layout_marginTop="@dimen/dp_225"
|
||||
android:visibility="invisible"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
@@ -85,7 +85,7 @@
|
||||
android:id="@+id/check_view"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_79"
|
||||
android:layout_marginStart="@dimen/dp_133"
|
||||
android:layout_marginTop="@dimen/dp_200"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<dimen name="check_button_text_size">38px</dimen>
|
||||
<dimen name="check_button_bottom">70px</dimen>
|
||||
<dimen name="check_button_left">133px</dimen>
|
||||
<dimen name="check_image_bottom">78px</dimen>
|
||||
<dimen name="check_image_bottom">50px</dimen>
|
||||
<dimen name="check_image_right">50px</dimen>
|
||||
<dimen name="check_hard_ware_image_width">1452px</dimen>
|
||||
<dimen name="check_hard_ware_image_height">715px</dimen>
|
||||
|
||||
@@ -72,6 +72,7 @@ import com.mogo.module.extensions.view.ArcView;
|
||||
import com.mogo.module.service.receiver.MogoReceiver;
|
||||
import com.mogo.module.share.manager.ServiceApisManager;
|
||||
import com.mogo.service.IMogoServiceApis;
|
||||
import com.mogo.service.MogoServicePaths;
|
||||
import com.mogo.service.analytics.IMogoAnalytics;
|
||||
import com.mogo.service.connection.IMogoOnMessageListener;
|
||||
import com.mogo.service.entrance.ButtonIndex;
|
||||
@@ -408,6 +409,14 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
|
||||
MogoApisHandler.getInstance().getApis().getCheckProvider().startCheckActivity(getContext());
|
||||
}
|
||||
});
|
||||
|
||||
//临时测试代码
|
||||
jumpCheck.setLongClickable(true);
|
||||
jumpCheck.setOnLongClickListener(v->{
|
||||
MogoApisHandler.getInstance().getApis().getCheckProvider().showCheckDialog(getContext());
|
||||
return true;
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
private int debugPanelClickCount = 0;
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.mogo.module.main.monitoring;
|
||||
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
|
||||
/**
|
||||
* @author liujing
|
||||
* @description 车辆监控
|
||||
* @since: 8/16/21
|
||||
*/
|
||||
public class VehicleMonitoring implements Handler.Callback {
|
||||
|
||||
private final Context mContext;
|
||||
private final Handler mHandler = new Handler();
|
||||
//自动驾驶状态下10分钟弹框提示一次
|
||||
private static final long AUTO_CHECK_STATUS_DELAY = 10 * 60 * 1000;
|
||||
private static final int AUTO_CHECK_STATUS = 10001;
|
||||
private static final int MANUAL_CHECK_STATUS = 10002;
|
||||
|
||||
public VehicleMonitoring(Context context) {
|
||||
mContext = context;
|
||||
}
|
||||
|
||||
public void vehicleCheckForAuto() {
|
||||
mHandler.sendEmptyMessageDelayed(AUTO_CHECK_STATUS, AUTO_CHECK_STATUS_DELAY);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean handleMessage(Message msg) {
|
||||
switch (msg.what) {
|
||||
case AUTO_CHECK_STATUS:
|
||||
|
||||
return true;
|
||||
case MANUAL_CHECK_STATUS:
|
||||
return true;
|
||||
default:
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -15,6 +15,7 @@ import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.module.main.EventDispatchCenter;
|
||||
import com.mogo.module.main.cards.MogoModulesManager;
|
||||
import com.mogo.module.main.delaycheck.DelayCheckUtil;
|
||||
import com.mogo.module.main.monitoring.VehicleMonitoring;
|
||||
import com.mogo.service.IMogoServiceApis;
|
||||
import com.mogo.utils.UiThreadHandler;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
@@ -52,6 +53,9 @@ class MogoMainService extends Service implements IMogoLocationListener {
|
||||
// 开启延时检测
|
||||
DelayCheckUtil delayCheckUtil = new DelayCheckUtil(this);
|
||||
delayCheckUtil.waitingForCheck();
|
||||
//车辆检测
|
||||
VehicleMonitoring monitoring = new VehicleMonitoring(this);
|
||||
monitoring.vehicleCheckForAuto();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
||||
@@ -322,7 +322,7 @@ public class MogoServicePaths {
|
||||
public static final String PATH_V2X_FRONT_CRASH_WARNING = "/front/crashwarning";
|
||||
|
||||
/**
|
||||
* ADAS 模块
|
||||
* 车辆检测 模块
|
||||
*/
|
||||
public static final String PATH_CHECK = "/check/api";
|
||||
|
||||
|
||||
@@ -12,4 +12,11 @@ public interface ICheckProvider extends IProvider {
|
||||
* 启动检测模块
|
||||
*/
|
||||
void startCheckActivity(Context context);
|
||||
|
||||
/**
|
||||
* 检测弹框
|
||||
*/
|
||||
void showCheckDialog(Context context);
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user