| | |
| | | import android.app.PendingIntent; |
| | | import android.content.Context; |
| | | import android.content.Intent; |
| | | import android.graphics.drawable.Drawable; |
| | | import android.os.Bundle; |
| | | |
| | | import androidx.annotation.NonNull; |
| | |
| | | private List<SimulateNightBean.QuestionBean> tempQs= new ArrayList<>(); |
| | | private TableRow tableRow1,tableRow2,tableRow3; |
| | | |
| | | private Button btn_1,btn_2; |
| | | private List<Integer> btn_ids = new ArrayList<Integer>(); |
| | | |
| | | private Handler mHandler = new Handler(new Handler.Callback() { |
| | |
| | | |
| | | for (int i = 0; i < btn_ids.size(); i++) { |
| | | int viewId = getResources().getIdentifier(String.valueOf(btn_ids.get(i)),"id",_mActivity.getPackageName()); |
| | | ((Button) view.findViewById(viewId)).setBackgroundColor(100+i+1); |
| | | ((Button) view.findViewById(viewId)).setBackground(bbb(101+i)); |
| | | |
| | | } |
| | | } |
| | | if (msg.what == SPEED_DATA){ |
| | |
| | | * @param type |
| | | * @return |
| | | */ |
| | | private int bbb(int type) { |
| | | private Drawable bbb(int type) { |
| | | if (examStatusList!=null &&examStatusList.size()>0){ |
| | | for (ExamStatus examStatus: |
| | | examStatusList) { |
| | |
| | | if (examStatusList.get(0).getStartExam() == Constant.NONE_BEEN_START_EXAM){ |
| | | //结束考试了 |
| | | MyLog.i("进入考场结束考试,startexam="+examStatus.getStartExam()); |
| | | return getResources().getColor(R.color.colorAccent); |
| | | return getResources().getDrawable(R.drawable.ic_btn_fail); |
| | | }else{ |
| | | MyLog.i("进入考场,type="+type); |
| | | return getResources().getColor(R.color.pink); |
| | | return getResources().getDrawable(R.drawable.ic_btn_examing); |
| | | } |
| | | |
| | | |
| | | }else if (examStatus.getEnter() == safeluck.drive.evaluation.DB.Constant.FINISH_ITEM){ |
| | | |
| | | if (examStatusList.get(0).getStartExam()==Constant.NONE_BEEN_START_EXAM){ |
| | | return getResources().getColor(R.color.examing); |
| | | return getResources().getDrawable(R.drawable.ic_btn_daikao); |
| | | } |
| | | String ss=ExamPlatformData.getInstance().getItemStatusStr(type); |
| | | if (item_conents.contains(ss)) { |
| | | MyLog.i("该项考试失败,type="+type); |
| | | |
| | | return getResources().getColor(R.color.colorAccent); |
| | | return getResources().getDrawable(R.drawable.ic_btn_fail); |
| | | }else{ |
| | | if (examStatus.getResult() ==1){ |
| | | MyLog.i(String.format("已经播放过%s合格",ss)); |
| | |
| | | examStatusViewModel.updateItemExamResult(1,examStatus.getMap_id()); |
| | | } |
| | | |
| | | return getResources().getColor(R.color.train_btn_return); |
| | | return getResources().getDrawable(R.drawable.ic_btn_succ); |
| | | } |
| | | |
| | | }else{ |
| | | return getResources().getColor(R.color.examing); |
| | | return getResources().getDrawable(R.drawable.ic_btn_daikao); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return getResources().getColor(R.color.examing); |
| | | return getResources().getDrawable(R.drawable.ic_btn_daikao); |
| | | } |
| | | |
| | | |