Commit fbe6b1873d311a68b7ad80eda9efb35312b761c2
1 parent
fc85bfe197
Exists in
master
首页展示已反馈作业
Showing
3 changed files
with
25 additions
and
21 deletions
Show diff stats
.idea/deploymentTargetDropDown.xml
| ... | ... | @@ -3,20 +3,7 @@ |
| 3 | 3 | <component name="deploymentTargetDropDown"> |
| 4 | 4 | <value> |
| 5 | 5 | <entry key="app"> |
| 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="2024-10-11T05:46:18.103982900Z" /> | |
| 19 | - </State> | |
| 6 | + <State /> | |
| 20 | 7 | </entry> |
| 21 | 8 | </value> |
| 22 | 9 | </component> | ... | ... |
app/build.gradle
| ... | ... | @@ -25,8 +25,8 @@ android { |
| 25 | 25 | applicationId "com.hjx.parent" |
| 26 | 26 | minSdk 26 |
| 27 | 27 | targetSdk 32 |
| 28 | - versionCode 1005 | |
| 29 | - versionName "1.0.0.5" | |
| 28 | + versionCode 1006 | |
| 29 | + versionName "1.0.0.6" | |
| 30 | 30 | |
| 31 | 31 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" |
| 32 | 32 | } | ... | ... |
app/src/main/java/com/hjx/parent/fragment/ErrorFragment.java
| ... | ... | @@ -33,6 +33,7 @@ import com.hjq.permissions.Permission; |
| 33 | 33 | import com.hjq.permissions.XXPermissions; |
| 34 | 34 | import com.hjx.parent.ErrorListActivity; |
| 35 | 35 | import com.hjx.parent.HomeworkDetailActivity; |
| 36 | +import com.hjx.parent.HomeworkShareActivity; | |
| 36 | 37 | import com.hjx.parent.ImageActivity; |
| 37 | 38 | import com.hjx.parent.R; |
| 38 | 39 | import com.hjx.parent.StuHomeworkActivity; |
| ... | ... | @@ -46,6 +47,7 @@ import com.prws.common.bean.PageInfo; |
| 46 | 47 | import com.prws.common.bean.ResponseResult; |
| 47 | 48 | import com.prws.common.bean.Student; |
| 48 | 49 | import com.prws.common.bean.TopicBean; |
| 50 | +import com.prws.common.bean.homework.HomeworkList; | |
| 49 | 51 | import com.prws.common.net.NetWorks; |
| 50 | 52 | import com.prws.common.utils.BitmapUtils; |
| 51 | 53 | import com.prws.common.utils.CommonUtil; |
| ... | ... | @@ -61,11 +63,13 @@ import com.zhangteng.imagepicker.imageloader.GlideImageLoader; |
| 61 | 63 | import com.zhangteng.utils.IHandlerCallBack; |
| 62 | 64 | |
| 63 | 65 | import java.io.File; |
| 66 | +import java.text.SimpleDateFormat; | |
| 64 | 67 | import java.util.ArrayList; |
| 65 | 68 | import java.util.Arrays; |
| 66 | 69 | import java.util.Collections; |
| 67 | 70 | import java.util.HashMap; |
| 68 | 71 | import java.util.List; |
| 72 | +import java.util.Locale; | |
| 69 | 73 | import java.util.Map; |
| 70 | 74 | |
| 71 | 75 | import io.reactivex.Observable; |
| ... | ... | @@ -166,13 +170,25 @@ public class ErrorFragment extends BaseRxFragment<FragmentErrorBookBinding> { |
| 166 | 170 | errorAdapter = new ErrorAdapter(getActivity(), new ArrayList<>(), false); |
| 167 | 171 | homeworkAdapter = new HomeworkAdapter(); |
| 168 | 172 | homeworkAdapter.setOnItemClickListener((baseQuickAdapter, view1, i) -> { |
| 173 | + HomeworkList data = homeworkAdapter.getData().get(i); | |
| 169 | 174 | Gson gson = new Gson(); |
| 170 | 175 | String json = gson.toJson(studentBean); |
| 171 | 176 | Student s = gson.fromJson(json, Student.class); |
| 172 | - Intent intent = new Intent(requireContext(), HomeworkDetailActivity.class); | |
| 173 | - intent.putExtra("student", s); | |
| 174 | - intent.putExtra("data", homeworkAdapter.getData().get(i)); | |
| 175 | - startActivity(intent); | |
| 177 | + if (data.getRight() == null) { | |
| 178 | + Intent intent = new Intent(requireContext(), HomeworkDetailActivity.class); | |
| 179 | + intent.putExtra("student", s); | |
| 180 | + intent.putExtra("data", data); | |
| 181 | + startActivity(intent); | |
| 182 | + } else { | |
| 183 | + Intent intent = new Intent(requireContext(), HomeworkShareActivity.class); | |
| 184 | + intent.putExtra("student", s); | |
| 185 | + intent.putExtra("id", data.getId()); | |
| 186 | + intent.putExtra("grade", data.getGrade()); | |
| 187 | + intent.putExtra("subject", data.getSubject()); | |
| 188 | + String name1 = new SimpleDateFormat("yyyy年M月d日作业", Locale.CHINA).format(data.uploadTime); | |
| 189 | + intent.putExtra("name", name1); | |
| 190 | + startActivity(intent); | |
| 191 | + } | |
| 176 | 192 | }); |
| 177 | 193 | binding.rvMain.setAdapter(errorAdapter); |
| 178 | 194 | binding.tabLayout.addTab(binding.tabLayout.newTab().setText("最近错题")); |
| ... | ... | @@ -286,7 +302,8 @@ public class ErrorFragment extends BaseRxFragment<FragmentErrorBookBinding> { |
| 286 | 302 | .toObservable() |
| 287 | 303 | .concatMap(Observable::fromIterable) |
| 288 | 304 | .filter(data -> subject.equals(data.getSubject())) |
| 289 | - .filter(data -> data.getRight() == null) | |
| 305 | + //.filter(data -> data.getRight() == null) | |
| 306 | + .take(5) | |
| 290 | 307 | .toList() |
| 291 | 308 | .subscribe((data, th) -> { |
| 292 | 309 | if (th != null) th.printStackTrace(); | ... | ... |