use of de.danoeh.antennapod.core.storage.StatisticsItem in project AntennaPod by AntennaPod.
the class DownloadStatisticsListAdapter method generateChartData.
@Override
PieChartView.PieChartData generateChartData(List<StatisticsItem> statisticsData) {
float[] dataValues = new float[statisticsData.size()];
for (int i = 0; i < statisticsData.size(); i++) {
StatisticsItem item = statisticsData.get(i);
dataValues[i] = item.totalDownloadSize;
}
return new PieChartView.PieChartData(dataValues);
}
use of de.danoeh.antennapod.core.storage.StatisticsItem in project AntennaPod by AntennaPod.
the class PlaybackStatisticsListAdapter method generateChartData.
@Override
PieChartView.PieChartData generateChartData(List<StatisticsItem> statisticsData) {
float[] dataValues = new float[statisticsData.size()];
for (int i = 0; i < statisticsData.size(); i++) {
StatisticsItem item = statisticsData.get(i);
dataValues[i] = countAll ? item.timePlayedCountAll : item.timePlayed;
}
return new PieChartView.PieChartData(dataValues);
}
use of de.danoeh.antennapod.core.storage.StatisticsItem in project AntennaPod by AntennaPod.
the class StatisticsListAdapter method onBindViewHolder.
@Override
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder h, int position) {
if (getItemViewType(position) == TYPE_HEADER) {
HeaderHolder holder = (HeaderHolder) h;
holder.pieChart.setData(pieChartData);
holder.totalTime.setText(getHeaderValue());
} else {
StatisticsHolder holder = (StatisticsHolder) h;
StatisticsItem statsItem = statisticsData.get(position - 1);
Glide.with(context).load(statsItem.feed.getImageUrl()).apply(new RequestOptions().placeholder(R.color.light_gray).error(R.color.light_gray).diskCacheStrategy(ApGlideSettings.AP_DISK_CACHE_STRATEGY).fitCenter().dontAnimate()).into(holder.image);
holder.title.setText(statsItem.feed.getTitle());
holder.chip.setTextColor(pieChartData.getColorOfItem(position - 1));
onBindFeedViewHolder(holder, statsItem);
}
}
Aggregations