app/src/main/java/safeluck/drive/evaluation/Constant.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
app/src/main/java/safeluck/drive/evaluation/fragment/NetWorkTrainFragment.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
app/src/main/java/safeluck/drive/evaluation/fragment/TrainFragment.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
app/src/main/res/layout/profile_layout.xml | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
app/src/main/res/values/strings.xml | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
app/src/main/java/safeluck/drive/evaluation/Constant.java
@@ -66,5 +66,6 @@ public static final int REAL_TIME_CAR_POS = 0x000E; public static final String REAL_TIME_POS_CAR_TOPIC = "real_time_car_pos_topic"; public static final String BIND_SPEED_TOPIC = "BIND_SPEED_TOPIC"; public static final int PASSING_SCORE = 80; public static String exam_enter_exitdata="exam_enter_exitdata"; } app/src/main/java/safeluck/drive/evaluation/fragment/NetWorkTrainFragment.java
@@ -68,9 +68,10 @@ private int item_id;//扣分分数总和 private ExamStatusViewModel examStatusViewModel; private static final int ADD_DATA = 1; private TextView tv_speed; private TextView tv_speed,tv_total_score; private double speed=0.0; private int currTotalScore = 100; private List<ScoreBean> mArrayList = new ArrayList<>(); private static final int SPEED_DATA = 2; @@ -82,6 +83,7 @@ @Override public boolean handleMessage(Message msg) { if (msg.what == ADD_DATA){ tv_total_score.setText(getResources().getString(R.string.total_score,currTotalScore)); houseView.setColor(whatPaintColor(examStatusList.get(0))); av_podao.setColor(whatPaintColor(examStatusList.get(1))); av_park.setColor(whatPaintColor(examStatusList.get(2))); @@ -118,7 +120,10 @@ item_conents.add(f.getItem_content()); mScoreAdapter.addDatas(mArrayList); } currTotalScore -=item_id; if (currTotalScore < Constant.PASSING_SCORE){ MyLog.i(TAG,"低于80,不合格"); } MyLog.i(TAG,"监测到有失败项目加入,通知UI更新颜色"); mHandler.obtainMessage(ADD_DATA).sendToTarget(); } @@ -212,6 +217,7 @@ houseView = view.findViewById(R.id.hv); tv_speed = view.findViewById(R.id.tv_speed); tv_total_score = view.findViewById(R.id.tv_total_score); tv_speed.setText(getResources().getString(R.string.speed,speed)); view.findViewById(R.id.btn_return).setOnClickListener(this); app/src/main/java/safeluck/drive/evaluation/fragment/TrainFragment.java
@@ -73,13 +73,15 @@ private List<ScoreBean> mArrayList = new ArrayList<>(); private View tv_stop; private TextView tv_speed; private TextView tv_speed,tv_total_score; private int currTotalScore = 100; private double speed=0.0; private Handler mHandler = new Handler(new Handler.Callback() { @Override public boolean handleMessage(Message msg) { if (msg.what == ADD_DATA){ tv_total_score.setText(getResources().getString(R.string.total_score,currTotalScore)); houseView.setColor(whatPaintColor(examStatusList.get(0))); av_podao.setColor(whatPaintColor(examStatusList.get(1))); av_park.setColor(whatPaintColor(examStatusList.get(2))); @@ -123,6 +125,10 @@ mArrayList.add(new ScoreBean(f.getScore_deducting(), f.getItem_content(), f.getDeducting_reason())); item_conents.add(f.getItem_content()); mScoreAdapter.addDatas(mArrayList); } currTotalScore -=item_id; if (currTotalScore < Constant.PASSING_SCORE){ MyLog.i(TAG,"低于80,不合格"); } MyLog.i(TAG,"监测到有失败项目加入,通知UI更新颜色"); @@ -170,6 +176,7 @@ houseView = view.findViewById(R.id.hv); tv_speed = view.findViewById(R.id.tv_speed); tv_total_score = view.findViewById(R.id.tv_total_score); tv_speed.setText(getResources().getString(R.string.speed,speed)); view.findViewById(R.id.btn_return).setOnClickListener(this); mListView = view.findViewById(R.id.lv); app/src/main/res/layout/profile_layout.xml
@@ -146,7 +146,8 @@ android:textColor="@android:color/white" android:background="@android:color/holo_green_dark" android:padding="5dp" android:text="100" /> android:id="@+id/tv_total_score" android:text="@string/total_score" /> <TextView android:layout_width="wrap_content" app/src/main/res/values/strings.xml
@@ -26,4 +26,5 @@ <string name="rtk_config_login">RTK登录结果:%1$d</string> <string name="speed">车速:%1$.2fkm/h</string> <string name="licheng">已行驶:451km</string> <string name="total_score">%1$d</string> </resources>