Compare View

switch
from
...
to
 
Commits (2)
.idea/deploymentTargetDropDown.xml
... ... @@ -3,7 +3,20 @@
3 3 <component name="deploymentTargetDropDown">
4 4 <value>
5 5 <entry key="app">
6   - <State />
  6 + <State>
  7 + <runningDeviceTargetSelectedWithDropDown>
  8 + <Target>
  9 + <type value="RUNNING_DEVICE_TARGET" />
  10 + <deviceKey>
  11 + <Key>
  12 + <type value="SERIAL_NUMBER" />
  13 + <value value="951f9ace" />
  14 + </Key>
  15 + </deviceKey>
  16 + </Target>
  17 + </runningDeviceTargetSelectedWithDropDown>
  18 + <timeTargetWasSelectedWithDropDown value="2025-03-20T09:48:34.278363400Z" />
  19 + </State>
7 20 </entry>
8 21 </value>
9 22 </component>
... ...
app/src/main/java/com/hjx/parent/HomeworkShareActivity.java
... ... @@ -12,6 +12,7 @@ import android.widget.LinearLayout;
12 12 import android.widget.TextView;
13 13  
14 14 import androidx.annotation.NonNull;
  15 +import androidx.annotation.Nullable;
15 16  
16 17 import com.bumptech.glide.Glide;
17 18 import com.chad.library.adapter.base.BaseQuickAdapter;
... ... @@ -114,18 +115,22 @@ public class HomeworkShareActivity extends BaseRxActivity&lt;ActivityHomeworkShareB
114 115  
115 116 String temp = indent + "在本次作业中,答对题目有 %s 道,%s掌握的很好;答错题目有 %s 道,错题涵盖的知识点主要有%s,这部分还要再加强学习。错题老师已经帮你收录到错题本中,要记得复习整理错题,及时消灭薄弱知识点。";
116 117 List<HomeWork> errorList = new ArrayList<>();
  118 + List<HomeWork> blankList = new ArrayList<>();
117 119 if (detail.getHomeworkList() != null && detail.getHomeworkList().size() != 0) {
118 120 int total = detail.getHomeworkList().size();
119   - int correctNum = 0;
  121 + int correctNum = 0, blankNumber = 0;
120 122 Set<KeyValue> correctSet = new HashSet<>();
121 123 Set<KeyValue> errorSet = new HashSet<>();
122 124 for (HomeWork homeWork: detail.getHomeworkList()) {
123 125 if (homeWork.correction == 0) {
124 126 correctNum ++;
125 127 correctSet.addAll(homeWork.pointsObj);
126   - } else {
  128 + } else if (homeWork.correction == 1){
127 129 errorList.add(homeWork);
128 130 errorSet.addAll(homeWork.pointsObj);
  131 + } else if (homeWork.correction == 2) {
  132 + blankList.add(homeWork);
  133 + blankNumber ++;
129 134 }
130 135 }
131 136 StringBuilder correctPoint = new StringBuilder();
... ... @@ -136,11 +141,12 @@ public class HomeworkShareActivity extends BaseRxActivity&lt;ActivityHomeworkShareB
136 141 for (KeyValue point: errorSet) {
137 142 errorPoint.append("、").append(point.Value);
138 143 }
139   - float rate = 100f * correctNum / total;
  144 + float rate = 100f * correctNum / Math.max(total - blankNumber, 1);
140 145 int errorNum = total - correctNum;
141 146 binding.tvPercent.setText(new DecimalFormat("0").format(rate));
142 147 binding.tvCorrect.setText(String.valueOf(correctNum));
143 148 binding.tvWrong.setText(String.valueOf(errorNum));
  149 + binding.tvBlank.setText(String.valueOf(blankNumber));
144 150  
145 151 String correct = "-", error = "-";
146 152 if (correctPoint.length() != 0) correct = correctPoint.substring(1);
... ... @@ -164,6 +170,8 @@ public class HomeworkShareActivity extends BaseRxActivity&lt;ActivityHomeworkShareB
164 170 }
165 171  
166 172 mAdapter.setNewData(errorList);
  173 + binding.rvBlank.setAdapter(new BlankAdapter(blankList));
  174 + binding.viewBlank.setVisibility(blankList.isEmpty() ? View.GONE : View.VISIBLE);
167 175 }
168 176  
169 177 private String fromColor(String str, String color) {
... ... @@ -196,6 +204,19 @@ public class HomeworkShareActivity extends BaseRxActivity&lt;ActivityHomeworkShareB
196 204 return s;
197 205 }
198 206  
  207 + public static class BlankAdapter extends BaseQuickAdapter<HomeWork, BaseViewHolder> {
  208 +
  209 + public BlankAdapter(@Nullable List<HomeWork> data) {
  210 + super(R.layout.item_huyou_daily_blank, data);
  211 + }
  212 +
  213 + @Override
  214 + protected void convert(@NonNull BaseViewHolder holder, HomeWork homeWork) {
  215 + ImageView imageView = holder.getView(R.id.imageView);
  216 + Glide.with(mContext).load(homeWork.url).into(imageView);
  217 + }
  218 + }
  219 +
199 220 public static class ErrorAdapter extends BaseQuickAdapter<HomeWork, BaseViewHolder> {
200 221  
201 222 public ErrorAdapter() {
... ...
app/src/main/java/com/hjx/parent/HuyouDetailActivity.java
... ... @@ -199,14 +199,19 @@ public class HuyouDetailActivity extends BaseRxActivity&lt;ActivityHuyouDetailBindi
199 199 binding.tvRating.setText("");
200 200 } else {
201 201 String rateComment;
  202 + String encComment;
202 203 if (rate >= 90) {
203 204 rateComment = "知识点掌握得比较优秀,多练习多巩固掌握一般的知识点会有很大帮助。";
  205 + encComment = "在未来的学习中,请保持这份优秀,继续挑战更难的题目,勇攀高峰";
204 206 } else if (rate >= 80) {
205 207 rateComment = "知识点掌握程度有进步,还要再继续学习,多练习,不断巩固。";
  208 + encComment = "在未来的学习中,请保持这份优秀,继续挑战更难的题目,勇攀高峰";
206 209 } else if (rate >= 60) {
207 210 rateComment = "薄弱知识点还有进步空间,再多做一些类似题目来巩固知识点,继续努力。";
  211 + encComment = "在未来的学习中,请不要灰心,继续努力";
208 212 } else {
209 213 rateComment = "你的薄弱知识点还需要再深入了解,有不清楚的地方及时问老师,继续加油。";
  214 + encComment = "在未来的学习中,请不要灰心,继续努力";
210 215 }
211 216  
212 217 String correctNumHt = fromColor(String.valueOf(data.correct), "#3BC3B6");
... ... @@ -224,9 +229,9 @@ public class HuyouDetailActivity extends BaseRxActivity&lt;ActivityHuyouDetailBindi
224 229 String rateStr = new DecimalFormat("0%").format(rate / 100f);
225 230 String temp;
226 231 if (type == 0) {
227   - temp = indent + "在本周作业中,你的综合正确率是 %s," + rateComment + pointComment + "在未来的学习中,请保持这份优秀,继续挑战更难的题目,勇攀高峰。";
  232 + temp = indent + "在本周作业中,你的综合正确率是 %s," + pointComment + rateComment + encComment;
228 233 } else {
229   - temp = indent + "你的综合正确率是 %s," + rateComment;
  234 + temp = indent + "在本阶段作业中,你的综合正确率是 %s," + pointComment + rateComment + encComment;
230 235 }
231 236 temp = String.format(temp, fromColor(rateStr, "#3BC3B6"));
232 237 binding.tvRating.setText(Html.fromHtml(temp, Html.FROM_HTML_MODE_COMPACT));
... ...
app/src/main/res/layout/activity_homework_select.xml
... ... @@ -18,7 +18,7 @@
18 18 android:layout_width="match_parent"
19 19 android:layout_height="40dp">
20 20 <TextView
21   - android:text="第一步:选择错题"
  21 + android:text="第一步:选择完成情况"
22 22 android:textSize="18sp"
23 23 android:textColor="#333"
24 24 android:textStyle="bold"
... ...
app/src/main/res/layout/activity_homework_share.xml
... ... @@ -7,7 +7,7 @@
7 7 android:background="#489AFA"
8 8 android:layout_width="match_parent"
9 9 android:layout_height="match_parent"
10   - tools:ignore="HardcodedText,ContentDescription">
  10 + tools:ignore="HardcodedText,ContentDescription,SmallSp">
11 11  
12 12 <androidx.core.widget.NestedScrollView
13 13 android:layout_width="match_parent"
... ... @@ -31,6 +31,7 @@
31 31 android:tint="@color/white"
32 32 android:src="@drawable/svg_arrow_head_start_black"
33 33 android:paddingEnd="16dp"
  34 + android:paddingStart="0px"
34 35 android:layout_width="wrap_content"
35 36 android:layout_height="wrap_content"/>
36 37  
... ... @@ -112,6 +113,7 @@
112 113 android:layout_weight="1">
113 114 <LinearLayout
114 115 android:paddingEnd="20dp"
  116 + android:paddingStart="0px"
115 117 android:gravity="center_vertical"
116 118 android:layout_width="wrap_content"
117 119 android:layout_height="wrap_content">
... ... @@ -146,6 +148,7 @@
146 148 android:layout_weight="1">
147 149 <LinearLayout
148 150 android:paddingEnd="20dp"
  151 + android:paddingStart="0px"
149 152 android:gravity="center_vertical"
150 153 android:layout_width="wrap_content"
151 154 android:layout_height="wrap_content">
... ... @@ -180,6 +183,7 @@
180 183 android:layout_weight="1">
181 184 <LinearLayout
182 185 android:paddingEnd="20dp"
  186 + android:paddingStart="0px"
183 187 android:gravity="center_vertical"
184 188 android:layout_width="wrap_content"
185 189 android:layout_height="wrap_content">
... ... @@ -377,6 +381,52 @@
377 381 android:layout_height="wrap_content"/>
378 382 </LinearLayout>
379 383 </LinearLayout>
  384 + <LinearLayout
  385 + android:orientation="vertical"
  386 + android:gravity="center"
  387 + android:layout_width="0dp"
  388 + android:layout_height="match_parent"
  389 + android:layout_weight="1">
  390 + <LinearLayout
  391 + android:orientation="horizontal"
  392 + android:gravity="center_vertical"
  393 + android:layout_width="wrap_content"
  394 + android:layout_height="wrap_content">
  395 + <ImageView
  396 + android:src="@drawable/png_icon_statistical_accuracy"
  397 + android:layout_width="12dp"
  398 + android:layout_height="13dp"/>
  399 + <TextView
  400 + android:text="未做题数"
  401 + android:textSize="11sp"
  402 + android:textColor="#333"
  403 + android:textStyle="bold"
  404 + android:layout_marginStart="5dp"
  405 + android:layout_width="wrap_content"
  406 + android:layout_height="wrap_content"/>
  407 + </LinearLayout>
  408 + <LinearLayout
  409 + android:orientation="horizontal"
  410 + android:layout_marginTop="8dp"
  411 + android:layout_width="wrap_content"
  412 + android:layout_height="wrap_content">
  413 + <TextView
  414 + android:id="@+id/tvBlank"
  415 + tools:text="88"
  416 + android:textSize="14sp"
  417 + android:textColor="#489AFA"
  418 + android:textStyle="bold"
  419 + android:layout_width="wrap_content"
  420 + android:layout_height="wrap_content"/>
  421 + <TextView
  422 + android:text="道"
  423 + android:textSize="9sp"
  424 + android:textColor="#489AFA"
  425 + android:textStyle="bold"
  426 + android:layout_width="wrap_content"
  427 + android:layout_height="wrap_content" />
  428 + </LinearLayout>
  429 + </LinearLayout>
380 430 </LinearLayout>
381 431 <TextView
382 432 android:id="@+id/tvRating"
... ... @@ -426,6 +476,39 @@
426 476 </LinearLayout>
427 477  
428 478 <LinearLayout
  479 + android:id="@+id/viewBlank"
  480 + android:orientation="vertical"
  481 + android:background="@drawable/shape_radius_10"
  482 + android:backgroundTint="@color/white"
  483 + android:paddingHorizontal="16dp"
  484 + android:paddingBottom="16dp"
  485 + android:layout_marginTop="12dp"
  486 + android:layout_width="match_parent"
  487 + android:layout_height="wrap_content">
  488 + <TextView
  489 + android:text="未做题目"
  490 + android:textSize="16sp"
  491 + android:textStyle="bold"
  492 + android:textColor="#333"
  493 + android:paddingStart="24dp"
  494 + android:paddingEnd="4dp"
  495 + android:paddingTop="4dp"
  496 + android:background="@drawable/bg_homework_error"
  497 + android:layout_gravity="center_horizontal"
  498 + android:layout_marginTop="12dp"
  499 + android:layout_width="wrap_content"
  500 + android:layout_height="wrap_content"/>
  501 +
  502 + <androidx.recyclerview.widget.RecyclerView
  503 + android:id="@+id/rvBlank"
  504 + android:orientation="vertical"
  505 + app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
  506 + android:layout_marginTop="12dp"
  507 + android:layout_width="match_parent"
  508 + android:layout_height="wrap_content"/>
  509 + </LinearLayout>
  510 +
  511 + <LinearLayout
429 512 android:id="@+id/flComment"
430 513 android:orientation="vertical"
431 514 android:background="@drawable/shape_radius_10"
... ...
app/src/main/res/layout/item_huyou_daily_blank.xml
... ... @@ -0,0 +1,18 @@
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3 + xmlns:app="http://schemas.android.com/apk/res-auto"
  4 + xmlns:tools="http://schemas.android.com/tools"
  5 + android:orientation="vertical"
  6 + android:background="@drawable/bg_feedback_blank"
  7 + android:layout_width="match_parent"
  8 + android:layout_height="wrap_content"
  9 + tools:ignore="UseCompoundDrawables,HardcodedText,SmallSp,ContentDescription">
  10 +
  11 + <ImageView
  12 + android:id="@+id/imageView"
  13 + android:adjustViewBounds="true"
  14 + android:layout_margin="10dp"
  15 + android:layout_width="match_parent"
  16 + android:layout_height="wrap_content"/>
  17 +
  18 +</LinearLayout>
0 19 \ No newline at end of file
... ...