summaryrefslogtreecommitdiff
path: root/ui/statistics
diff options
context:
space:
mode:
authorByteHamster <info@bytehamster.com>2022-07-30 16:53:22 +0200
committerByteHamster <info@bytehamster.com>2022-07-30 16:53:22 +0200
commit87d0055cf746febe4c98214980c91fac4ab4cd59 (patch)
tree9ea506bac9785a87a40ef4d90dc864a841020340 /ui/statistics
parent4f2ba0b58eadcda69693025319e96cfee79b2ce7 (diff)
downloadAntennaPod-87d0055cf746febe4c98214980c91fac4ab4cd59.zip
Show details dialog on download stats page as well
Diffstat (limited to 'ui/statistics')
-rw-r--r--ui/statistics/src/main/java/de/danoeh/antennapod/ui/statistics/downloads/DownloadStatisticsFragment.java2
-rw-r--r--ui/statistics/src/main/java/de/danoeh/antennapod/ui/statistics/downloads/DownloadStatisticsListAdapter.java12
2 files changed, 12 insertions, 2 deletions
diff --git a/ui/statistics/src/main/java/de/danoeh/antennapod/ui/statistics/downloads/DownloadStatisticsFragment.java b/ui/statistics/src/main/java/de/danoeh/antennapod/ui/statistics/downloads/DownloadStatisticsFragment.java
index 295094beb..f1f6a0785 100644
--- a/ui/statistics/src/main/java/de/danoeh/antennapod/ui/statistics/downloads/DownloadStatisticsFragment.java
+++ b/ui/statistics/src/main/java/de/danoeh/antennapod/ui/statistics/downloads/DownloadStatisticsFragment.java
@@ -41,7 +41,7 @@ public class DownloadStatisticsFragment extends Fragment {
View root = inflater.inflate(R.layout.statistics_fragment, container, false);
downloadStatisticsList = root.findViewById(R.id.statistics_list);
progressBar = root.findViewById(R.id.progressBar);
- listAdapter = new DownloadStatisticsListAdapter(getContext());
+ listAdapter = new DownloadStatisticsListAdapter(getContext(), this);
downloadStatisticsList.setLayoutManager(new LinearLayoutManager(getContext()));
downloadStatisticsList.setAdapter(listAdapter);
return root;
diff --git a/ui/statistics/src/main/java/de/danoeh/antennapod/ui/statistics/downloads/DownloadStatisticsListAdapter.java b/ui/statistics/src/main/java/de/danoeh/antennapod/ui/statistics/downloads/DownloadStatisticsListAdapter.java
index edd3e322f..4839aa891 100644
--- a/ui/statistics/src/main/java/de/danoeh/antennapod/ui/statistics/downloads/DownloadStatisticsListAdapter.java
+++ b/ui/statistics/src/main/java/de/danoeh/antennapod/ui/statistics/downloads/DownloadStatisticsListAdapter.java
@@ -2,10 +2,12 @@ package de.danoeh.antennapod.ui.statistics.downloads;
import android.content.Context;
import android.text.format.Formatter;
+import androidx.fragment.app.Fragment;
import de.danoeh.antennapod.core.storage.StatisticsItem;
import de.danoeh.antennapod.ui.statistics.PieChartView;
import de.danoeh.antennapod.ui.statistics.R;
import de.danoeh.antennapod.ui.statistics.StatisticsListAdapter;
+import de.danoeh.antennapod.ui.statistics.feed.FeedStatisticsDialogFragment;
import java.util.List;
import java.util.Locale;
@@ -14,9 +16,11 @@ import java.util.Locale;
* Adapter for the download statistics list.
*/
public class DownloadStatisticsListAdapter extends StatisticsListAdapter {
+ private final Fragment fragment;
- public DownloadStatisticsListAdapter(Context context) {
+ public DownloadStatisticsListAdapter(Context context, Fragment fragment) {
super(context);
+ this.fragment = fragment;
}
@Override
@@ -45,6 +49,12 @@ public class DownloadStatisticsListAdapter extends StatisticsListAdapter {
+ " • "
+ String.format(Locale.getDefault(), "%d%s",
item.episodesDownloadCount, context.getString(R.string.episodes_suffix)));
+
+ holder.itemView.setOnClickListener(v -> {
+ FeedStatisticsDialogFragment yourDialogFragment = FeedStatisticsDialogFragment.newInstance(
+ item.feed.getId(), item.feed.getTitle());
+ yourDialogFragment.show(fragment.getChildFragmentManager().beginTransaction(), "DialogFragment");
+ });
}
}