Commit bd79e76cddec67897be48aba154bb57ba032e5ed
1 parent
0c498d9a4e
Exists in
master
页面跳转
Showing
2 changed files
with
24 additions
and
1 deletions
Show diff stats
app/src/main/java/com/hjx/parent/HomeworkFeedbackActivity.java
| ... | ... | @@ -97,8 +97,15 @@ public class HomeworkFeedbackActivity extends BaseRxActivity<ActivityHomeworkFee |
| 97 | 97 | .subscribe((response, th) -> { |
| 98 | 98 | if (th != null) th.printStackTrace(); |
| 99 | 99 | if (response != null && response.getSuccess()) { |
| 100 | - // TODO | |
| 101 | 100 | Toast.makeText(this, "反馈成功", Toast.LENGTH_SHORT).show(); |
| 101 | + | |
| 102 | + Intent intent = new Intent(this, HomeworkShareActivity.class); | |
| 103 | + intent.putExtra("student", student); | |
| 104 | + intent.putExtra("id", mData.getId()); | |
| 105 | + intent.putExtra("grade", mData.getGrade()); | |
| 106 | + intent.putExtra("subject", mData.getSubject()); | |
| 107 | + startActivity(intent); | |
| 108 | + | |
| 102 | 109 | setResult(RESULT_OK); |
| 103 | 110 | finish(); |
| 104 | 111 | } | ... | ... |
app/src/main/java/com/hjx/parent/fragment/ErrorFragment.java
| ... | ... | @@ -32,6 +32,7 @@ import com.hjq.permissions.OnPermissionCallback; |
| 32 | 32 | import com.hjq.permissions.Permission; |
| 33 | 33 | import com.hjq.permissions.XXPermissions; |
| 34 | 34 | import com.hjx.parent.ErrorListActivity; |
| 35 | +import com.hjx.parent.HomeworkDetailActivity; | |
| 35 | 36 | import com.hjx.parent.ImageActivity; |
| 36 | 37 | import com.hjx.parent.R; |
| 37 | 38 | import com.hjx.parent.StuHomeworkActivity; |
| ... | ... | @@ -43,6 +44,7 @@ import com.hjx.parent.databinding.FragmentErrorBookBinding; |
| 43 | 44 | import com.hjx.parent.rx.BaseRxFragment; |
| 44 | 45 | import com.prws.common.bean.PageInfo; |
| 45 | 46 | import com.prws.common.bean.ResponseResult; |
| 47 | +import com.prws.common.bean.Student; | |
| 46 | 48 | import com.prws.common.bean.TopicBean; |
| 47 | 49 | import com.prws.common.net.NetWorks; |
| 48 | 50 | import com.prws.common.utils.BitmapUtils; |
| ... | ... | @@ -163,6 +165,15 @@ public class ErrorFragment extends BaseRxFragment<FragmentErrorBookBinding> { |
| 163 | 165 | |
| 164 | 166 | errorAdapter = new ErrorAdapter(getActivity(), new ArrayList<>(), false); |
| 165 | 167 | homeworkAdapter = new HomeworkAdapter(); |
| 168 | + homeworkAdapter.setOnItemClickListener((baseQuickAdapter, view1, i) -> { | |
| 169 | + Gson gson = new Gson(); | |
| 170 | + String json = gson.toJson(studentBean); | |
| 171 | + 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); | |
| 176 | + }); | |
| 166 | 177 | binding.rvMain.setAdapter(errorAdapter); |
| 167 | 178 | binding.tabLayout.addTab(binding.tabLayout.newTab().setText("最近错题")); |
| 168 | 179 | binding.tabLayout.addTab(binding.tabLayout.newTab().setText("最近作业")); |
| ... | ... | @@ -275,6 +286,7 @@ public class ErrorFragment extends BaseRxFragment<FragmentErrorBookBinding> { |
| 275 | 286 | .toObservable() |
| 276 | 287 | .flatMap(Observable::fromIterable) |
| 277 | 288 | .filter(data -> subject.equals(data.getSubject())) |
| 289 | + .filter(data -> data.getRight() == null) | |
| 278 | 290 | .toList() |
| 279 | 291 | .subscribe((data, th) -> { |
| 280 | 292 | if (th != null) th.printStackTrace(); |
| ... | ... | @@ -282,6 +294,10 @@ public class ErrorFragment extends BaseRxFragment<FragmentErrorBookBinding> { |
| 282 | 294 | Collections.sort(data); |
| 283 | 295 | } |
| 284 | 296 | homeworkAdapter.setNewData(data); |
| 297 | + if (binding.tabLayout.getSelectedTabPosition() == 1) { | |
| 298 | + binding.rvMain.setVisibility(data == null || data.isEmpty() ? View.GONE : View.VISIBLE); | |
| 299 | + binding.llEmpty.setVisibility(data == null || data.isEmpty() ? View.VISIBLE : View.GONE); | |
| 300 | + } | |
| 285 | 301 | }); |
| 286 | 302 | } |
| 287 | 303 | ... | ... |