Interval statistics: show accumulate in distance column.
@@ -21,6 +21,7 @@ import de.dennisguse.opentracks.viewmodels.IntervalStatistics;
public class IntervalStatisticsAdapter extends ArrayAdapter<IntervalStatistics.Interval> {
private boolean metricUnits;
+ private float accDistance = 0f;
public IntervalStatisticsAdapter(Context context, List<IntervalStatistics.Interval> intervalList) {
super(context, R.layout.interval_stats_list_item, intervalList);
@@ -47,7 +48,8 @@ public class IntervalStatisticsAdapter extends ArrayAdapter<IntervalStatistics.I
viewHolder = (ViewHolder) intervalView.getTag();
}
- viewHolder.distance.setText(StringUtils.formatDistance(getContext(), interval.getDistance(), metricUnits));
+ accDistance += interval.getDistance();
+ viewHolder.distance.setText(StringUtils.formatDistance(getContext(), accDistance, metricUnits));
Pair<String, String> speedParts = StringUtils.getSpeedParts(getContext(), interval.getSpeed(), metricUnits, true);
viewHolder.speed.setText(speedParts.first + " " + speedParts.second);
viewHolder.pace.setText(StringUtils.getSpeedParts(getContext(), interval.getSpeed(), metricUnits, false).first);
