lizhanwei
2020-04-09 524763aa48d11019112a8b1c61e03029817e5a85
app/src/main/java/safeluck/drive/evaluation/MainActivity.java
@@ -25,6 +25,7 @@
import androidx.work.WorkManager;
import me.yokeyword.fragmentation.SupportActivity;
import safeluck.drive.evaluation.DB.exam_status.ExamStatusViewModel;
import safeluck.drive.evaluation.DB.rtktb.RTKConfig;
import safeluck.drive.evaluation.DB.rtktb.RTKConfigViewModel;
import safeluck.drive.evaluation.DB.signalConfigdb.SignalConfigViewModel;
@@ -46,6 +47,9 @@
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
import safeluck.drive.evaluation.im.IMSClientBootstrap;
import safeluck.drive.evaluation.im.MessageProcessor;
@@ -58,6 +62,7 @@
import safeluck.drive.evaluation.util.SPUtils;
import safeluck.drive.evaluation.util.Utils;
import safeluck.drive.evaluation.viewmodels.ExamPlatformModel;
import safeluck.drive.evaluation.viewmodels.TimeViewModel;
public class MainActivity extends SupportActivity implements IMSConnectStatusCallback {
@@ -69,7 +74,9 @@
    private Gson gson = new Gson();
    String[] PERMISSIONS = new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE, Manifest.permission.CAMERA};
    RTKConfigViewModel rtkConfigViewModel;
    public ExamPlatformModel examPlatformModel;
    private ScheduledExecutorService scheduledExecutorService = Executors.newSingleThreadScheduledExecutor();
    private ICEventListener icEventListener = new ICEventListener() {
        @Override
@@ -98,7 +105,6 @@
    private List<SignalConfigRemote> signalConfiglist = new ArrayList<>();
public ExamPlatformModel examPlatformModel;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
@@ -133,7 +139,12 @@
            }
        });
        scheduledExecutorService.scheduleAtFixedRate(new Runnable() {
            @Override
            public void run() {
                ExamPlatformData.getInstance().setTimeArrive_10s(true);
            }
        },10,10, TimeUnit.SECONDS);
        rtkConfigViewModel  = ViewModelProviders.of(this).get(RTKConfigViewModel.class);