Commit 2d8005994d5896c255ea5fb35afd4f1ee8725128

Authored by shixianjie
1 parent ff207bc53e
Exists in master

查看题目详情

app/src/main/AndroidManifest.xml
1 <?xml version="1.0" encoding="utf-8"?> 1 <?xml version="1.0" encoding="utf-8"?>
2 <manifest xmlns:android="http://schemas.android.com/apk/res/android" 2 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
3 xmlns:tools="http://schemas.android.com/tools" 3 xmlns:tools="http://schemas.android.com/tools"
4 package="com.hjx.parent"> 4 package="com.hjx.parent">
5 5
6 6
7 <uses-permission android:name="android.permission.CHANGE_WIFI_MULTICAST_STATE" /> 7 <uses-permission android:name="android.permission.CHANGE_WIFI_MULTICAST_STATE" />
8 <uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" /> <!-- 允许程序改变网络链接状态 --> 8 <uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" /> <!-- 允许程序改变网络链接状态 -->
9 <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> <!-- 允许程序访问访问WIFI网络状态信息 --> 9 <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> <!-- 允许程序访问访问WIFI网络状态信息 -->
10 <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" /> <!-- 允许程序改变WIFI链接状态 --> 10 <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" /> <!-- 允许程序改变WIFI链接状态 -->
11 <!-- 6.0系统需要添加权限才能获得wifi列表 --> 11 <!-- 6.0系统需要添加权限才能获得wifi列表 -->
12 <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> 12 <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
13 <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> 13 <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
14 <uses-permission android:name="android.permission.INTERNET" /> 14 <uses-permission android:name="android.permission.INTERNET" />
15 <uses-permission android:name="android.permission.RECORD_AUDIO" /> 15 <uses-permission android:name="android.permission.RECORD_AUDIO" />
16 <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> 16 <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
17 17
18 <uses-permission android:name="android.permission.DISABLE_KEYGUARD" /> 18 <uses-permission android:name="android.permission.DISABLE_KEYGUARD" />
19 <uses-permission android:name="android.permission.READ_PHONE_STATE" /> 19 <uses-permission android:name="android.permission.READ_PHONE_STATE" />
20 <uses-permission android:name="android.permission.WAKE_LOCK" /> 20 <uses-permission android:name="android.permission.WAKE_LOCK" />
21 <uses-permission android:name="android.permission.CAMERA" /> 21 <uses-permission android:name="android.permission.CAMERA" />
22 <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /> 22 <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
23 <uses-permission android:name="android.permission.VIBRATE" /> 23 <uses-permission android:name="android.permission.VIBRATE" />
24 <uses-permission 24 <uses-permission
25 android:name="android.permission.WRITE_EXTERNAL_STORAGE" 25 android:name="android.permission.WRITE_EXTERNAL_STORAGE"
26 tools:ignore="ScopedStorage" /> 26 tools:ignore="ScopedStorage" />
27 <uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" /> 27 <uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
28 <uses-permission android:name="android.permission.GET_PACKAGE_SIZE" /> 28 <uses-permission android:name="android.permission.GET_PACKAGE_SIZE" />
29 29
30 <uses-permission 30 <uses-permission
31 android:name="android.permission.MANAGE_EXTERNAL_STORAGE" 31 android:name="android.permission.MANAGE_EXTERNAL_STORAGE"
32 tools:ignore="ScopedStorage" /> 32 tools:ignore="ScopedStorage" />
33 33
34 <application 34 <application
35 android:name=".App" 35 android:name=".App"
36 android:allowBackup="true" 36 android:allowBackup="true"
37 android:icon="@mipmap/icon" 37 android:icon="@mipmap/icon"
38 android:label="@string/app_name" 38 android:label="@string/app_name"
39 android:networkSecurityConfig="@xml/network_security_config" 39 android:networkSecurityConfig="@xml/network_security_config"
40 android:supportsRtl="true" 40 android:supportsRtl="true"
41 android:theme="@style/Theme.AppCompat.Light.NoActionBar"> 41 android:theme="@style/Theme.AppCompat.Light.NoActionBar">
42 <activity 42 <activity
43 android:name=".LoginActivity" 43 android:name=".LoginActivity"
44 android:exported="true" 44 android:exported="true"
45 android:screenOrientation="portrait" 45 android:screenOrientation="portrait"
46 android:theme="@style/ThemeSplash"> 46 android:theme="@style/ThemeSplash">
47 <intent-filter> 47 <intent-filter>
48 <action android:name="android.intent.action.MAIN" /> 48 <action android:name="android.intent.action.MAIN" />
49 <category android:name="android.intent.category.LAUNCHER" /> 49 <category android:name="android.intent.category.LAUNCHER" />
50 </intent-filter> 50 </intent-filter>
51 </activity> 51 </activity>
52 <activity 52 <activity
53 android:name=".MainActivity" 53 android:name=".MainActivity"
54 android:launchMode="singleTask" 54 android:launchMode="singleTask"
55 android:screenOrientation="portrait" 55 android:screenOrientation="portrait"
56 android:theme="@style/Theme.AppCompat.Light.NoActionBar" /> 56 android:theme="@style/Theme.AppCompat.Light.NoActionBar" />
57 <activity 57 <activity
58 android:name=".RegisterActivity" 58 android:name=".RegisterActivity"
59 android:screenOrientation="portrait" 59 android:screenOrientation="portrait"
60 android:theme="@style/ThemeSplash" /> 60 android:theme="@style/ThemeSplash" />
61 <activity 61 <activity
62 android:name=".UserActivity" 62 android:name=".UserActivity"
63 android:screenOrientation="portrait" 63 android:screenOrientation="portrait"
64 android:theme="@style/Theme.AppCompat.Light.NoActionBar" /> 64 android:theme="@style/Theme.AppCompat.Light.NoActionBar" />
65 <activity 65 <activity
66 android:name=".YinsiActivity" 66 android:name=".YinsiActivity"
67 android:screenOrientation="portrait" 67 android:screenOrientation="portrait"
68 android:theme="@style/Theme.AppCompat.Light.NoActionBar" /> 68 android:theme="@style/Theme.AppCompat.Light.NoActionBar" />
69 <activity 69 <activity
70 android:name=".QRActivity" 70 android:name=".QRActivity"
71 android:screenOrientation="portrait" 71 android:screenOrientation="portrait"
72 android:theme="@style/Theme.AppCompat.Light.NoActionBar" /> 72 android:theme="@style/Theme.AppCompat.Light.NoActionBar" />
73 <activity 73 <activity
74 android:name=".AddStudentActivity" 74 android:name=".AddStudentActivity"
75 android:screenOrientation="portrait" 75 android:screenOrientation="portrait"
76 android:theme="@style/Theme.AppCompat.Light.NoActionBar" /> 76 android:theme="@style/Theme.AppCompat.Light.NoActionBar" />
77 <activity 77 <activity
78 android:name=".NickActivity" 78 android:name=".NickActivity"
79 android:screenOrientation="portrait" 79 android:screenOrientation="portrait"
80 android:theme="@style/Theme.AppCompat.Light.NoActionBar" /> 80 android:theme="@style/Theme.AppCompat.Light.NoActionBar" />
81 <activity 81 <activity
82 android:name=".SexActivity" 82 android:name=".SexActivity"
83 android:screenOrientation="portrait" 83 android:screenOrientation="portrait"
84 android:theme="@style/Theme.AppCompat.Light.NoActionBar" /> 84 android:theme="@style/Theme.AppCompat.Light.NoActionBar" />
85 <activity 85 <activity
86 android:name=".NianActivity" 86 android:name=".NianActivity"
87 android:screenOrientation="portrait" 87 android:screenOrientation="portrait"
88 android:theme="@style/Theme.AppCompat.Light.NoActionBar" /> 88 android:theme="@style/Theme.AppCompat.Light.NoActionBar" />
89 <activity 89 <activity
90 android:name=".ShenActivity" 90 android:name=".ShenActivity"
91 android:screenOrientation="portrait" 91 android:screenOrientation="portrait"
92 android:theme="@style/Theme.AppCompat.Light.NoActionBar" /> 92 android:theme="@style/Theme.AppCompat.Light.NoActionBar" />
93 <activity 93 <activity
94 android:name=".UserAgreementActivity" 94 android:name=".UserAgreementActivity"
95 android:screenOrientation="portrait" 95 android:screenOrientation="portrait"
96 android:theme="@style/Theme.AppCompat.Light.NoActionBar" /> 96 android:theme="@style/Theme.AppCompat.Light.NoActionBar" />
97 <activity 97 <activity
98 android:name=".AccountActivity" 98 android:name=".AccountActivity"
99 android:screenOrientation="portrait" 99 android:screenOrientation="portrait"
100 android:theme="@style/Theme.AppCompat.Light.NoActionBar" /> 100 android:theme="@style/Theme.AppCompat.Light.NoActionBar" />
101 101
102 <activity 102 <activity
103 android:name=".ChangePwdActivity" 103 android:name=".ChangePwdActivity"
104 android:screenOrientation="portrait" 104 android:screenOrientation="portrait"
105 android:theme="@style/Theme.AppCompat.Light.NoActionBar" /> 105 android:theme="@style/Theme.AppCompat.Light.NoActionBar" />
106 <activity 106 <activity
107 android:name=".EditStudentActivity" 107 android:name=".EditStudentActivity"
108 android:screenOrientation="portrait" 108 android:screenOrientation="portrait"
109 android:theme="@style/Theme.AppCompat.Light.NoActionBar" /> 109 android:theme="@style/Theme.AppCompat.Light.NoActionBar" />
110 <activity 110 <activity
111 android:name=".ChooseActivity" 111 android:name=".ChooseActivity"
112 android:screenOrientation="portrait" 112 android:screenOrientation="portrait"
113 android:theme="@style/Theme.AppCompat.Light.NoActionBar" /> 113 android:theme="@style/Theme.AppCompat.Light.NoActionBar" />
114 <activity 114 <activity
115 android:name=".AddTeacherActivity" 115 android:name=".AddTeacherActivity"
116 android:screenOrientation="portrait" 116 android:screenOrientation="portrait"
117 android:theme="@style/Theme.AppCompat.Light.NoActionBar" /> 117 android:theme="@style/Theme.AppCompat.Light.NoActionBar" />
118 <activity 118 <activity
119 android:name=".ErrorBookActivity" 119 android:name=".ErrorBookActivity"
120 android:screenOrientation="portrait" 120 android:screenOrientation="portrait"
121 android:theme="@style/Theme.AppCompat.Light.NoActionBar" /> 121 android:theme="@style/Theme.AppCompat.Light.NoActionBar" />
122 <activity 122 <activity
123 android:name=".ImageActivity" 123 android:name=".ImageActivity"
124 android:screenOrientation="portrait" 124 android:screenOrientation="portrait"
125 android:theme="@style/Theme.AppCompat.Light.NoActionBar" /> 125 android:theme="@style/Theme.AppCompat.Light.NoActionBar" />
126 <activity 126 <activity
127 android:name=".ImageEditActivity" 127 android:name=".ImageEditActivity"
128 android:screenOrientation="portrait" 128 android:screenOrientation="portrait"
129 android:theme="@style/Theme.AppCompat.Light.NoActionBar" /> 129 android:theme="@style/Theme.AppCompat.Light.NoActionBar" />
130 <activity 130 <activity
131 android:name=".ImageSelectActivity" 131 android:name=".ImageSelectActivity"
132 android:screenOrientation="portrait" 132 android:screenOrientation="portrait"
133 android:theme="@style/Theme.AppCompat.Light.NoActionBar" /> 133 android:theme="@style/Theme.AppCompat.Light.NoActionBar" />
134 <activity 134 <activity
135 android:name=".AddSuccessActivity" 135 android:name=".AddSuccessActivity"
136 android:screenOrientation="portrait" 136 android:screenOrientation="portrait"
137 android:theme="@style/Theme.AppCompat.Light.NoActionBar" /> 137 android:theme="@style/Theme.AppCompat.Light.NoActionBar" />
138 <activity 138 <activity
139 android:name=".ErrorListActivity" 139 android:name=".ErrorListActivity"
140 android:screenOrientation="portrait" 140 android:screenOrientation="portrait"
141 android:theme="@style/Theme.AppCompat.Light.NoActionBar" /> 141 android:theme="@style/Theme.AppCompat.Light.NoActionBar" />
142 <activity 142 <activity
143 android:name=".ErrorDetailActivity" 143 android:name=".ErrorDetailActivity"
144 android:screenOrientation="portrait" 144 android:screenOrientation="portrait"
145 android:theme="@style/Theme.AppCompat.Light.NoActionBar" /> 145 android:theme="@style/Theme.AppCompat.Light.NoActionBar" />
146 <activity 146 <activity
147 android:name=".TeacherChooseActivity" 147 android:name=".TeacherChooseActivity"
148 android:screenOrientation="portrait" 148 android:screenOrientation="portrait"
149 android:theme="@style/Theme.AppCompat.Light.NoActionBar" /> 149 android:theme="@style/Theme.AppCompat.Light.NoActionBar" />
150 <activity 150 <activity
151 android:name=".TeacherMainActivity" 151 android:name=".TeacherMainActivity"
152 android:screenOrientation="portrait" 152 android:screenOrientation="portrait"
153 android:theme="@style/Theme.AppCompat.Light.NoActionBar" /> 153 android:theme="@style/Theme.AppCompat.Light.NoActionBar" />
154 <activity android:name=".StuHomeworkActivity" /> 154 <activity android:name=".StuHomeworkActivity" />
155 <activity android:name=".HomeworkDetailActivity" /> 155 <activity android:name=".HomeworkDetailActivity" />
156 <activity android:name=".HomeworkSelectActivity" /> 156 <activity android:name=".HomeworkSelectActivity" />
157 <activity android:name=".HomeworkFeedbackActivity" /> 157 <activity android:name=".HomeworkFeedbackActivity" />
158 <activity android:name=".HomeworkTopicActivity" />
158 159
159 <provider 160 <provider
160 android:name="androidx.core.content.FileProvider" 161 android:name="androidx.core.content.FileProvider"
161 android:authorities="com.hjx.parent.fileprovider" 162 android:authorities="com.hjx.parent.fileprovider"
162 android:exported="false" 163 android:exported="false"
163 android:grantUriPermissions="true" 164 android:grantUriPermissions="true"
164 tools:replace="android:authorities"> 165 tools:replace="android:authorities">
165 <meta-data 166 <meta-data
166 android:name="android.support.FILE_PROVIDER_PATHS" 167 android:name="android.support.FILE_PROVIDER_PATHS"
167 android:resource="@xml/file_provider_paths" 168 android:resource="@xml/file_provider_paths"
168 tools:replace="android:resource" /> 169 tools:replace="android:resource" />
169 </provider> 170 </provider>
170 </application> 171 </application>
171 172
172 </manifest> 173 </manifest>
app/src/main/java/com/hjx/parent/HomeworkFeedbackActivity.java
1 package com.hjx.parent; 1 package com.hjx.parent;
2 2
3 import android.annotation.SuppressLint; 3 import android.annotation.SuppressLint;
4 import android.content.Intent;
4 import android.os.Bundle; 5 import android.os.Bundle;
5 import android.view.View; 6 import android.view.View;
6 import android.widget.ImageView; 7 import android.widget.ImageView;
7 import android.widget.RadioButton; 8 import android.widget.RadioButton;
8 import android.widget.Toast; 9 import android.widget.Toast;
9 10
10 import androidx.annotation.NonNull; 11 import androidx.annotation.NonNull;
11 import androidx.annotation.Nullable; 12 import androidx.annotation.Nullable;
12 13
13 import com.bumptech.glide.Glide; 14 import com.bumptech.glide.Glide;
14 import com.chad.library.adapter.base.BaseQuickAdapter; 15 import com.chad.library.adapter.base.BaseQuickAdapter;
15 import com.chad.library.adapter.base.BaseViewHolder; 16 import com.chad.library.adapter.base.BaseViewHolder;
16 import com.google.android.flexbox.FlexboxLayoutManager; 17 import com.google.android.flexbox.FlexboxLayoutManager;
17 import com.google.gson.Gson; 18 import com.google.gson.Gson;
18 import com.hjx.parent.databinding.ActivityHomeworkFeedbackBinding; 19 import com.hjx.parent.databinding.ActivityHomeworkFeedbackBinding;
19 import com.hjx.parent.rx.BaseRxActivity; 20 import com.hjx.parent.rx.BaseRxActivity;
20 import com.prws.common.bean.Student; 21 import com.prws.common.bean.Student;
21 import com.prws.common.bean.homework.Correction; 22 import com.prws.common.bean.homework.Correction;
22 import com.prws.common.bean.homework.CorrectionPoint; 23 import com.prws.common.bean.homework.CorrectionPoint;
23 import com.prws.common.bean.homework.HomeWork; 24 import com.prws.common.bean.homework.HomeWork;
24 import com.prws.common.bean.homework.HomeworkList; 25 import com.prws.common.bean.homework.HomeworkList;
25 import com.prws.common.bean.homework.KeyValue; 26 import com.prws.common.bean.homework.KeyValue;
26 import com.prws.common.net.NetWorks; 27 import com.prws.common.net.NetWorks;
27 28
28 import java.text.DecimalFormat; 29 import java.text.DecimalFormat;
29 import java.util.ArrayList; 30 import java.util.ArrayList;
30 import java.util.HashMap; 31 import java.util.HashMap;
31 import java.util.HashSet; 32 import java.util.HashSet;
32 import java.util.List; 33 import java.util.List;
33 import java.util.Map; 34 import java.util.Map;
34 import java.util.Set; 35 import java.util.Set;
35 36
36 public class HomeworkFeedbackActivity extends BaseRxActivity<ActivityHomeworkFeedbackBinding> { 37 public class HomeworkFeedbackActivity extends BaseRxActivity<ActivityHomeworkFeedbackBinding> {
37 private Student student; 38 private Student student;
38 private HomeworkList mData; 39 private HomeworkList mData;
39 private ArrayList<HomeWork> mList; 40 private ArrayList<HomeWork> mList;
40 private List<Correction> corrections = new ArrayList<>(); 41 private List<Correction> corrections = new ArrayList<>();
41 42
42 @SuppressWarnings("unchecked") 43 @SuppressWarnings("unchecked")
43 @Override 44 @Override
44 public void initView(Bundle savedInstanceState) { 45 public void initView(Bundle savedInstanceState) {
45 binding.toolbar.setNavigationOnClickListener(v -> onBackPressed()); 46 binding.toolbar.setNavigationOnClickListener(v -> onBackPressed());
46 student = (Student) getIntent().getSerializableExtra("student"); 47 student = (Student) getIntent().getSerializableExtra("student");
47 mData = (HomeworkList) getIntent().getSerializableExtra("data"); 48 mData = (HomeworkList) getIntent().getSerializableExtra("data");
48 mList = (ArrayList<HomeWork>) getIntent().getSerializableExtra("list"); 49 mList = (ArrayList<HomeWork>) getIntent().getSerializableExtra("list");
49 50
50 binding.tvStuName.setText(student.stuName); 51 binding.tvStuName.setText(student.stuName);
51 binding.tvGrade.setText(student.grade); 52 binding.tvGrade.setText(student.grade);
52 53
53 List<HomeWork> errorList = new ArrayList<>(); 54 List<HomeWork> errorList = new ArrayList<>();
54 int correctNo = 0; 55 int correctNo = 0;
55 for (HomeWork homeWork: mList) { 56 for (HomeWork homeWork: mList) {
56 homeWork.state = 1; 57 homeWork.state = 1;
57 homeWork.index = mList.indexOf(homeWork); 58 homeWork.index = mList.indexOf(homeWork);
58 corrections.add(new Correction(homeWork.brief, homeWork.check ? 1 : 0)); 59 corrections.add(new Correction(homeWork.brief, homeWork.check ? 1 : 0));
59 if (!homeWork.check) correctNo ++; 60 if (!homeWork.check) correctNo ++;
60 else errorList.add(homeWork); 61 else errorList.add(homeWork);
61 } 62 }
62 binding.tvPercent.setText(new DecimalFormat("0%").format(1f * correctNo / mList.size())); 63 binding.tvPercent.setText(new DecimalFormat("0%").format(1f * correctNo / mList.size()));
63 64
64 binding.rvCorrect.setLayoutManager(new FlexboxLayoutManager(this)); 65 binding.rvCorrect.setLayoutManager(new FlexboxLayoutManager(this));
65 binding.rvCorrect.setAdapter(new NumberAdapter(mList)); 66 NumberAdapter numberAdapter = new NumberAdapter(mList);
67 binding.rvCorrect.setAdapter(numberAdapter);
66 binding.rvError.setVisibility(errorList.isEmpty() ? View.GONE : View.VISIBLE); 68 binding.rvError.setVisibility(errorList.isEmpty() ? View.GONE : View.VISIBLE);
67 binding.rvError.setAdapter(new EvalAdapter(errorList)); 69 binding.rvError.setAdapter(new EvalAdapter(errorList));
68 70
71 binding.btnDetail.setOnClickListener(v -> {
72 viewTopicDetail(0);
73 });
74 numberAdapter.setOnItemClickListener((baseQuickAdapter, view, i) -> {
75 viewTopicDetail(i);
76 });
69 binding.btnPublish.setOnClickListener(v -> submit()); 77 binding.btnPublish.setOnClickListener(v -> submit());
70 } 78 }
71 79
80 private void viewTopicDetail(int position) {
81 Intent intent = new Intent(this, HomeworkTopicActivity.class);
82 intent.putExtra("list", mList);
83 intent.putExtra("position", position);
84 startActivity(intent);
85 }
86
72 @SuppressLint("CheckResult") 87 @SuppressLint("CheckResult")
73 private void submit() { 88 private void submit() {
74 Map<String, Object> body = new HashMap<>(); 89 Map<String, Object> body = new HashMap<>();
75 body.put("homeworkId", mData.getId()); 90 body.put("homeworkId", mData.getId());
76 body.put("comment", binding.etComment.getText().toString()); 91 body.put("comment", binding.etComment.getText().toString());
77 body.put("stuId", student.stuId); 92 body.put("stuId", student.stuId);
78 body.put("points", countPoint()); 93 body.put("points", countPoint());
79 body.put("correctionList", corrections); 94 body.put("correctionList", corrections);
80 NetWorks.service_url.uploadHomeworkFeedback(NetWorks.getHeader(), body) 95 NetWorks.service_url.uploadHomeworkFeedback(NetWorks.getHeader(), body)
81 .compose(transformSingle()) 96 .compose(transformSingle())
82 .subscribe((response, th) -> { 97 .subscribe((response, th) -> {
83 if (th != null) th.printStackTrace(); 98 if (th != null) th.printStackTrace();
84 if (response != null && response.getSuccess()) { 99 if (response != null && response.getSuccess()) {
85 // TODO 100 // TODO
86 Toast.makeText(this, "反馈成功", Toast.LENGTH_SHORT).show(); 101 Toast.makeText(this, "反馈成功", Toast.LENGTH_SHORT).show();
87 } 102 }
88 }); 103 });
89 } 104 }
90 105
91 @SuppressLint("CheckResult") 106 @SuppressLint("CheckResult")
92 private List<CorrectionPoint> countPoint() { 107 private List<CorrectionPoint> countPoint() {
93 Set<KeyValue> set = new HashSet<>(); 108 Set<KeyValue> set = new HashSet<>();
94 Map<String, Integer> totalTimes = new HashMap<>(); 109 Map<String, Integer> totalTimes = new HashMap<>();
95 Map<String, Integer> correctTimes = new HashMap<>(); 110 Map<String, Integer> correctTimes = new HashMap<>();
96 Map<String, Integer> underTimes = new HashMap<>(); 111 Map<String, Integer> underTimes = new HashMap<>();
97 Map<String, Integer> baseTimes = new HashMap<>(); 112 Map<String, Integer> baseTimes = new HashMap<>();
98 Map<String, Integer> normalTimes = new HashMap<>(); 113 Map<String, Integer> normalTimes = new HashMap<>();
99 Gson gson = new Gson(); 114 Gson gson = new Gson();
100 for (HomeWork homeWork: mList) { 115 for (HomeWork homeWork: mList) {
101 homeWork.formatPoints(gson); 116 homeWork.formatPoints(gson);
102 117
103 set.addAll(homeWork.pointsObj); 118 set.addAll(homeWork.pointsObj);
104 for (KeyValue keyValue: homeWork.pointsObj) { 119 for (KeyValue keyValue: homeWork.pointsObj) {
105 String key = keyValue.Key; 120 String key = keyValue.Key;
106 if (totalTimes.containsKey(key)) { 121 if (totalTimes.containsKey(key)) {
107 totalTimes.put(key, totalTimes.get(key) + 1); 122 totalTimes.put(key, totalTimes.get(key) + 1);
108 } else { 123 } else {
109 totalTimes.put(key, 1); 124 totalTimes.put(key, 1);
110 } 125 }
111 if (!homeWork.check) { 126 if (!homeWork.check) {
112 if (correctTimes.containsKey(key)) { 127 if (correctTimes.containsKey(key)) {
113 correctTimes.put(key, correctTimes.get(key) + 1); 128 correctTimes.put(key, correctTimes.get(key) + 1);
114 } else { 129 } else {
115 correctTimes.put(key, 1); 130 correctTimes.put(key, 1);
116 } 131 }
117 } else if (homeWork.state == 1) { 132 } else if (homeWork.state == 1) {
118 if (underTimes.containsKey(key)) { 133 if (underTimes.containsKey(key)) {
119 underTimes.put(key, underTimes.get(key) + 1); 134 underTimes.put(key, underTimes.get(key) + 1);
120 } else { 135 } else {
121 underTimes.put(key, 1); 136 underTimes.put(key, 1);
122 } 137 }
123 } else if (homeWork.state == 2) { 138 } else if (homeWork.state == 2) {
124 if (baseTimes.containsKey(key)) { 139 if (baseTimes.containsKey(key)) {
125 baseTimes.put(key, baseTimes.get(key) + 1); 140 baseTimes.put(key, baseTimes.get(key) + 1);
126 } else { 141 } else {
127 baseTimes.put(key, 1); 142 baseTimes.put(key, 1);
128 } 143 }
129 } else if (homeWork.state == 3) { 144 } else if (homeWork.state == 3) {
130 if (normalTimes.containsKey(key)) { 145 if (normalTimes.containsKey(key)) {
131 normalTimes.put(key, normalTimes.get(key) + 1); 146 normalTimes.put(key, normalTimes.get(key) + 1);
132 } else { 147 } else {
133 normalTimes.put(key, 1); 148 normalTimes.put(key, 1);
134 } 149 }
135 } 150 }
136 } 151 }
137 } 152 }
138 List<CorrectionPoint> points = new ArrayList<>(); 153 List<CorrectionPoint> points = new ArrayList<>();
139 for (KeyValue obj: set) { 154 for (KeyValue obj: set) {
140 CorrectionPoint point = new CorrectionPoint(); 155 CorrectionPoint point = new CorrectionPoint();
141 point.pointId = obj.Key; 156 point.pointId = obj.Key;
142 point.pointName = obj.Value; 157 point.pointName = obj.Value;
143 point.totalCount = ifNull(totalTimes.get(obj.Key), 1); 158 point.totalCount = ifNull(totalTimes.get(obj.Key), 1);
144 point.correctCount = ifNull(correctTimes.get(obj.Key), 0); 159 point.correctCount = ifNull(correctTimes.get(obj.Key), 0);
145 point.understandCount = ifNull(underTimes.get(obj.Key), 0); 160 point.understandCount = ifNull(underTimes.get(obj.Key), 0);
146 point.basicCount = ifNull(baseTimes.get(obj.Key), 0); 161 point.basicCount = ifNull(baseTimes.get(obj.Key), 0);
147 point.normalCount = ifNull(normalTimes.get(obj.Key), 0); 162 point.normalCount = ifNull(normalTimes.get(obj.Key), 0);
148 163
149 points.add(point); 164 points.add(point);
150 } 165 }
151 166
152 return points; 167 return points;
153 } 168 }
154 169
155 private int ifNull(Integer src, int defaultVal) { 170 private int ifNull(Integer src, int defaultVal) {
156 if (src == null) return defaultVal; 171 if (src == null) return defaultVal;
157 else return src; 172 else return src;
158 } 173 }
159 174
160 175
161 @Override 176 @Override
162 protected ActivityHomeworkFeedbackBinding getViewBinding() { 177 protected ActivityHomeworkFeedbackBinding getViewBinding() {
163 return ActivityHomeworkFeedbackBinding.inflate(getLayoutInflater()); 178 return ActivityHomeworkFeedbackBinding.inflate(getLayoutInflater());
164 } 179 }
165 180
166 static class NumberAdapter extends BaseQuickAdapter<HomeWork, BaseViewHolder> { 181 static class NumberAdapter extends BaseQuickAdapter<HomeWork, BaseViewHolder> {
167 182
168 public NumberAdapter(List<HomeWork> list) { 183 public NumberAdapter(List<HomeWork> list) {
169 super(R.layout.item_feedback_num, list); 184 super(R.layout.item_feedback_num, list);
170 } 185 }
171 186
172 @Override 187 @Override
173 protected void convert(@NonNull BaseViewHolder holder, HomeWork homeWork) { 188 protected void convert(@NonNull BaseViewHolder holder, HomeWork homeWork) {
174 int position = getData().indexOf(homeWork); 189 int position = getData().indexOf(homeWork);
175 holder.setText(R.id.tvNum, String.valueOf(position + 1)); 190 holder.setText(R.id.tvNum, String.valueOf(position + 1));
176 if (homeWork.check) { 191 if (homeWork.check) {
177 holder.setImageResource(R.id.ivType, R.drawable.ic_wrong_small); 192 holder.setImageResource(R.id.ivType, R.drawable.ic_wrong_small);
178 } else { 193 } else {
179 holder.setImageResource(R.id.ivType, R.drawable.ic_correct_small); 194 holder.setImageResource(R.id.ivType, R.drawable.ic_correct_small);
180 } 195 }
181 } 196 }
182 } 197 }
183 198
184 static class EvalAdapter extends BaseQuickAdapter<HomeWork, BaseViewHolder> { 199 static class EvalAdapter extends BaseQuickAdapter<HomeWork, BaseViewHolder> {
185 200
186 public EvalAdapter(@Nullable List<HomeWork> data) { 201 public EvalAdapter(@Nullable List<HomeWork> data) {
187 super(R.layout.item_homework_eval, data); 202 super(R.layout.item_homework_eval, data);
188 } 203 }
189 204
190 @Override 205 @Override
191 protected void convert(@NonNull BaseViewHolder holder, HomeWork homeWork) { 206 protected void convert(@NonNull BaseViewHolder holder, HomeWork homeWork) {
192 holder.itemView.setClipToOutline(true); 207 holder.itemView.setClipToOutline(true);
193 holder.setText(R.id.tvNo, "题目" + (homeWork.index + 1)); 208 holder.setText(R.id.tvNo, "题目" + (homeWork.index + 1));
194 ImageView iv = holder.getView(R.id.ivTopic); 209 ImageView iv = holder.getView(R.id.ivTopic);
195 Glide.with(mContext).load(homeWork.url).into(iv); 210 Glide.with(mContext).load(homeWork.url).into(iv);
196 211
197 RadioButton chk1 = holder.getView(R.id.chk1); 212 RadioButton chk1 = holder.getView(R.id.chk1);
198 RadioButton chk2 = holder.getView(R.id.chk2); 213 RadioButton chk2 = holder.getView(R.id.chk2);
199 RadioButton chk3 = holder.getView(R.id.chk3); 214 RadioButton chk3 = holder.getView(R.id.chk3);
200 chk1.setOnCheckedChangeListener((v, b) -> { 215 chk1.setOnCheckedChangeListener((v, b) -> {
201 if (b) { 216 if (b) {
202 homeWork.state = 1; 217 homeWork.state = 1;
203 } 218 }
204 }); 219 });
205 chk2.setOnCheckedChangeListener((v, b) -> { 220 chk2.setOnCheckedChangeListener((v, b) -> {
206 if (b) { 221 if (b) {
207 homeWork.state = 2; 222 homeWork.state = 2;
208 } 223 }
209 }); 224 });
210 chk3.setOnCheckedChangeListener((v, b) -> { 225 chk3.setOnCheckedChangeListener((v, b) -> {
211 if (b) { 226 if (b) {
212 homeWork.state = 3; 227 homeWork.state = 3;
213 } 228 }
214 }); 229 });
215 chk1.setChecked(homeWork.state == 1); 230 chk1.setChecked(homeWork.state == 1);
216 chk2.setChecked(homeWork.state == 2); 231 chk2.setChecked(homeWork.state == 2);
217 chk3.setChecked(homeWork.state == 3); 232 chk3.setChecked(homeWork.state == 3);
218 } 233 }
219 } 234 }
220 } 235 }
221 236
app/src/main/java/com/hjx/parent/HomeworkTopicActivity.java
File was created 1 package com.hjx.parent;
2
3 import android.annotation.SuppressLint;
4 import android.content.res.ColorStateList;
5 import android.os.Bundle;
6 import android.widget.TextView;
7
8 import androidx.annotation.NonNull;
9 import androidx.annotation.Nullable;
10
11 import com.bumptech.glide.Glide;
12 import com.chad.library.adapter.base.BaseQuickAdapter;
13 import com.chad.library.adapter.base.BaseViewHolder;
14 import com.google.gson.Gson;
15 import com.hjx.parent.databinding.ActivityTopicDetailBinding;
16 import com.hjx.parent.rx.BaseRxActivity;
17 import com.prws.common.bean.homework.HomeWork;
18 import com.prws.common.bean.homework.KeyValue;
19
20 import java.util.ArrayList;
21 import java.util.List;
22
23 public class HomeworkTopicActivity extends BaseRxActivity<ActivityTopicDetailBinding> {
24 private ArrayList<HomeWork> mList;
25 private int position;
26
27 @SuppressWarnings("unchecked")
28 @Override
29 public void initView(Bundle savedInstanceState) {
30 mList = (ArrayList<HomeWork>) getIntent().getSerializableExtra("list");
31 position = getIntent().getIntExtra("position", 0);
32 binding.toolbar.setNavigationOnClickListener(v -> onBackPressed());
33 NumberAdapter adapter = new NumberAdapter(mList);
34 binding.rvNumber.setAdapter(adapter);
35
36 showTopic(position);
37 }
38
39 @SuppressLint("SetTextI18n")
40 private void showTopic(int position) {
41 if (position < 0 || position >= mList.size()) return;
42 this.position = position;
43 binding.btnPre.setEnabled(position > 0);
44 binding.btnNext.setEnabled(position < mList.size() - 1);
45 binding.tvTitle.setText((position + 1) + "/" + mList.size());
46 binding.tvNo.setText("题目" + (position + 1));
47
48 HomeWork homeWork = mList.get(position);
49 Glide.with(this).load(homeWork.url).into(binding.ivTopic);
50 Glide.with(this).load(homeWork.analyseUrl).into(binding.ivAnalyse);
51 String answer = homeWork.answer == null ? "" : homeWork.answer
52 .replace("<br />", "\n")
53 .replace("${", "")
54 .replace("}$", "");
55 binding.tvAnswer.setText(answer);
56 if (homeWork.pointsObj == null) homeWork.formatPoints(new Gson());
57 StringBuilder pointBuilder = new StringBuilder();
58 for (KeyValue point: homeWork.pointsObj) {
59 pointBuilder.append("\n").append(point.Value);
60 }
61 binding.tvPoint.setText(homeWork.pointsObj.size() == 0 ? "" : pointBuilder.substring(1));
62 }
63
64 @Override
65 protected ActivityTopicDetailBinding getViewBinding() {
66 return ActivityTopicDetailBinding.inflate(getLayoutInflater());
67 }
68
69 static class NumberAdapter extends BaseQuickAdapter<HomeWork, BaseViewHolder> {
70
71 public NumberAdapter(@Nullable List<HomeWork> data) {
72 super(R.layout.item_topic_number, data);
73 }
74
75 @Override
76 protected void convert(@NonNull BaseViewHolder holder, HomeWork homeWork) {
77 TextView textView = (TextView) holder.itemView;
78 textView.setText(String.valueOf(getData().indexOf(homeWork) + 1));
79
80 int color = homeWork.check ? 0xFFFF4133 : 0xFF4ABC78;
81 textView.setBackgroundTintList(ColorStateList.valueOf(color));
82 }
83 }
84 }
85
app/src/main/res/color/color_btn_pre_state.xml
File was created 1 <?xml version="1.0" encoding="utf-8"?>
2 <selector xmlns:android="http://schemas.android.com/apk/res/android">
3 <item android:color="#CCC" android:state_enabled="false"/>
4 <item android:color="#333"/>
5 </selector>
app/src/main/res/drawable/ic_analyse.xml
File was created 1 <?xml version="1.0" encoding="utf-8"?>
2 <layer-list xmlns:android="http://schemas.android.com/apk/res/android">
3 <item android:width="17dp" android:height="17dp"
4 android:drawable="@drawable/png_ic_analyse"/>
5 </layer-list>
app/src/main/res/drawable/png_ic_analyse.png

2.85 KB

app/src/main/res/drawable/svg_pre.xml
File was created 1 <vector xmlns:android="http://schemas.android.com/apk/res/android"
2 android:width="8dp"
3 android:height="12dp"
4 android:viewportWidth="16"
5 android:viewportHeight="25">
6 <path
7 android:pathData="M0.886,13.934L1.269,14.315L1.269,14.315L11.225,24.196C12.071,25.036 13.443,25.036 14.289,24.196L14.672,23.816C15.518,22.977 15.518,21.615 14.672,20.776L6.247,12.414L14.672,4.053C15.518,3.213 15.518,1.852 14.672,1.012L14.289,0.632C13.443,-0.207 12.071,-0.207 11.225,0.632L1.269,10.514L1.269,10.514L0.886,10.894C0.04,11.734 0.04,13.095 0.886,13.934Z"
8 android:fillColor="#333333"
9 android:fillType="evenOdd"/>
10 </vector>
11
app/src/main/res/layout/activity_homework_feedback.xml
1 <?xml version="1.0" encoding="utf-8"?> 1 <?xml version="1.0" encoding="utf-8"?>
2 <LinearLayout 2 <LinearLayout
3 xmlns:android="http://schemas.android.com/apk/res/android" 3 xmlns:android="http://schemas.android.com/apk/res/android"
4 xmlns:app="http://schemas.android.com/apk/res-auto" 4 xmlns:app="http://schemas.android.com/apk/res-auto"
5 xmlns:tools="http://schemas.android.com/tools" 5 xmlns:tools="http://schemas.android.com/tools"
6 android:orientation="vertical" 6 android:orientation="vertical"
7 android:layout_width="match_parent" 7 android:layout_width="match_parent"
8 android:layout_height="match_parent" 8 android:layout_height="match_parent"
9 tools:ignore="UseCompoundDrawables,HardcodedText,SmallSp,ContentDescription"> 9 tools:ignore="UseCompoundDrawables,HardcodedText,SmallSp,ContentDescription">
10 10
11 <androidx.appcompat.widget.Toolbar 11 <androidx.appcompat.widget.Toolbar
12 android:id="@+id/toolbar" 12 android:id="@+id/toolbar"
13 app:navigationIcon="@drawable/svg_back" 13 app:navigationIcon="@drawable/svg_back"
14 app:contentInsetStartWithNavigation="14dp" 14 app:contentInsetStartWithNavigation="14dp"
15 android:paddingStart="-8dp" 15 android:paddingStart="-8dp"
16 android:paddingEnd="-8dp" 16 android:paddingEnd="-8dp"
17 android:background="@color/white" 17 android:background="@color/white"
18 android:layout_width="match_parent" 18 android:layout_width="match_parent"
19 android:layout_height="40dp"> 19 android:layout_height="40dp">
20 <TextView 20 <TextView
21 android:text="第二步:教师评语" 21 android:text="第二步:教师评语"
22 android:textSize="18sp" 22 android:textSize="18sp"
23 android:textColor="#333" 23 android:textColor="#333"
24 android:textStyle="bold" 24 android:textStyle="bold"
25 android:layout_gravity="center" 25 android:layout_gravity="center"
26 android:layout_width="wrap_content" 26 android:layout_width="wrap_content"
27 android:layout_height="wrap_content"/> 27 android:layout_height="wrap_content"/>
28 <TextView 28 <TextView
29 android:id="@+id/btnPublish" 29 android:id="@+id/btnPublish"
30 android:text="发布" 30 android:text="发布"
31 android:textSize="13sp" 31 android:textSize="13sp"
32 android:textColor="#1C90F3" 32 android:textColor="#1C90F3"
33 android:textStyle="bold" 33 android:textStyle="bold"
34 android:layout_gravity="end|center_vertical" 34 android:layout_gravity="end|center_vertical"
35 android:layout_marginEnd="24dp" 35 android:layout_marginEnd="24dp"
36 android:layout_width="wrap_content" 36 android:layout_width="wrap_content"
37 android:layout_height="wrap_content"/> 37 android:layout_height="wrap_content"/>
38 </androidx.appcompat.widget.Toolbar> 38 </androidx.appcompat.widget.Toolbar>
39 39
40 <androidx.core.widget.NestedScrollView 40 <androidx.core.widget.NestedScrollView
41 android:layout_width="match_parent" 41 android:layout_width="match_parent"
42 android:layout_height="match_parent"> 42 android:layout_height="match_parent">
43 <LinearLayout 43 <LinearLayout
44 android:orientation="vertical" 44 android:orientation="vertical"
45 android:paddingHorizontal="15dp" 45 android:paddingHorizontal="15dp"
46 android:paddingBottom="20dp" 46 android:paddingBottom="20dp"
47 android:layout_width="match_parent" 47 android:layout_width="match_parent"
48 android:layout_height="wrap_content"> 48 android:layout_height="wrap_content">
49 49
50 <LinearLayout 50 <LinearLayout
51 android:orientation="vertical" 51 android:orientation="vertical"
52 android:background="@drawable/shape_radius_10" 52 android:background="@drawable/shape_radius_10"
53 android:backgroundTint="@color/white" 53 android:backgroundTint="@color/white"
54 android:layout_marginTop="15dp" 54 android:layout_marginTop="15dp"
55 android:layout_width="match_parent" 55 android:layout_width="match_parent"
56 android:layout_height="wrap_content"> 56 android:layout_height="wrap_content">
57 <androidx.appcompat.widget.AppCompatTextView 57 <androidx.appcompat.widget.AppCompatTextView
58 android:text="学生信息" 58 android:text="学生信息"
59 android:textSize="16sp" 59 android:textSize="16sp"
60 android:textColor="#333" 60 android:textColor="#333"
61 android:textStyle="bold" 61 android:textStyle="bold"
62 android:gravity="center_vertical" 62 android:gravity="center_vertical"
63 android:paddingHorizontal="15dp" 63 android:paddingHorizontal="15dp"
64 android:drawablePadding="5dp" 64 android:drawablePadding="5dp"
65 android:drawableStart="@drawable/svg_ic_stu_info" 65 android:drawableStart="@drawable/svg_ic_stu_info"
66 android:background="@drawable/shape_radius_top_10" 66 android:background="@drawable/shape_radius_top_10"
67 android:backgroundTint="#DAEBFE" 67 android:backgroundTint="#DAEBFE"
68 android:layout_width="match_parent" 68 android:layout_width="match_parent"
69 android:layout_height="40dp"/> 69 android:layout_height="40dp"/>
70 <LinearLayout 70 <LinearLayout
71 android:orientation="horizontal" 71 android:orientation="horizontal"
72 android:layout_marginHorizontal="15dp" 72 android:layout_marginHorizontal="15dp"
73 android:layout_marginVertical="18dp" 73 android:layout_marginVertical="18dp"
74 android:layout_width="match_parent" 74 android:layout_width="match_parent"
75 android:layout_height="wrap_content"> 75 android:layout_height="wrap_content">
76 <TextView 76 <TextView
77 android:text="学生姓名:" 77 android:text="学生姓名:"
78 android:textSize="14sp" 78 android:textSize="14sp"
79 android:textColor="#333" 79 android:textColor="#333"
80 android:layout_width="wrap_content" 80 android:layout_width="wrap_content"
81 android:layout_height="wrap_content"/> 81 android:layout_height="wrap_content"/>
82 <TextView 82 <TextView
83 android:id="@+id/tvStuName" 83 android:id="@+id/tvStuName"
84 tools:text="杨小凯" 84 tools:text="杨小凯"
85 android:textSize="14sp" 85 android:textSize="14sp"
86 android:textColor="#333" 86 android:textColor="#333"
87 android:layout_width="wrap_content" 87 android:layout_width="wrap_content"
88 android:layout_height="wrap_content"/> 88 android:layout_height="wrap_content"/>
89 <Space style="@style/empty_space"/> 89 <Space style="@style/empty_space"/>
90 <TextView 90 <TextView
91 android:text="年级:" 91 android:text="年级:"
92 android:textSize="14sp" 92 android:textSize="14sp"
93 android:textColor="#333" 93 android:textColor="#333"
94 android:layout_width="wrap_content" 94 android:layout_width="wrap_content"
95 android:layout_height="wrap_content"/> 95 android:layout_height="wrap_content"/>
96 <TextView 96 <TextView
97 android:id="@+id/tvGrade" 97 android:id="@+id/tvGrade"
98 tools:text="六年级" 98 tools:text="六年级"
99 android:textSize="14sp" 99 android:textSize="14sp"
100 android:textColor="#333" 100 android:textColor="#333"
101 android:layout_width="96dp" 101 android:layout_width="96dp"
102 android:layout_height="wrap_content"/> 102 android:layout_height="wrap_content"/>
103 </LinearLayout> 103 </LinearLayout>
104 </LinearLayout> 104 </LinearLayout>
105 105
106 <LinearLayout 106 <LinearLayout
107 android:orientation="vertical" 107 android:orientation="vertical"
108 android:background="@drawable/shape_radius_10" 108 android:background="@drawable/shape_radius_10"
109 android:backgroundTint="@color/white" 109 android:backgroundTint="@color/white"
110 android:paddingBottom="15dp" 110 android:paddingBottom="15dp"
111 android:layout_marginTop="15dp" 111 android:layout_marginTop="15dp"
112 android:layout_width="match_parent" 112 android:layout_width="match_parent"
113 android:layout_height="wrap_content"> 113 android:layout_height="wrap_content">
114 <androidx.appcompat.widget.AppCompatTextView 114 <androidx.appcompat.widget.AppCompatTextView
115 android:text="作业详情" 115 android:text="作业详情"
116 android:textSize="16sp" 116 android:textSize="16sp"
117 android:textColor="#333" 117 android:textColor="#333"
118 android:textStyle="bold" 118 android:textStyle="bold"
119 android:gravity="center_vertical" 119 android:gravity="center_vertical"
120 android:paddingHorizontal="15dp" 120 android:paddingHorizontal="15dp"
121 android:drawablePadding="5dp" 121 android:drawablePadding="5dp"
122 android:drawableStart="@drawable/svg_ic_correct" 122 android:drawableStart="@drawable/svg_ic_correct"
123 android:background="@drawable/shape_radius_top_10" 123 android:background="@drawable/shape_radius_top_10"
124 android:backgroundTint="#DAEBFE" 124 android:backgroundTint="#DAEBFE"
125 android:layout_width="match_parent" 125 android:layout_width="match_parent"
126 android:layout_height="40dp"/> 126 android:layout_height="40dp"/>
127 <LinearLayout 127 <LinearLayout
128 android:orientation="horizontal" 128 android:orientation="horizontal"
129 android:layout_marginHorizontal="15dp" 129 android:layout_marginHorizontal="15dp"
130 android:layout_marginTop="15dp" 130 android:layout_marginTop="15dp"
131 android:layout_width="match_parent" 131 android:layout_width="match_parent"
132 android:layout_height="wrap_content"> 132 android:layout_height="wrap_content">
133 <TextView 133 <TextView
134 android:text="正确率:" 134 android:text="正确率:"
135 android:textSize="14sp" 135 android:textSize="14sp"
136 android:textColor="#333" 136 android:textColor="#333"
137 android:layout_width="wrap_content" 137 android:layout_width="wrap_content"
138 android:layout_height="wrap_content"/> 138 android:layout_height="wrap_content"/>
139 <TextView 139 <TextView
140 android:id="@+id/tvPercent" 140 android:id="@+id/tvPercent"
141 tools:text="60%" 141 tools:text="60%"
142 android:textSize="14sp" 142 android:textSize="14sp"
143 android:textColor="#333" 143 android:textColor="#333"
144 android:layout_width="wrap_content" 144 android:layout_width="wrap_content"
145 android:layout_height="wrap_content"/> 145 android:layout_height="wrap_content"/>
146 <Space style="@style/empty_space"/> 146 <Space style="@style/empty_space"/>
147 <TextView 147 <TextView
148 android:text="答题结果" 148 android:text="答题结果"
149 android:textSize="14sp" 149 android:textSize="14sp"
150 android:textColor="#333" 150 android:textColor="#333"
151 android:layout_width="wrap_content" 151 android:layout_width="wrap_content"
152 android:layout_height="wrap_content"/> 152 android:layout_height="wrap_content"/>
153 <TextView 153 <TextView
154 android:id="@+id/btnDetail"
154 android:text="(点击查看题目详情)" 155 android:text="(点击查看题目详情)"
155 android:textSize="14sp" 156 android:textSize="14sp"
156 android:textColor="#1C90F3" 157 android:textColor="#1C90F3"
157 android:layout_width="wrap_content" 158 android:layout_width="wrap_content"
158 android:layout_height="wrap_content"/> 159 android:layout_height="wrap_content"/>
159 </LinearLayout> 160 </LinearLayout>
160 161
161 <androidx.recyclerview.widget.RecyclerView 162 <androidx.recyclerview.widget.RecyclerView
162 android:id="@+id/rvCorrect" 163 android:id="@+id/rvCorrect"
163 tools:listitem="@layout/item_feedback_num" 164 tools:listitem="@layout/item_feedback_num"
164 tools:itemCount="1" 165 tools:itemCount="1"
165 android:layout_marginTop="15dp" 166 android:layout_marginTop="15dp"
166 android:layout_marginHorizontal="15dp" 167 android:layout_marginHorizontal="15dp"
167 android:layout_width="match_parent" 168 android:layout_width="match_parent"
168 android:layout_height="wrap_content"/> 169 android:layout_height="wrap_content"/>
169 <TextView 170 <TextView
170 android:text="错题已经加入到错题本,到错题本查看详情" 171 android:text="错题已经加入到错题本,到错题本查看详情"
171 android:textSize="12sp" 172 android:textSize="12sp"
172 android:textColor="#666" 173 android:textColor="#666"
173 android:layout_marginHorizontal="15dp" 174 android:layout_marginHorizontal="15dp"
174 android:layout_width="wrap_content" 175 android:layout_width="wrap_content"
175 android:layout_height="wrap_content"/> 176 android:layout_height="wrap_content"/>
176 </LinearLayout> 177 </LinearLayout>
177 178
178 <LinearLayout 179 <LinearLayout
179 android:id="@+id/flEval" 180 android:id="@+id/flEval"
180 android:orientation="vertical" 181 android:orientation="vertical"
181 android:background="@drawable/shape_radius_10" 182 android:background="@drawable/shape_radius_10"
182 android:backgroundTint="@color/white" 183 android:backgroundTint="@color/white"
183 android:layout_marginTop="15dp" 184 android:layout_marginTop="15dp"
184 android:layout_width="match_parent" 185 android:layout_width="match_parent"
185 android:layout_height="wrap_content"> 186 android:layout_height="wrap_content">
186 <androidx.appcompat.widget.AppCompatTextView 187 <androidx.appcompat.widget.AppCompatTextView
187 android:text="辅导后错题掌握评估" 188 android:text="辅导后错题掌握评估"
188 android:textSize="16sp" 189 android:textSize="16sp"
189 android:textColor="#333" 190 android:textColor="#333"
190 android:textStyle="bold" 191 android:textStyle="bold"
191 android:gravity="center_vertical" 192 android:gravity="center_vertical"
192 android:paddingHorizontal="15dp" 193 android:paddingHorizontal="15dp"
193 android:drawablePadding="5dp" 194 android:drawablePadding="5dp"
194 android:drawableStart="@drawable/svg_ic_paper" 195 android:drawableStart="@drawable/svg_ic_paper"
195 android:background="@drawable/shape_radius_top_10" 196 android:background="@drawable/shape_radius_top_10"
196 android:backgroundTint="#DAEBFE" 197 android:backgroundTint="#DAEBFE"
197 android:layout_width="match_parent" 198 android:layout_width="match_parent"
198 android:layout_height="40dp"/> 199 android:layout_height="40dp"/>
199 <androidx.recyclerview.widget.RecyclerView 200 <androidx.recyclerview.widget.RecyclerView
200 android:id="@+id/rvError" 201 android:id="@+id/rvError"
201 android:orientation="vertical" 202 android:orientation="vertical"
202 app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" 203 app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
203 android:layout_width="match_parent" 204 android:layout_width="match_parent"
204 android:layout_height="wrap_content"/> 205 android:layout_height="wrap_content"/>
205 </LinearLayout> 206 </LinearLayout>
206 207
207 <LinearLayout 208 <LinearLayout
208 android:orientation="vertical" 209 android:orientation="vertical"
209 android:background="@drawable/shape_radius_10" 210 android:background="@drawable/shape_radius_10"
210 android:backgroundTint="@color/white" 211 android:backgroundTint="@color/white"
211 android:layout_marginTop="15dp" 212 android:layout_marginTop="15dp"
212 android:layout_width="match_parent" 213 android:layout_width="match_parent"
213 android:layout_height="wrap_content"> 214 android:layout_height="wrap_content">
214 <androidx.appcompat.widget.AppCompatTextView 215 <androidx.appcompat.widget.AppCompatTextView
215 android:text="教师评语" 216 android:text="教师评语"
216 android:textSize="16sp" 217 android:textSize="16sp"
217 android:textColor="#333" 218 android:textColor="#333"
218 android:textStyle="bold" 219 android:textStyle="bold"
219 android:gravity="center_vertical" 220 android:gravity="center_vertical"
220 android:paddingHorizontal="15dp" 221 android:paddingHorizontal="15dp"
221 android:drawablePadding="5dp" 222 android:drawablePadding="5dp"
222 android:drawableStart="@drawable/svg_ic_comment" 223 android:drawableStart="@drawable/svg_ic_comment"
223 android:background="@drawable/shape_radius_top_10" 224 android:background="@drawable/shape_radius_top_10"
224 android:backgroundTint="#DAEBFE" 225 android:backgroundTint="#DAEBFE"
225 android:layout_width="match_parent" 226 android:layout_width="match_parent"
226 android:layout_height="40dp"/> 227 android:layout_height="40dp"/>
227 <EditText 228 <EditText
228 android:id="@+id/etComment" 229 android:id="@+id/etComment"
229 android:hint="非必填" 230 android:hint="非必填"
230 android:textSize="13sp" 231 android:textSize="13sp"
231 android:textColor="#333" 232 android:textColor="#333"
232 android:textColorHint="#999" 233 android:textColorHint="#999"
233 android:gravity="start" 234 android:gravity="start"
234 android:background="@null" 235 android:background="@null"
235 android:layout_margin="14dp" 236 android:layout_margin="14dp"
236 android:layout_width="match_parent" 237 android:layout_width="match_parent"
237 android:layout_height="wrap_content" 238 android:layout_height="wrap_content"
238 tools:ignore="Autofill,LabelFor,TextFields" /> 239 tools:ignore="Autofill,LabelFor,TextFields" />
239 </LinearLayout> 240 </LinearLayout>
240 241
241 242
242 </LinearLayout> 243 </LinearLayout>
243 </androidx.core.widget.NestedScrollView> 244 </androidx.core.widget.NestedScrollView>
244 </LinearLayout> 245 </LinearLayout>
app/src/main/res/layout/activity_topic_detail.xml
File was created 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:layout_width="match_parent"
7 android:layout_height="match_parent"
8 tools:ignore="UseCompoundDrawables,HardcodedText,SmallSp,ContentDescription">
9
10 <androidx.appcompat.widget.Toolbar
11 android:id="@+id/toolbar"
12 app:navigationIcon="@drawable/svg_back"
13 app:contentInsetStartWithNavigation="14dp"
14 android:paddingStart="-8dp"
15 android:paddingEnd="-8dp"
16 android:background="@color/white"
17 android:layout_width="match_parent"
18 android:layout_height="40dp">
19 <TextView
20 android:id="@+id/tvTitle"
21 tools:text="1/6"
22 android:textSize="18sp"
23 android:textColor="#333"
24 android:textStyle="bold"
25 android:layout_gravity="center"
26 android:layout_width="wrap_content"
27 android:layout_height="wrap_content"/>
28 </androidx.appcompat.widget.Toolbar>
29
30 <androidx.core.widget.NestedScrollView
31 android:layout_width="match_parent"
32 android:layout_height="0dp"
33 android:layout_weight="1">
34 <LinearLayout
35 android:orientation="vertical"
36 android:paddingHorizontal="15dp"
37 android:layout_width="match_parent"
38 android:layout_height="wrap_content">
39
40 <androidx.recyclerview.widget.RecyclerView
41 android:id="@+id/rvNumber"
42 android:orientation="horizontal"
43 app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
44 android:layout_marginTop="15dp"
45 android:layout_width="match_parent"
46 android:layout_height="wrap_content"/>
47
48 <LinearLayout
49 android:orientation="vertical"
50 android:layout_marginTop="15dp"
51 android:background="@drawable/shape_radius_5"
52 android:backgroundTint="@color/white"
53 android:layout_width="match_parent"
54 android:layout_height="wrap_content">
55 <TextView
56 android:id="@+id/tvNo"
57 tools:text="题目8"
58 android:layout_width="40dp"
59 android:layout_height="16dp"
60 android:layout_gravity="end"
61 android:background="@drawable/bg_homework_num"
62 android:gravity="center"
63 android:textColor="@color/white"
64 android:textSize="9sp" />
65 <ImageView
66 android:id="@+id/ivTopic"
67 android:adjustViewBounds="true"
68 android:layout_marginHorizontal="20dp"
69 android:layout_marginVertical="16dp"
70 android:layout_width="match_parent"
71 android:layout_height="wrap_content"/>
72 </LinearLayout>
73
74 <LinearLayout
75 android:orientation="vertical"
76 android:layout_marginTop="15dp"
77 android:background="@drawable/shape_radius_5"
78 android:backgroundTint="@color/white"
79 android:layout_width="match_parent"
80 android:layout_height="wrap_content">
81 <androidx.appcompat.widget.AppCompatTextView
82 android:text="解析"
83 android:layout_width="wrap_content"
84 android:layout_height="wrap_content"
85 android:layout_marginTop="15dp"
86 android:layout_marginHorizontal="15dp"
87 android:drawableStart="@drawable/ic_analyse"
88 android:drawablePadding="5dp"
89 android:gravity="center|center_vertical"
90 android:textStyle="bold"
91 android:textColor="#333"
92 android:textSize="16sp" />
93 <ImageView
94 android:id="@+id/ivAnalyse"
95 android:adjustViewBounds="true"
96 android:layout_marginHorizontal="15dp"
97 android:layout_marginVertical="15dp"
98 android:layout_width="match_parent"
99 android:layout_height="wrap_content"/>
100 </LinearLayout>
101
102 <LinearLayout
103 android:orientation="vertical"
104 android:layout_marginTop="15dp"
105 android:background="@drawable/shape_radius_5"
106 android:backgroundTint="@color/white"
107 android:layout_width="match_parent"
108 android:layout_height="wrap_content">
109 <androidx.appcompat.widget.AppCompatTextView
110 android:text="答案"
111 android:layout_width="wrap_content"
112 android:layout_height="wrap_content"
113 android:layout_marginTop="15dp"
114 android:layout_marginHorizontal="15dp"
115 android:drawableStart="@drawable/ic_analyse"
116 android:drawablePadding="5dp"
117 android:gravity="center|center_vertical"
118 android:textStyle="bold"
119 android:textColor="#333"
120 android:textSize="16sp" />
121 <TextView
122 android:id="@+id/tvAnswer"
123 android:textSize="12sp"
124 android:textColor="#333"
125 android:layout_margin="15dp"
126 android:layout_width="match_parent"
127 android:layout_height="wrap_content"/>
128 </LinearLayout>
129
130 <LinearLayout
131 android:orientation="vertical"
132 android:layout_marginTop="15dp"
133 android:background="@drawable/shape_radius_5"
134 android:backgroundTint="@color/white"
135 android:layout_width="match_parent"
136 android:layout_height="wrap_content">
137 <androidx.appcompat.widget.AppCompatTextView
138 android:text="知识点"
139 android:layout_width="wrap_content"
140 android:layout_height="wrap_content"
141 android:layout_marginTop="15dp"
142 android:layout_marginHorizontal="15dp"
143 android:drawableStart="@drawable/ic_analyse"
144 android:drawablePadding="5dp"
145 android:gravity="center|center_vertical"
146 android:textStyle="bold"
147 android:textColor="#333"
148 android:textSize="16sp" />
149 <TextView
150 android:id="@+id/tvPoint"
151 android:textSize="12sp"
152 android:textColor="#333"
153 android:layout_margin="15dp"
154 android:layout_width="match_parent"
155 android:layout_height="wrap_content"/>
156 </LinearLayout>
157
158 </LinearLayout>
159 </androidx.core.widget.NestedScrollView>
160
161 <LinearLayout
162 android:orientation="horizontal"
163 android:gravity="center_vertical"
164 android:paddingHorizontal="15dp"
165 android:layout_marginVertical="15dp"
166 android:layout_width="match_parent"
167 android:layout_height="wrap_content">
168 <androidx.constraintlayout.utils.widget.ImageFilterView
169 android:id="@+id/btnPre"
170 app:round="10dp"
171 android:src="@drawable/svg_pre"
172 android:tint="@color/color_btn_pre_state"
173 android:background="@color/white"
174 android:paddingHorizontal="6dp"
175 android:layout_width="20dp"
176 android:layout_height="20dp"/>
177 <Space style="@style/empty_space"/>
178 <androidx.constraintlayout.utils.widget.ImageFilterView
179 android:id="@+id/btnNext"
180 android:rotation="180"
181 app:round="10dp"
182 android:src="@drawable/svg_pre"
183 android:tint="@color/color_btn_pre_state"
184 android:background="@color/white"
185 android:paddingHorizontal="6dp"
186 android:layout_width="20dp"
187 android:layout_height="20dp"/>
188 </LinearLayout>
189 </LinearLayout>
app/src/main/res/layout/item_topic_number.xml
File was created 1 <?xml version="1.0" encoding="utf-8"?>
2 <TextView 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:layout_marginEnd="15dp"
6 android:background="@drawable/shape_radius_5"
7 android:backgroundTint="#FF4133"
8 tools:text="8"
9 android:gravity="center"
10 android:textSize="14sp"
11 android:textColor="@color/white"
12 android:textStyle="bold"
13 android:layout_width="25dp"
14 android:layout_height="25dp">
15
16 </TextView>