diff options
author | ByteHamster <info@bytehamster.com> | 2019-04-06 19:04:24 +0200 |
---|---|---|
committer | ByteHamster <info@bytehamster.com> | 2019-04-06 21:32:03 +0200 |
commit | 74fdabba691e7ea1c127ffa9e0535175de891ccb (patch) | |
tree | 09ef73dbcf772a42945366eced048ebea1d89c88 | |
parent | 6c3033409ded65a46908b3165215a23938083990 (diff) | |
download | AntennaPod-74fdabba691e7ea1c127ffa9e0535175de891ccb.zip |
Show single item after undo in EpisodesFragment
-rw-r--r-- | app/src/main/java/de/danoeh/antennapod/fragment/AllEpisodesFragment.java | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/AllEpisodesFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/AllEpisodesFragment.java index a8d93375c..5997d227a 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/AllEpisodesFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/AllEpisodesFragment.java @@ -342,19 +342,20 @@ public class AllEpisodesFragment extends Fragment { } private void onFragmentLoaded() { - if (listAdapter == null) { - MainActivity mainActivity = (MainActivity) getActivity(); - listAdapter = new AllEpisodesRecycleAdapter(mainActivity, itemAccess, - new DefaultActionButtonCallback(mainActivity), showOnlyNewEpisodes()); - listAdapter.setHasStableIds(true); - recyclerView.setAdapter(listAdapter); - } - if (episodes == null || episodes.size() == 0) { - recyclerView.setVisibility(View.GONE); - emptyView.setVisibility(View.VISIBLE); - } else { + if (episodes != null && episodes.size() > 0) { + if (listAdapter == null) { + MainActivity mainActivity = (MainActivity) getActivity(); + listAdapter = new AllEpisodesRecycleAdapter(mainActivity, itemAccess, + new DefaultActionButtonCallback(mainActivity), showOnlyNewEpisodes()); + listAdapter.setHasStableIds(true); + recyclerView.setAdapter(listAdapter); + } emptyView.setVisibility(View.GONE); recyclerView.setVisibility(View.VISIBLE); + } else { + listAdapter = null; + recyclerView.setVisibility(View.GONE); + emptyView.setVisibility(View.VISIBLE); } listAdapter.notifyDataSetChanged(); |