app/src/main/java/safeluck/drive/evaluation/Constant.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
app/src/main/java/safeluck/drive/evaluation/app.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
app/src/main/java/safeluck/drive/evaluation/bean/ExamStatus.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
app/src/main/java/safeluck/drive/evaluation/customview/ArrowView.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
app/src/main/java/safeluck/drive/evaluation/customview/HouseView.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
app/src/main/java/safeluck/drive/evaluation/fragment/NetWorkTrainFragment.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
app/src/main/res/values/attrs.xml | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
app/src/main/res/values/colors.xml | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
app/src/main/java/safeluck/drive/evaluation/Constant.java
@@ -60,4 +60,6 @@ public static final String RTK_LOGIN_CODE_COLUMN = "RTK_LOGIN_CODE_COLUMN"; public static final String RTK_CONN_STATUS_COLUMN = "RTK_CONN_STATUS_COLUMN"; public static final String WORK_PLATFORM_STATUS_COLUMN = "WORK_PLATFORM_STATUS_COLUMN"; public static final int ENTER_OR_EXIT_ITEM = 0x000D; } app/src/main/java/safeluck/drive/evaluation/app.java
@@ -119,7 +119,8 @@ MyLog.d(TAG, String.format("收到命令[%d],Json内容为%s", cmd, json)); switch (cmd) { case Constant.NDK_START: sendVechileInfo(); sendMapInfo(); break; case Constant.RTK_PLATFORM_REGISTER_STATUS: CEventCenter.dispatchEvent(Constant.BIND_CONNECT_RTK_TOPIC,cmd,0,json); @@ -195,6 +196,9 @@ OneTimeWorkRequest gpsinfoWorkRequest = new OneTimeWorkRequest.Builder(GpsInfoWorker.class).setInputData(gpsData).build(); WorkManager.getInstance(getApplicationContext()).enqueue(gpsinfoWorkRequest); break; case Constant.ENTER_OR_EXIT_ITEM: break; } app/src/main/java/safeluck/drive/evaluation/bean/ExamStatus.java
New file @@ -0,0 +1,35 @@ package safeluck.drive.evaluation.bean; public class ExamStatus { // 1 - 倒库 //2 - 坡起 //3 - 侧方停车 //4 - 曲线行驶 //5 - 直角转弯 private int map_id; //0 退出(考试完毕) //1 进入(正在进行考试) 2-待考 private int enter; public ExamStatus(int map_id, int enter) { this.map_id = map_id; this.enter = enter; } public int getMap_id() { return map_id; } public void setMap_id(int map_id) { this.map_id = map_id; } public int getEnter() { return enter; } public void setEnter(int enter) { this.enter = enter; } } app/src/main/java/safeluck/drive/evaluation/customview/ArrowView.java
@@ -11,6 +11,7 @@ import android.util.TypedValue; import android.view.View; import androidx.annotation.ColorRes; import androidx.annotation.Nullable; import safeluck.drive.evaluation.R; @@ -44,6 +45,7 @@ super(context, attrs, defStyleAttr); TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.ArrowView,defStyleAttr,0); text = a.getString(R.styleable.ArrowView_text); color = a.getColor(R.styleable.ArrowView_color,Color.parseColor("#99C3D1")); a.recycle(); } @@ -76,4 +78,8 @@ } return keys; } public void setColor( int mColor){ this.color = mColor; } } app/src/main/java/safeluck/drive/evaluation/customview/HouseView.java
@@ -41,6 +41,7 @@ super(context, attrs, defStyleAttr); TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.ArrowView,defStyleAttr,0); text = typedArray.getString(R.styleable.ArrowView_text); color = typedArray.getColor(R.styleable.ArrowView_color,Color.parseColor("#99C3D1")); typedArray.recycle(); } @@ -76,4 +77,8 @@ } return keys; } public void setColor(int mColor){ this.color = mColor; } } app/src/main/java/safeluck/drive/evaluation/fragment/NetWorkTrainFragment.java
@@ -35,8 +35,11 @@ import safeluck.drive.evaluation.DB.failitems.FailedProj_select; import safeluck.drive.evaluation.R; import safeluck.drive.evaluation.adapter.ScoreAdapter; import safeluck.drive.evaluation.bean.ExamStatus; import safeluck.drive.evaluation.bean.ScoreBean; import safeluck.drive.evaluation.cEventCenter.CEventCenter; import safeluck.drive.evaluation.customview.ArrowView; import safeluck.drive.evaluation.customview.HouseView; /** * 联网训练UI @@ -51,6 +54,10 @@ private ListView mListView ; private Button btn_start_exam; private ScoreAdapter mScoreAdapter; private ArrowView av_zhijiao, av_curve, av_park, av_podao; private HouseView houseView; private List<ExamStatus> examStatusList = new ArrayList<>(); private List<String> item_conents = new ArrayList<>();//坡道定点停车和起步 private int item_id;//扣分分数总和 @@ -72,21 +79,89 @@ public void onChanged(List<FailedProj_select> failedProj_selects) { item_id = 0; mArrayList.clear(); item_conents.clear(); for (FailedProj_select f : failedProj_selects) { item_id += f.getScore_deducting(); Log.i(TAG, "onChanged: "+f.toString()); mArrayList.add(new ScoreBean(f.getScore_deducting(),f.getItem_content(),f.getDeducting_reason())); item_conents.add(f.getItem_content()); mScoreAdapter.addDatas(mArrayList); } } }); item_conents.add("侧方停车"); return view; } private int whatPaintColor(ExamStatus examStatus) { int map_id = examStatus.getMap_id(); int status = examStatus.getEnter(); switch (status) { case 0://考试完成 switch (map_id) { case 1://倒库 if (item_conents.contains("倒车入库")) { return getResources().getColor(R.color.colorAccent); }else{ return getResources().getColor(R.color.train_btn_return); } case 2: if (item_conents.contains("坡道定点停车和起步")) { return getResources().getColor(R.color.colorAccent); }else{ return getResources().getColor(R.color.train_btn_return); } case 3: if (item_conents.contains("侧方停车")) { return getResources().getColor(R.color.colorAccent); }else{ return getResources().getColor(R.color.train_btn_return); } case 4: if (item_conents.contains("曲线行驶")) { return getResources().getColor(R.color.colorAccent); }else{ return getResources().getColor(R.color.train_btn_return); } case 5: if (item_conents.contains("直角转弯")) { return getResources().getColor(R.color.colorAccent); }else{ return getResources().getColor(R.color.train_btn_return); } } case 1://进入考场项目 return getResources().getColor(R.color.pink); case 2://待考 return getResources().getColor(R.color.examing); } return getResources().getColor(R.color.examing); } private void initView(View view) { av_curve = view.findViewById(R.id.av2); av_park = view.findViewById(R.id.av3); av_podao = view.findViewById(R.id.av4); av_zhijiao = view.findViewById(R.id.av1); houseView = view.findViewById(R.id.hv); //粉红色正在进行该项目的考试 examStatusList.add(new ExamStatus(1, 2)); examStatusList.add(new ExamStatus(2, 1)); examStatusList.add(new ExamStatus(3, 0)); examStatusList.add(new ExamStatus(4, 2)); examStatusList.add(new ExamStatus(5, 1)); av_curve.setColor(whatPaintColor(examStatusList.get(3))); av_zhijiao.setColor(whatPaintColor(examStatusList.get(4))); av_podao.setColor(whatPaintColor(examStatusList.get(1))); av_park.setColor(whatPaintColor(examStatusList.get(2))); houseView.setColor(whatPaintColor(examStatusList.get(0))); sendRTKConfig2RemoteService(); mListView = view.findViewById(R.id.lv); mListView.setFocusable(false); @@ -99,10 +174,12 @@ mListView.addHeaderView(LayoutInflater.from(_mActivity).inflate(R.layout.layout_score_item,null)); } private void sendRTKConfig2RemoteService() { // MyLog.d(TAG,"主动推送RTKConfig"); // CEventCenter.dispatchEvent(Constant.BIND_RTKCONFIG_TOPIC,Constant.FETCH_RTK_PLATFORM_INFO,0,""); } @Override public void onClick(View v) { switch (v.getId()){ app/src/main/res/values/attrs.xml
@@ -8,10 +8,10 @@ </declare-styleable> <declare-styleable name="ArrowView"> <attr name="text" format="string" /> <attr name="color" format="color" /> </declare-styleable> <declare-styleable name="HouseView"> <attr name="item" format="string" /> </declare-styleable> </resources> app/src/main/res/values/colors.xml
@@ -11,4 +11,7 @@ <color name="train_bg">#4aabb2</color> <color name="train_btn_return">#16aa3c</color> <color name="profile_bg">#1988a3</color> <color name="pink">#FF3399</color> <color name="examing">#99C3D1</color> <color name="red">#DC143C</color> </resources>