| | |
| | | import safeluck.drive.evaluation.DB.exam_status.ExamStatusViewModel; |
| | | import safeluck.drive.evaluation.DB.failitems.FailedProjViewModel; |
| | | import safeluck.drive.evaluation.DB.failitems.FailedProj_select; |
| | | import safeluck.drive.evaluation.MainActivity; |
| | | import safeluck.drive.evaluation.R; |
| | | import safeluck.drive.evaluation.adapter.ScoreAdapter; |
| | | import safeluck.drive.evaluation.bean.ExamPlatformData; |
| | |
| | | private int item_id;//扣分分数总和 |
| | | private ExamStatusViewModel examStatusViewModel; |
| | | private static final int ADD_DATA = 1; |
| | | private TextView tv_speed,tv_total_score,tv_sat_num,tv_name,tv_id,tv_work_platform,tv_network_time |
| | | ,tv_qf,tv_start_time,tv_sex; |
| | | private TextView tv_speed,tv_total_score,tv_name,tv_id |
| | | ,tv_start_time,tv_sex; |
| | | private double speed=0.0; |
| | | private ImageView iv_rtk_status,iv_head; |
| | | private ImageView iv_head; |
| | | WokViewModel wokViewModel; |
| | | |
| | | private int currTotalScore = 100; |
| | |
| | | } |
| | | }); |
| | | |
| | | AppStatusViewModel appStatusViewModel = ViewModelProviders.of(this).get(AppStatusViewModel.class); |
| | | appStatusViewModel.getAppStatus().observe(this, new Observer<AppStatus>() { |
| | | @Override |
| | | public void onChanged(AppStatus appStatus) { |
| | | if (appStatus != null){ |
| | | Log.i(TAG, "onChanged: "+appStatus.toString()); |
| | | iv_rtk_status.getDrawable().setLevel(appStatus.getRtk_connect_status()); |
| | | tv_work_platform.setText(getString(R.string.platform_status,ExamPlatformData.getInstance().getExamplatformStatusStr( |
| | | ExamPlatformData.getInstance().getExamplatformStatus() |
| | | ))); |
| | | tv_sat_num.setText(String.valueOf(appStatus.getSat_num()).length()==1?"0"+appStatus.getSat_num():String.valueOf(appStatus.getSat_num())); |
| | | tv_qf.setText(getResources().getStringArray(R.array.qf_status)[appStatus.getQf()]); |
| | | } |
| | | } |
| | | }); |
| | | |
| | | TimeViewModel timeViewModel = ViewModelProviders.of(this).get(TimeViewModel.class); |
| | | timeViewModel.getLiveDataTime().observe(this, new Observer<String>() { |
| | | @Override |
| | | public void onChanged(String s) { |
| | | tv_network_time.setText(s); |
| | | } |
| | | }); |
| | | |
| | | return view; |
| | | } |
| | |
| | | |
| | | |
| | | private void initView(View view) { |
| | | Log.i(TAG,"currTopFragment="+getTopFragment().getClass().getSimpleName()); |
| | | if (HomeFragment.class.getSimpleName().equals(getTopFragment().getClass().getSimpleName())){ |
| | | ((MainActivity)_mActivity).viewtitle.setVisibility(View.GONE); |
| | | ((MainActivity)_mActivity).btn_return.setVisibility(View.GONE); |
| | | }else{ |
| | | ((MainActivity)_mActivity).viewtitle.setVisibility(View.VISIBLE); |
| | | ((MainActivity)_mActivity).btn_return.setVisibility(View.VISIBLE); |
| | | } |
| | | btn_ids.add(R.id.btn_1); |
| | | btn_ids.add(R.id.btn_2); |
| | | btn_ids.add(R.id.btn_3); |
| | |
| | | tv_id = view.findViewById(R.id.tv_ID); |
| | | tv_start_time = view.findViewById(R.id.tv_start_time); |
| | | tv_sex = view.findViewById(R.id.tv_sex); |
| | | tv_work_platform = view.findViewById(R.id.platform); |
| | | |
| | | iv_rtk_status = view.findViewById(R.id.iv_rtk_connect); |
| | | iv_rtk_status.getDrawable().setLevel(0); |
| | | iv_head = view.findViewById(R.id.iv_head); |
| | | tv_sat_num = view.findViewById(R.id.tv_sat_num_instatus); |
| | | tv_qf = view.findViewById(R.id.tv_qf); |
| | | tv_speed = view.findViewById(R.id.tv_speed); |
| | | tv_total_score = view.findViewById(R.id.tv_total_score); |
| | | tv_network_time = view.findViewById(R.id.network_time); |
| | | |
| | | |
| | | tv_network_time.setText(Utils.getHHmm()); |
| | | |
| | | tv_speed.setText(getResources().getString(R.string.speed,speed)); |
| | | |
| | | btn_return = view.findViewById(R.id.btn_return); |
| | | btn_return.setOnClickListener(this); |
| | | mListView = view.findViewById(R.id.lv); |
| | | mListView.setFocusable(false); |
| | | mListView.setOnTouchListener(new View.OnTouchListener() { |
| | |
| | | } |
| | | start(mapFragment); |
| | | } |
| | | break; |
| | | case R.id.btn_return: |
| | | _mActivity.onBackPressed(); |
| | | break; |
| | | case R.id.iv_head: |
| | | MyLog.i(TAG,"签到,获取身份证物理卡号"); |
| | |
| | | @Override |
| | | public void onDetach() { |
| | | super.onDetach(); |
| | | Log.i(TAG,"onDetach"); |
| | | CEventCenter.onBindEvent(false,icEventListener,Constant.BIND_SPEED_TOPIC); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onDestroyView() { |
| | | super.onDestroyView(); |
| | | Log.i(TAG,"onDestroyView"); |
| | | ((MainActivity)_mActivity).viewtitle.setVisibility(View.GONE); |
| | | ((MainActivity)_mActivity).btn_return.setVisibility(View.GONE); |
| | | } |
| | | } |