Commit 15fcbc93a3286f2362fbd4393647f1b01c0049c4
1 parent
b2caea24
1 修改重新上传列表只有一条数据时,点击删除按钮,当前列表为空时,视图显示状态
Showing
3 changed files
with
17 additions
and
1 deletions
config.gradle
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/frame/view/LineUpAgainView.java
| ... | ... | @@ -74,6 +74,14 @@ public class LineUpAgainView implements MvpView { |
| 74 | 74 | //先删除数据库,再更新列表 |
| 75 | 75 | againAdapter.updateDeleteList(position); |
| 76 | 76 | } |
| 77 | + if (null != againAdapter) { | |
| 78 | + if (againAdapter.getListSize() < 1) { | |
| 79 | + if (null == fragment.getActivity()) { | |
| 80 | + return; | |
| 81 | + } | |
| 82 | + fragment.binding.llNoFailTip.setVisibility(View.VISIBLE); | |
| 83 | + } | |
| 84 | + } | |
| 77 | 85 | } |
| 78 | 86 | }); |
| 79 | 87 | selectDialog.setCancelable(false); | ... | ... |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/ui/adapter/LineUpAgainAdapter.java
| ... | ... | @@ -31,6 +31,14 @@ public class LineUpAgainAdapter extends RecyclerView.Adapter<LineUpAgainAdapter. |
| 31 | 31 | private OnRestartUploadClickListener onRestartUploadClickListener; |
| 32 | 32 | private OnDeleteClickListener onDeleteClickListener; |
| 33 | 33 | |
| 34 | + public int getListSize() { | |
| 35 | + if (null == list) { | |
| 36 | + return 0; | |
| 37 | + } else { | |
| 38 | + return list.size(); | |
| 39 | + } | |
| 40 | + } | |
| 41 | + | |
| 34 | 42 | public void updateDeleteList(int position) { |
| 35 | 43 | if (null != list) { |
| 36 | 44 | list.remove(position); | ... | ... |