Commit a9477a8164c0172013cee7aed576b480d2fdb0c6
1 parent
4e0766ff73
Exists in
master
首页优化
Showing
2 changed files
with
7 additions
and
7 deletions
Show diff stats
app/src/main/java/com/hjx/parent/fragment/ErrorFragment.java
... | ... | @@ -144,11 +144,6 @@ public class ErrorFragment extends BaseRxFragment<FragmentErrorBookBinding> { |
144 | 144 | String subStr = getResources().getStringArray(R.array.filter_subject)[subject]; |
145 | 145 | getError(subStr); |
146 | 146 | getHomework(subStr); |
147 | - if (binding.tabLayout.getSelectedTabPosition() == 0) { | |
148 | - binding.tvListTitle.setText("最近错题"); | |
149 | - } else { | |
150 | - binding.tvListTitle.setText("最近作业"); | |
151 | - } | |
152 | 147 | } |
153 | 148 | }); |
154 | 149 | } |
... | ... | @@ -178,10 +173,14 @@ public class ErrorFragment extends BaseRxFragment<FragmentErrorBookBinding> { |
178 | 173 | binding.rvMain.setAdapter(errorAdapter); |
179 | 174 | binding.rvMain.setVisibility(errorAdapter.list.isEmpty() ? View.GONE : View.VISIBLE); |
180 | 175 | binding.llEmpty.setVisibility(errorAdapter.list.isEmpty() ? View.VISIBLE : View.GONE); |
176 | + binding.tvListTitle.setText("最近错题"); | |
177 | + binding.tvEmpty.setText("暂无错题~"); | |
181 | 178 | } else { |
182 | 179 | binding.rvMain.setAdapter(homeworkAdapter); |
183 | - binding.rvMain.setVisibility(View.VISIBLE); | |
184 | - binding.llEmpty.setVisibility(View.GONE); | |
180 | + binding.rvMain.setVisibility(homeworkAdapter.getData().isEmpty() ? View.GONE : View.VISIBLE); | |
181 | + binding.llEmpty.setVisibility(homeworkAdapter.getData().isEmpty() ? View.VISIBLE : View.GONE); | |
182 | + binding.tvListTitle.setText("最近作业"); | |
183 | + binding.tvEmpty.setText("暂无作业~"); | |
185 | 184 | } |
186 | 185 | } |
187 | 186 | @Override | ... | ... |
app/src/main/res/layout/fragment_error_book.xml