diff options
-rw-r--r-- | ui/i18n/src/main/res/values/strings.xml | 5 | ||||
-rw-r--r-- | ui/statistics/src/main/java/de/danoeh/antennapod/ui/statistics/downloads/DownloadStatisticsListAdapter.java | 6 |
2 files changed, 9 insertions, 2 deletions
diff --git a/ui/i18n/src/main/res/values/strings.xml b/ui/i18n/src/main/res/values/strings.xml index 42cab5f25..70628a198 100644 --- a/ui/i18n/src/main/res/values/strings.xml +++ b/ui/i18n/src/main/res/values/strings.xml @@ -77,7 +77,10 @@ <string name="section_shown">Shown</string> <!-- Download Statistics fragment --> - <string name="total_size_downloaded_podcasts">Total size of episodes on the device</string> + <plurals name="total_size_downloaded_podcasts"> + <item quantity="one">Total size of %d episode on the device</item> + <item quantity="other">Total size of %d episodes on the device</item> + </plurals> <!-- Main activity --> <string name="drawer_open">Open menu</string> 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 2af3f0bf7..4ab6f3a13 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 @@ -16,6 +16,7 @@ import java.util.List; */ public class DownloadStatisticsListAdapter extends StatisticsListAdapter { private final Fragment fragment; + private int cacheEpisodes; public DownloadStatisticsListAdapter(Context context, Fragment fragment) { super(context); @@ -24,7 +25,8 @@ public class DownloadStatisticsListAdapter extends StatisticsListAdapter { @Override protected String getHeaderCaption() { - return context.getString(R.string.total_size_downloaded_podcasts); + return context.getResources().getQuantityString( + R.plurals.total_size_downloaded_podcasts, cacheEpisodes, cacheEpisodes); } @Override @@ -35,9 +37,11 @@ public class DownloadStatisticsListAdapter extends StatisticsListAdapter { @Override protected PieChartView.PieChartData generateChartData(List<StatisticsItem> statisticsData) { float[] dataValues = new float[statisticsData.size()]; + cacheEpisodes = 0; for (int i = 0; i < statisticsData.size(); i++) { StatisticsItem item = statisticsData.get(i); dataValues[i] = item.totalDownloadSize; + cacheEpisodes += item.episodesDownloadCount; } return new PieChartView.PieChartData(dataValues); } |