Update view after episode deletion when downloaded filter is enabled (#4560)

This commit is contained in:
Niffler 2020-10-22 23:04:00 +02:00 committed by GitHub
parent 7ed1e36ac3
commit 469a1615db
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 0 deletions

View File

@ -89,6 +89,18 @@ public class AllEpisodesFragment extends EpisodesListFragment {
filterDialog.openDialog();
}
@Override
protected boolean shouldUpdatedItemRemainInList(FeedItem item) {
SharedPreferences prefs = getActivity().getSharedPreferences(PREF_NAME, Context.MODE_PRIVATE);
FeedItemFilter feedItemFilter = new FeedItemFilter(prefs.getString(PREF_FILTER, ""));
if (feedItemFilter.isShowDownloaded() && (!item.hasMedia() || !item.getMedia().isDownloaded())) {
return false;
}
return true;
}
@NonNull
@Override
protected List<FeedItem> loadData() {

View File

@ -129,4 +129,8 @@ public class FeedItemFilter {
return mProperties.clone();
}
public boolean isShowDownloaded() {
return showDownloaded;
}
}