From dbfd4168bd64b386afc430bb8606050a2e3a652a Mon Sep 17 00:00:00 2001 From: asdoi <36813904+asdoi@users.noreply.github.com> Date: Wed, 22 Jul 2020 20:26:01 +0000 Subject: [PATCH] Make filter message in feeds clickable --- .../antennapod/fragment/FeedItemlistFragment.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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 5ae2b9ce5..af07e75fe 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/FeedItemlistFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/FeedItemlistFragment.java @@ -53,6 +53,7 @@ import de.danoeh.antennapod.core.glide.FastBlurTransformation; import de.danoeh.antennapod.core.service.download.DownloadService; import de.danoeh.antennapod.core.storage.DBReader; import de.danoeh.antennapod.core.storage.DBTasks; +import de.danoeh.antennapod.core.storage.DBWriter; import de.danoeh.antennapod.core.storage.DownloadRequestException; import de.danoeh.antennapod.core.storage.DownloadRequester; import de.danoeh.antennapod.core.util.FeedItemPermutors; @@ -61,6 +62,7 @@ import de.danoeh.antennapod.core.util.Optional; import de.danoeh.antennapod.core.util.ThemeUtils; import de.danoeh.antennapod.core.util.gui.MoreContentListFooterUtil; import de.danoeh.antennapod.dialog.EpisodesApplyActionFragment; +import de.danoeh.antennapod.dialog.FilterDialog; import de.danoeh.antennapod.dialog.RenameFeedDialog; import de.danoeh.antennapod.menuhandler.FeedItemMenuHandler; import de.danoeh.antennapod.menuhandler.FeedMenuHandler; @@ -78,6 +80,7 @@ import org.greenrobot.eventbus.Subscribe; import org.greenrobot.eventbus.ThreadMode; import java.util.List; +import java.util.Set; /** * Displays a list of FeedItems. @@ -464,6 +467,17 @@ public class FeedItemlistFragment extends Fragment implements AdapterView.OnItem } txtvInformation.setText("{fa-info-circle} " + this.getString(R.string.filtered_label)); Iconify.addIcons(txtvInformation); + txtvInformation.setOnClickListener((l) -> { + FilterDialog filterDialog = new FilterDialog(requireContext(), feed.getItemFilter()) { + @Override + protected void updateFilter(Set filterValues) { + feed.setItemFilter(filterValues.toArray(new String[0])); + DBWriter.setFeedItemsFilter(feed.getId(), filterValues); + } + }; + + filterDialog.openDialog(); + }); txtvInformation.setVisibility(View.VISIBLE); } else { txtvInformation.setVisibility(View.GONE);