summaryrefslogtreecommitdiff
path: root/ui/statistics/src
diff options
context:
space:
mode:
Diffstat (limited to 'ui/statistics/src')
-rw-r--r--ui/statistics/src/main/java/de/danoeh/antennapod/ui/statistics/PieChartView.java8
-rw-r--r--ui/statistics/src/main/java/de/danoeh/antennapod/ui/statistics/StatisticsFragment.java11
-rw-r--r--ui/statistics/src/main/java/de/danoeh/antennapod/ui/statistics/StatisticsListAdapter.java3
-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.java2
-rw-r--r--ui/statistics/src/main/java/de/danoeh/antennapod/ui/statistics/feed/FeedStatisticsFragment.java98
-rw-r--r--ui/statistics/src/main/java/de/danoeh/antennapod/ui/statistics/subscriptions/PlaybackStatisticsListAdapter.java4
-rw-r--r--ui/statistics/src/main/java/de/danoeh/antennapod/ui/statistics/subscriptions/SubscriptionStatisticsFragment.java2
-rw-r--r--ui/statistics/src/main/java/de/danoeh/antennapod/ui/statistics/years/BarChartView.java14
-rw-r--r--ui/statistics/src/main/java/de/danoeh/antennapod/ui/statistics/years/YearStatisticsListAdapter.java32
-rw-r--r--ui/statistics/src/main/java/de/danoeh/antennapod/ui/statistics/years/YearsStatisticsFragment.java2
-rw-r--r--ui/statistics/src/main/res/layout/feed_statistics.xml41
-rw-r--r--ui/statistics/src/main/res/menu/statistics.xml9
13 files changed, 179 insertions, 49 deletions
diff --git a/ui/statistics/src/main/java/de/danoeh/antennapod/ui/statistics/PieChartView.java b/ui/statistics/src/main/java/de/danoeh/antennapod/ui/statistics/PieChartView.java
index f3e6f0259..96f8577d2 100644
--- a/ui/statistics/src/main/java/de/danoeh/antennapod/ui/statistics/PieChartView.java
+++ b/ui/statistics/src/main/java/de/danoeh/antennapod/ui/statistics/PieChartView.java
@@ -11,23 +11,23 @@ import android.graphics.RectF;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
import androidx.appcompat.widget.AppCompatImageView;
-import io.reactivex.annotations.Nullable;
public class PieChartView extends AppCompatImageView {
private PieChartDrawable drawable;
- public PieChartView(Context context) {
+ public PieChartView(@NonNull Context context) {
super(context);
setup();
}
- public PieChartView(Context context, @Nullable AttributeSet attrs) {
+ public PieChartView(@NonNull Context context, @Nullable AttributeSet attrs) {
super(context, attrs);
setup();
}
- public PieChartView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
+ public PieChartView(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
setup();
}
diff --git a/ui/statistics/src/main/java/de/danoeh/antennapod/ui/statistics/StatisticsFragment.java b/ui/statistics/src/main/java/de/danoeh/antennapod/ui/statistics/StatisticsFragment.java
index 6dfdc4e8a..74a0eaa5f 100644
--- a/ui/statistics/src/main/java/de/danoeh/antennapod/ui/statistics/StatisticsFragment.java
+++ b/ui/statistics/src/main/java/de/danoeh/antennapod/ui/statistics/StatisticsFragment.java
@@ -2,6 +2,7 @@ package de.danoeh.antennapod.ui.statistics;
import android.content.Context;
import android.content.DialogInterface;
+import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.MenuItem;
@@ -17,10 +18,11 @@ import androidx.viewpager2.widget.ViewPager2;
import com.google.android.material.tabs.TabLayout;
import com.google.android.material.tabs.TabLayoutMediator;
-import de.danoeh.antennapod.core.dialog.ConfirmationDialog;
-import de.danoeh.antennapod.core.storage.DBWriter;
+import de.danoeh.antennapod.ui.common.ConfirmationDialog;
+import de.danoeh.antennapod.storage.database.DBWriter;
import de.danoeh.antennapod.event.StatisticsEvent;
import de.danoeh.antennapod.ui.common.PagedToolbarFragment;
+import de.danoeh.antennapod.ui.echo.EchoActivity;
import de.danoeh.antennapod.ui.statistics.downloads.DownloadStatisticsFragment;
import de.danoeh.antennapod.ui.statistics.subscriptions.SubscriptionStatisticsFragment;
import de.danoeh.antennapod.ui.statistics.years.YearsStatisticsFragment;
@@ -61,6 +63,9 @@ public class StatisticsFragment extends PagedToolbarFragment {
toolbar = rootView.findViewById(R.id.toolbar);
toolbar.setTitle(getString(R.string.statistics_label));
toolbar.inflateMenu(R.menu.statistics);
+ if (BuildConfig.DEBUG) {
+ toolbar.getMenu().findItem(R.id.debug_echo).setVisible(true);
+ }
toolbar.setNavigationOnClickListener(v -> getParentFragmentManager().popBackStack());
viewPager.setAdapter(new StatisticsPagerAdapter(this));
// Give the TabLayout the ViewPager
@@ -89,6 +94,8 @@ public class StatisticsFragment extends PagedToolbarFragment {
if (item.getItemId() == R.id.statistics_reset) {
confirmResetStatistics();
return true;
+ } else if (item.getItemId() == R.id.debug_echo) {
+ startActivity(new Intent(getContext(), EchoActivity.class));
}
return super.onOptionsItemSelected(item);
}
diff --git a/ui/statistics/src/main/java/de/danoeh/antennapod/ui/statistics/StatisticsListAdapter.java b/ui/statistics/src/main/java/de/danoeh/antennapod/ui/statistics/StatisticsListAdapter.java
index cae58a38f..1f35c5c9d 100644
--- a/ui/statistics/src/main/java/de/danoeh/antennapod/ui/statistics/StatisticsListAdapter.java
+++ b/ui/statistics/src/main/java/de/danoeh/antennapod/ui/statistics/StatisticsListAdapter.java
@@ -12,8 +12,7 @@ import android.widget.TextView;
import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;
-import de.danoeh.antennapod.core.storage.StatisticsItem;
-
+import de.danoeh.antennapod.storage.database.StatisticsItem;
import java.util.List;
/**
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 f1f6a0785..7a845d6e6 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
@@ -14,7 +14,7 @@ import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
-import de.danoeh.antennapod.core.storage.DBReader;
+import de.danoeh.antennapod.storage.database.DBReader;
import de.danoeh.antennapod.ui.statistics.R;
import io.reactivex.Observable;
import io.reactivex.android.schedulers.AndroidSchedulers;
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 083a87514..8f1d51cf2 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
@@ -3,7 +3,7 @@ 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.storage.database.StatisticsItem;
import de.danoeh.antennapod.ui.statistics.PieChartView;
import de.danoeh.antennapod.ui.statistics.R;
import de.danoeh.antennapod.ui.statistics.StatisticsListAdapter;
diff --git a/ui/statistics/src/main/java/de/danoeh/antennapod/ui/statistics/feed/FeedStatisticsFragment.java b/ui/statistics/src/main/java/de/danoeh/antennapod/ui/statistics/feed/FeedStatisticsFragment.java
index 1aeeb8fa9..aacd1294d 100644
--- a/ui/statistics/src/main/java/de/danoeh/antennapod/ui/statistics/feed/FeedStatisticsFragment.java
+++ b/ui/statistics/src/main/java/de/danoeh/antennapod/ui/statistics/feed/FeedStatisticsFragment.java
@@ -2,22 +2,33 @@ package de.danoeh.antennapod.ui.statistics.feed;
import android.os.Bundle;
import android.text.format.Formatter;
+import android.util.Pair;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
-import de.danoeh.antennapod.core.storage.DBReader;
-import de.danoeh.antennapod.core.storage.StatisticsItem;
-import de.danoeh.antennapod.core.util.Converter;
+import de.danoeh.antennapod.storage.database.DBReader;
+import de.danoeh.antennapod.storage.database.StatisticsItem;
+import de.danoeh.antennapod.ui.common.Converter;
+import de.danoeh.antennapod.ui.common.DateFormatter;
+import de.danoeh.antennapod.storage.database.ReleaseScheduleGuesser;
+import de.danoeh.antennapod.model.feed.FeedItem;
+import de.danoeh.antennapod.model.feed.FeedItemFilter;
+import de.danoeh.antennapod.model.feed.SortOrder;
+import de.danoeh.antennapod.ui.statistics.R;
import de.danoeh.antennapod.ui.statistics.databinding.FeedStatisticsBinding;
import io.reactivex.Observable;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.disposables.Disposable;
import io.reactivex.schedulers.Schedulers;
+import java.util.ArrayList;
+import java.util.Calendar;
import java.util.Collections;
+import java.util.Date;
+import java.util.List;
import java.util.Locale;
public class FeedStatisticsFragment extends Fragment {
@@ -66,7 +77,17 @@ public class FeedStatisticsFragment extends Fragment {
for (StatisticsItem statisticsItem : statisticsData.feedTime) {
if (statisticsItem.feed.getId() == feedId) {
- return statisticsItem;
+ List<FeedItem> items = DBReader.getFeedItemList(statisticsItem.feed,
+ FeedItemFilter.unfiltered(), SortOrder.DATE_OLD_NEW);
+ List<Date> dates = new ArrayList<>();
+ for (FeedItem item : items) {
+ dates.add(item.getPubDate());
+ }
+ ReleaseScheduleGuesser.Guess guess = null;
+ if (dates.size() > 1) {
+ guess = ReleaseScheduleGuesser.performGuess(dates);
+ }
+ return new Pair<>(statisticsItem, guess);
}
}
return null;
@@ -76,13 +97,80 @@ public class FeedStatisticsFragment extends Fragment {
.subscribe(this::showStats, Throwable::printStackTrace);
}
- private void showStats(StatisticsItem s) {
+ private String getReadableDay(int day) {
+ switch (day) {
+ case Calendar.MONDAY:
+ return getString(R.string.release_schedule_monday);
+ case Calendar.TUESDAY:
+ return getString(R.string.release_schedule_tuesday);
+ case Calendar.WEDNESDAY:
+ return getString(R.string.release_schedule_wednesday);
+ case Calendar.THURSDAY:
+ return getString(R.string.release_schedule_thursday);
+ case Calendar.FRIDAY:
+ return getString(R.string.release_schedule_friday);
+ case Calendar.SATURDAY:
+ return getString(R.string.release_schedule_saturday);
+ case Calendar.SUNDAY:
+ return getString(R.string.release_schedule_sunday);
+ default:
+ return "error";
+ }
+ }
+
+ private String getReadableSchedule(ReleaseScheduleGuesser.Guess guess) {
+ switch (guess.schedule) {
+ case DAILY:
+ return getString(R.string.release_schedule_daily);
+ case WEEKDAYS:
+ return getString(R.string.release_schedule_weekdays);
+ case WEEKLY:
+ return getString(R.string.release_schedule_weekly) + ", " + getReadableDay(guess.days.get(0));
+ case BIWEEKLY:
+ return getString(R.string.release_schedule_biweekly) + ", " + getReadableDay(guess.days.get(0));
+ case MONTHLY:
+ return getString(R.string.release_schedule_monthly);
+ case FOURWEEKLY:
+ return getString(R.string.release_schedule_monthly) + ", " + getReadableDay(guess.days.get(0));
+ case SPECIFIC_DAYS:
+ StringBuilder days = new StringBuilder();
+ for (int i = 0; i < guess.days.size(); i++) {
+ if (i != 0) {
+ days.append(", ");
+ }
+ days.append(getReadableDay(guess.days.get(i)));
+ }
+ return days.toString();
+ default:
+ return getString(R.string.statistics_expected_next_episode_unknown);
+ }
+ }
+
+ private void showStats(Pair<StatisticsItem, ReleaseScheduleGuesser.Guess> p) {
+ StatisticsItem s = p.first;
viewBinding.startedTotalLabel.setText(String.format(Locale.getDefault(), "%d / %d",
s.episodesStarted, s.episodes));
viewBinding.timePlayedLabel.setText(Converter.shortLocalizedDuration(getContext(), s.timePlayed));
viewBinding.totalDurationLabel.setText(Converter.shortLocalizedDuration(getContext(), s.time));
viewBinding.onDeviceLabel.setText(String.format(Locale.getDefault(), "%d", s.episodesDownloadCount));
viewBinding.spaceUsedLabel.setText(Formatter.formatShortFileSize(getContext(), s.totalDownloadSize));
+
+ ReleaseScheduleGuesser.Guess guess = p.second;
+ if (!s.feed.getPreferences().getKeepUpdated()) {
+ viewBinding.expectedNextEpisodeLabel.setText(R.string.updates_disabled_label);
+ } else if (guess == null || guess.nextExpectedDate.getTime() <= new Date().getTime() - 7 * 24 * 3600000L) {
+ // More than 30 days delayed
+ viewBinding.expectedNextEpisodeLabel.setText(R.string.statistics_expected_next_episode_unknown);
+ } else {
+ String text = DateFormatter.formatAbbrev(getContext(), guess.nextExpectedDate);
+ if (guess.nextExpectedDate.getTime() <= new Date().getTime()) {
+ text = getString(R.string.statistics_expected_next_episode_any_day);
+ }
+ if (guess.schedule != ReleaseScheduleGuesser.Schedule.UNKNOWN) {
+ text += " (" + getReadableSchedule(guess) + ")";
+ }
+ viewBinding.expectedNextEpisodeLabel.setText(text);
+ }
}
@Override
diff --git a/ui/statistics/src/main/java/de/danoeh/antennapod/ui/statistics/subscriptions/PlaybackStatisticsListAdapter.java b/ui/statistics/src/main/java/de/danoeh/antennapod/ui/statistics/subscriptions/PlaybackStatisticsListAdapter.java
index 9b1f234c8..c597e18bb 100644
--- a/ui/statistics/src/main/java/de/danoeh/antennapod/ui/statistics/subscriptions/PlaybackStatisticsListAdapter.java
+++ b/ui/statistics/src/main/java/de/danoeh/antennapod/ui/statistics/subscriptions/PlaybackStatisticsListAdapter.java
@@ -2,8 +2,8 @@ package de.danoeh.antennapod.ui.statistics.subscriptions;
import android.text.format.DateFormat;
import androidx.fragment.app.Fragment;
-import de.danoeh.antennapod.core.storage.StatisticsItem;
-import de.danoeh.antennapod.core.util.Converter;
+import de.danoeh.antennapod.storage.database.StatisticsItem;
+import de.danoeh.antennapod.ui.common.Converter;
import de.danoeh.antennapod.ui.statistics.PieChartView;
import de.danoeh.antennapod.ui.statistics.R;
import de.danoeh.antennapod.ui.statistics.StatisticsListAdapter;
diff --git a/ui/statistics/src/main/java/de/danoeh/antennapod/ui/statistics/subscriptions/SubscriptionStatisticsFragment.java b/ui/statistics/src/main/java/de/danoeh/antennapod/ui/statistics/subscriptions/SubscriptionStatisticsFragment.java
index c7eddd222..fca8b903f 100644
--- a/ui/statistics/src/main/java/de/danoeh/antennapod/ui/statistics/subscriptions/SubscriptionStatisticsFragment.java
+++ b/ui/statistics/src/main/java/de/danoeh/antennapod/ui/statistics/subscriptions/SubscriptionStatisticsFragment.java
@@ -15,8 +15,8 @@ import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
-import de.danoeh.antennapod.core.storage.DBReader;
import de.danoeh.antennapod.event.StatisticsEvent;
+import de.danoeh.antennapod.storage.database.DBReader;
import de.danoeh.antennapod.ui.statistics.R;
import de.danoeh.antennapod.ui.statistics.StatisticsFragment;
import io.reactivex.Observable;
diff --git a/ui/statistics/src/main/java/de/danoeh/antennapod/ui/statistics/years/BarChartView.java b/ui/statistics/src/main/java/de/danoeh/antennapod/ui/statistics/years/BarChartView.java
index eadbb29ee..510bcb8e1 100644
--- a/ui/statistics/src/main/java/de/danoeh/antennapod/ui/statistics/years/BarChartView.java
+++ b/ui/statistics/src/main/java/de/danoeh/antennapod/ui/statistics/years/BarChartView.java
@@ -12,7 +12,7 @@ import android.util.AttributeSet;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.widget.AppCompatImageView;
-import de.danoeh.antennapod.core.storage.DBReader;
+import de.danoeh.antennapod.storage.database.DBReader;
import de.danoeh.antennapod.ui.common.ThemeUtils;
import de.danoeh.antennapod.ui.statistics.R;
@@ -49,7 +49,7 @@ public class BarChartView extends AppCompatImageView {
drawable.data = data;
drawable.maxValue = 1;
for (DBReader.MonthlyStatisticsItem item : data) {
- drawable.maxValue = Math.max(drawable.maxValue, item.timePlayed);
+ drawable.maxValue = Math.max(drawable.maxValue, item.getTimePlayed());
}
}
@@ -89,21 +89,21 @@ public class BarChartView extends AppCompatImageView {
paintBars.setStrokeWidth(height * 0.015f);
paintBars.setColor(colors[0]);
int colorIndex = 0;
- int lastYear = data.size() > 0 ? data.get(0).year : 0;
+ int lastYear = data.size() > 0 ? data.get(0).getYear() : 0;
for (int i = 0; i < data.size(); i++) {
float x = textPadding + (i + 1) * stepSize;
- if (lastYear != data.get(i).year) {
- lastYear = data.get(i).year;
+ if (lastYear != data.get(i).getYear()) {
+ lastYear = data.get(i).getYear();
colorIndex++;
paintBars.setColor(colors[colorIndex % 2]);
if (i < data.size() - 2) {
- canvas.drawText(String.valueOf(data.get(i).year), x + stepSize,
+ canvas.drawText(String.valueOf(data.get(i).getYear()), x + stepSize,
barHeight + (height - barHeight + textSize) / 2, paintGridText);
}
canvas.drawLine(x, height, x, barHeight, paintGridText);
}
- float valuePercentage = (float) Math.max(0.005, (float) data.get(i).timePlayed / maxValue);
+ float valuePercentage = (float) Math.max(0.005, (float) data.get(i).getTimePlayed() / maxValue);
float y = (1 - valuePercentage) * barHeight;
canvas.drawRect(x, y, x + stepSize * 0.95f, barHeight, paintBars);
}
diff --git a/ui/statistics/src/main/java/de/danoeh/antennapod/ui/statistics/years/YearStatisticsListAdapter.java b/ui/statistics/src/main/java/de/danoeh/antennapod/ui/statistics/years/YearStatisticsListAdapter.java
index 2116a17a4..5dd4434c4 100644
--- a/ui/statistics/src/main/java/de/danoeh/antennapod/ui/statistics/years/YearStatisticsListAdapter.java
+++ b/ui/statistics/src/main/java/de/danoeh/antennapod/ui/statistics/years/YearStatisticsListAdapter.java
@@ -7,7 +7,7 @@ import android.view.ViewGroup;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
-import de.danoeh.antennapod.core.storage.DBReader;
+import de.danoeh.antennapod.storage.database.DBReader;
import de.danoeh.antennapod.ui.statistics.R;
import java.util.ArrayList;
@@ -57,41 +57,41 @@ public class YearStatisticsListAdapter extends RecyclerView.Adapter<RecyclerView
} else {
StatisticsHolder holder = (StatisticsHolder) h;
DBReader.MonthlyStatisticsItem statsItem = yearlyAggregate.get(position - 1);
- holder.year.setText(String.format(Locale.getDefault(), "%d ", statsItem.year));
- holder.hours.setText(String.format(Locale.getDefault(), "%.1f ", statsItem.timePlayed / 3600000.0f)
+ holder.year.setText(String.format(Locale.getDefault(), "%d ", statsItem.getYear()));
+ holder.hours.setText(String.format(Locale.getDefault(), "%.1f ", statsItem.getTimePlayed() / 3600000.0f)
+ context.getString(R.string.time_hours));
}
}
public void update(List<DBReader.MonthlyStatisticsItem> statistics) {
- int lastYear = statistics.size() > 0 ? statistics.get(0).year : 0;
- int lastDataPoint = statistics.size() > 0 ? (statistics.get(0).month - 1) + lastYear * 12 : 0;
+ int lastYear = statistics.size() > 0 ? statistics.get(0).getYear() : 0;
+ int lastDataPoint = statistics.size() > 0 ? (statistics.get(0).getMonth() - 1) + lastYear * 12 : 0;
long yearSum = 0;
yearlyAggregate.clear();
statisticsData.clear();
for (DBReader.MonthlyStatisticsItem statistic : statistics) {
- if (statistic.year != lastYear) {
+ if (statistic.getYear() != lastYear) {
DBReader.MonthlyStatisticsItem yearAggregate = new DBReader.MonthlyStatisticsItem();
- yearAggregate.year = lastYear;
- yearAggregate.timePlayed = yearSum;
+ yearAggregate.setYear(lastYear);
+ yearAggregate.setTimePlayed(yearSum);
yearlyAggregate.add(yearAggregate);
yearSum = 0;
- lastYear = statistic.year;
+ lastYear = statistic.getYear();
}
- yearSum += statistic.timePlayed;
- while (lastDataPoint + 1 < (statistic.month - 1) + statistic.year * 12) {
+ yearSum += statistic.getTimePlayed();
+ while (lastDataPoint + 1 < (statistic.getMonth() - 1) + statistic.getYear() * 12) {
lastDataPoint++;
DBReader.MonthlyStatisticsItem item = new DBReader.MonthlyStatisticsItem();
- item.year = lastDataPoint / 12;
- item.month = lastDataPoint % 12 + 1;
+ item.setYear(lastDataPoint / 12);
+ item.setMonth(lastDataPoint % 12 + 1);
statisticsData.add(item); // Compensate for months without playback
}
statisticsData.add(statistic);
- lastDataPoint = (statistic.month - 1) + statistic.year * 12;
+ lastDataPoint = (statistic.getMonth() - 1) + statistic.getYear() * 12;
}
DBReader.MonthlyStatisticsItem yearAggregate = new DBReader.MonthlyStatisticsItem();
- yearAggregate.year = lastYear;
- yearAggregate.timePlayed = yearSum;
+ yearAggregate.setYear(lastYear);
+ yearAggregate.setTimePlayed(yearSum);
yearlyAggregate.add(yearAggregate);
Collections.reverse(yearlyAggregate);
notifyDataSetChanged();
diff --git a/ui/statistics/src/main/java/de/danoeh/antennapod/ui/statistics/years/YearsStatisticsFragment.java b/ui/statistics/src/main/java/de/danoeh/antennapod/ui/statistics/years/YearsStatisticsFragment.java
index 5368e52a9..296bc14fd 100644
--- a/ui/statistics/src/main/java/de/danoeh/antennapod/ui/statistics/years/YearsStatisticsFragment.java
+++ b/ui/statistics/src/main/java/de/danoeh/antennapod/ui/statistics/years/YearsStatisticsFragment.java
@@ -12,8 +12,8 @@ import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
-import de.danoeh.antennapod.core.storage.DBReader;
import de.danoeh.antennapod.event.StatisticsEvent;
+import de.danoeh.antennapod.storage.database.DBReader;
import de.danoeh.antennapod.ui.statistics.R;
import io.reactivex.Observable;
import io.reactivex.android.schedulers.AndroidSchedulers;
diff --git a/ui/statistics/src/main/res/layout/feed_statistics.xml b/ui/statistics/src/main/res/layout/feed_statistics.xml
index 6b9a7fa4c..02afb0161 100644
--- a/ui/statistics/src/main/res/layout/feed_statistics.xml
+++ b/ui/statistics/src/main/res/layout/feed_statistics.xml
@@ -11,12 +11,14 @@
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
+ android:layout_weight="1"
android:text="@string/statistics_episodes_started_total" />
- <com.joanzapata.iconify.widget.IconTextView
+ <TextView
android:id="@+id/startedTotalLabel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
+ android:layout_weight="1"
android:layout_marginLeft="8dp"
android:layout_marginStart="8dp"
android:text="@string/wait_icon"
@@ -29,12 +31,14 @@
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
+ android:layout_weight="1"
android:text="@string/statistics_time_played" />
- <com.joanzapata.iconify.widget.IconTextView
+ <TextView
android:id="@+id/timePlayedLabel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
+ android:layout_weight="1"
android:layout_marginLeft="8dp"
android:layout_marginStart="8dp"
android:text="@string/wait_icon"
@@ -48,12 +52,14 @@
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
+ android:layout_weight="1"
android:text="@string/statistics_total_duration" />
- <com.joanzapata.iconify.widget.IconTextView
+ <TextView
android:id="@+id/totalDurationLabel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
+ android:layout_weight="1"
android:layout_marginLeft="8dp"
android:layout_marginStart="8dp"
android:text="@string/wait_icon"
@@ -66,12 +72,14 @@
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
+ android:layout_weight="1"
android:text="@string/statistics_episodes_on_device" />
- <com.joanzapata.iconify.widget.IconTextView
+ <TextView
android:id="@+id/onDeviceLabel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
+ android:layout_weight="1"
android:layout_marginLeft="8dp"
android:layout_marginStart="8dp"
android:text="@string/wait_icon"
@@ -84,12 +92,14 @@
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
+ android:layout_weight="1"
android:text="@string/statistics_space_used" />
- <com.joanzapata.iconify.widget.IconTextView
+ <TextView
android:id="@+id/spaceUsedLabel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
+ android:layout_weight="1"
android:layout_marginLeft="8dp"
android:layout_marginStart="8dp"
android:text="@string/wait_icon"
@@ -97,4 +107,25 @@
</TableRow>
+ <TableRow>
+
+ <TextView
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:text="@string/statistics_expected_next_episode" />
+
+ <TextView
+ android:id="@+id/expectedNextEpisodeLabel"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:layout_marginLeft="8dp"
+ android:layout_marginStart="8dp"
+ android:lines="2"
+ android:text="@string/wait_icon"
+ tools:text="Jan 1st (weekly)" />
+
+ </TableRow>
+
</TableLayout>
diff --git a/ui/statistics/src/main/res/menu/statistics.xml b/ui/statistics/src/main/res/menu/statistics.xml
index 4610a7726..9720e6880 100644
--- a/ui/statistics/src/main/res/menu/statistics.xml
+++ b/ui/statistics/src/main/res/menu/statistics.xml
@@ -11,7 +11,12 @@
android:id="@+id/statistics_filter"
android:icon="@drawable/ic_filter"
android:title="@string/filter"
- custom:showAsAction="ifRoom">
- </item>
+ custom:showAsAction="ifRoom" />
+
+ <item
+ android:id="@+id/debug_echo"
+ android:title="@string/debug_echo"
+ custom:showAsAction="never"
+ android:visible="false" />
</menu>