diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/EpisodeItemListAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/EpisodeItemListAdapter.java index f8fd99867..2f39b599f 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/EpisodeItemListAdapter.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/EpisodeItemListAdapter.java @@ -68,6 +68,19 @@ public class EpisodeItemListAdapter extends RecyclerView.Adapter= 0) { - listAdapter.notifyItemChanged(pos); + listAdapter.notifyItemChangedCompat(pos); } } } diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/FeedItemlistFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/FeedItemlistFragment.java index 86b00a7ae..b4e28567c 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/FeedItemlistFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/FeedItemlistFragment.java @@ -354,7 +354,7 @@ public class FeedItemlistFragment extends Fragment implements AdapterView.OnItem if (pos >= 0) { feed.getItems().remove(pos); feed.getItems().add(pos, item); - adapter.notifyItemChanged(pos); + adapter.notifyItemChangedCompat(pos); } } } @@ -370,7 +370,7 @@ public class FeedItemlistFragment extends Fragment implements AdapterView.OnItem for (long mediaId : update.mediaIds) { int pos = FeedItemUtil.indexOfItemWithMediaId(feed.getItems(), mediaId); if (pos >= 0) { - adapter.notifyItemChanged(pos); + adapter.notifyItemChangedCompat(pos); } } } @@ -407,7 +407,6 @@ public class FeedItemlistFragment extends Fragment implements AdapterView.OnItem @Subscribe(threadMode = ThreadMode.MAIN) public void onFeedListChanged(FeedListUpdateEvent event) { if (event.contains(feed)) { - refreshHeaderView(); updateUi(); } } @@ -441,7 +440,8 @@ public class FeedItemlistFragment extends Fragment implements AdapterView.OnItem } private void refreshHeaderView() { - if (recyclerView == null || feed == null || !headerCreated) { + setupHeaderView(); + if (recyclerView == null || feed == null) { Log.e(TAG, "Unable to refresh header view"); return; } @@ -487,7 +487,6 @@ public class FeedItemlistFragment extends Fragment implements AdapterView.OnItem } }); headerCreated = true; - refreshHeaderView(); } private void showFeedInfo() { @@ -528,7 +527,7 @@ public class FeedItemlistFragment extends Fragment implements AdapterView.OnItem .observeOn(AndroidSchedulers.mainThread()) .subscribe(result -> { feed = result.orElse(null); - setupHeaderView(); + refreshHeaderView(); displayList(); }, error -> Log.e(TAG, Log.getStackTraceString(error))); } diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/PlaybackHistoryFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/PlaybackHistoryFragment.java index 36cda5c84..10a5a81d4 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/PlaybackHistoryFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/PlaybackHistoryFragment.java @@ -115,7 +115,7 @@ public class PlaybackHistoryFragment extends Fragment { if (pos >= 0) { playbackHistory.remove(pos); playbackHistory.add(pos, item); - adapter.notifyItemChanged(pos); + adapter.notifyItemChangedCompat(pos); } } } @@ -128,7 +128,7 @@ public class PlaybackHistoryFragment extends Fragment { for (long mediaId : update.mediaIds) { int pos = FeedItemUtil.indexOfItemWithMediaId(playbackHistory, mediaId); if (pos >= 0) { - adapter.notifyItemChanged(pos); + adapter.notifyItemChangedCompat(pos); } } } diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/QueueFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/QueueFragment.java index 404ea1d8d..0a752b855 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/QueueFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/QueueFragment.java @@ -178,7 +178,7 @@ public class QueueFragment extends Fragment { if (pos >= 0) { queue.remove(pos); queue.add(pos, item); - recyclerAdapter.notifyItemChanged(pos); + recyclerAdapter.notifyItemChangedCompat(pos); refreshInfoBar(); } } @@ -195,7 +195,7 @@ public class QueueFragment extends Fragment { for (long mediaId : update.mediaIds) { int pos = FeedItemUtil.indexOfItemWithMediaId(queue, mediaId); if (pos >= 0) { - recyclerAdapter.notifyItemChanged(pos); + recyclerAdapter.notifyItemChangedCompat(pos); } } } diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/SearchFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/SearchFragment.java index 4bb7ec28a..389996b07 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/SearchFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/SearchFragment.java @@ -215,7 +215,7 @@ public class SearchFragment extends Fragment { if (pos >= 0) { results.remove(pos); results.add(pos, item); - adapter.notifyItemChanged(pos); + adapter.notifyItemChangedCompat(pos); } } } @@ -228,7 +228,7 @@ public class SearchFragment extends Fragment { for (long mediaId : update.mediaIds) { int pos = FeedItemUtil.indexOfItemWithMediaId(results, mediaId); if (pos >= 0) { - adapter.notifyItemChanged(pos); + adapter.notifyItemChangedCompat(pos); } } }