2020-01-09 10:44:32 +01:00
|
|
|
/* Copyright (C) 2017-2020 Carsten Pfeiffer, Daniele Gobbetti
|
2018-06-25 18:35:46 +02:00
|
|
|
|
|
|
|
This file is part of Gadgetbridge.
|
|
|
|
|
|
|
|
Gadgetbridge is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU Affero General Public License as published
|
|
|
|
by the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
Gadgetbridge is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU Affero General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Affero General Public License
|
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
2017-10-19 21:52:38 +02:00
|
|
|
package nodomain.freeyourgadget.gadgetbridge.adapter;
|
|
|
|
|
|
|
|
import android.content.Context;
|
2020-08-24 16:54:05 +02:00
|
|
|
import android.text.format.DateUtils;
|
2020-11-22 22:33:55 +01:00
|
|
|
import android.view.LayoutInflater;
|
2020-11-07 17:31:15 +01:00
|
|
|
import android.view.View;
|
|
|
|
import android.view.ViewGroup;
|
2020-11-22 22:33:55 +01:00
|
|
|
import android.widget.ImageView;
|
|
|
|
import android.widget.TextView;
|
2017-10-19 21:52:38 +02:00
|
|
|
import android.widget.Toast;
|
|
|
|
|
2020-11-22 22:33:55 +01:00
|
|
|
import org.json.JSONException;
|
|
|
|
import org.json.JSONObject;
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
|
|
|
|
import java.text.DecimalFormat;
|
|
|
|
import java.util.ArrayList;
|
2017-10-19 21:52:38 +02:00
|
|
|
import java.util.Date;
|
|
|
|
import java.util.List;
|
2020-08-07 09:21:14 +02:00
|
|
|
import java.util.concurrent.TimeUnit;
|
2017-10-19 21:52:38 +02:00
|
|
|
|
2018-04-07 10:16:36 +02:00
|
|
|
import de.greenrobot.dao.query.QueryBuilder;
|
2017-10-19 21:52:38 +02:00
|
|
|
import nodomain.freeyourgadget.gadgetbridge.GBApplication;
|
2020-08-24 16:54:05 +02:00
|
|
|
import nodomain.freeyourgadget.gadgetbridge.R;
|
2021-01-23 21:42:12 +01:00
|
|
|
import nodomain.freeyourgadget.gadgetbridge.activities.SettingsActivity;
|
2017-10-19 21:52:38 +02:00
|
|
|
import nodomain.freeyourgadget.gadgetbridge.database.DBHandler;
|
2018-04-07 10:16:36 +02:00
|
|
|
import nodomain.freeyourgadget.gadgetbridge.database.DBHelper;
|
2017-10-19 21:52:38 +02:00
|
|
|
import nodomain.freeyourgadget.gadgetbridge.entities.BaseActivitySummary;
|
|
|
|
import nodomain.freeyourgadget.gadgetbridge.entities.BaseActivitySummaryDao;
|
2018-04-07 10:16:36 +02:00
|
|
|
import nodomain.freeyourgadget.gadgetbridge.entities.Device;
|
|
|
|
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
|
2017-10-19 21:52:38 +02:00
|
|
|
import nodomain.freeyourgadget.gadgetbridge.model.ActivityKind;
|
2020-11-22 22:33:55 +01:00
|
|
|
import nodomain.freeyourgadget.gadgetbridge.model.ActivitySummaryJsonSummary;
|
2017-10-19 21:52:38 +02:00
|
|
|
import nodomain.freeyourgadget.gadgetbridge.util.DateTimeUtils;
|
2021-12-28 22:10:06 +01:00
|
|
|
import nodomain.freeyourgadget.gadgetbridge.util.FormatUtils;
|
2017-10-19 21:52:38 +02:00
|
|
|
import nodomain.freeyourgadget.gadgetbridge.util.GB;
|
|
|
|
|
2020-08-31 23:22:17 +02:00
|
|
|
import static nodomain.freeyourgadget.gadgetbridge.activities.ActivitySummariesFilter.ALL_DEVICES;
|
|
|
|
|
2020-10-17 13:37:32 +02:00
|
|
|
public class ActivitySummariesAdapter extends AbstractActivityListingAdapter<BaseActivitySummary> {
|
2020-11-22 22:33:55 +01:00
|
|
|
protected static final Logger LOG = LoggerFactory.getLogger(ActivitySummariesAdapter.class);
|
2018-04-13 20:27:31 +02:00
|
|
|
private final GBDevice device;
|
2020-10-17 13:37:32 +02:00
|
|
|
long dateFromFilter = 0;
|
|
|
|
long dateToFilter = 0;
|
2020-08-31 23:22:17 +02:00
|
|
|
long deviceFilter;
|
2020-08-24 00:09:10 +02:00
|
|
|
String nameContainsFilter;
|
2020-10-17 13:37:32 +02:00
|
|
|
List<Long> itemsFilter;
|
|
|
|
private int activityKindFilter;
|
|
|
|
private int backgroundColor = 0;
|
2018-04-13 20:27:31 +02:00
|
|
|
|
2020-08-31 23:22:17 +02:00
|
|
|
public ActivitySummariesAdapter(Context context, GBDevice device, int activityKindFilter, long dateFromFilter, long dateToFilter, String nameContainsFilter, long deviceFilter, List itemsFilter) {
|
2017-10-19 21:52:38 +02:00
|
|
|
super(context);
|
2018-04-13 20:27:31 +02:00
|
|
|
this.device = device;
|
2020-08-11 21:54:02 +02:00
|
|
|
this.activityKindFilter = activityKindFilter;
|
2020-08-31 23:22:17 +02:00
|
|
|
this.dateFromFilter = dateFromFilter;
|
|
|
|
this.dateToFilter = dateToFilter;
|
|
|
|
this.nameContainsFilter = nameContainsFilter;
|
|
|
|
this.deviceFilter = deviceFilter;
|
|
|
|
this.itemsFilter = itemsFilter;
|
2018-04-13 20:27:31 +02:00
|
|
|
loadItems();
|
2017-10-19 21:52:38 +02:00
|
|
|
}
|
|
|
|
|
2018-04-13 20:27:31 +02:00
|
|
|
@Override
|
|
|
|
public void loadItems() {
|
2017-10-19 21:52:38 +02:00
|
|
|
try (DBHandler handler = GBApplication.acquireDB()) {
|
|
|
|
BaseActivitySummaryDao summaryDao = handler.getDaoSession().getBaseActivitySummaryDao();
|
2018-04-07 10:16:36 +02:00
|
|
|
Device dbDevice = DBHelper.findDevice(device, handler.getDaoSession());
|
|
|
|
|
|
|
|
QueryBuilder<BaseActivitySummary> qb = summaryDao.queryBuilder();
|
2020-08-31 23:22:17 +02:00
|
|
|
|
|
|
|
if (deviceFilter == ALL_DEVICES) {
|
|
|
|
qb.orderDesc(BaseActivitySummaryDao.Properties.StartTime);
|
|
|
|
} else if (deviceFilter != 0) {
|
|
|
|
qb.where(
|
|
|
|
BaseActivitySummaryDao.Properties.DeviceId.eq(
|
|
|
|
deviceFilter)).orderDesc(BaseActivitySummaryDao.Properties.StartTime);
|
|
|
|
} else {
|
|
|
|
qb.where(
|
|
|
|
BaseActivitySummaryDao.Properties.DeviceId.eq(
|
|
|
|
dbDevice.getId())).orderDesc(BaseActivitySummaryDao.Properties.StartTime);
|
|
|
|
}
|
2020-08-18 11:16:36 +02:00
|
|
|
|
2020-10-17 13:37:32 +02:00
|
|
|
if (activityKindFilter != 0) {
|
2020-08-18 11:16:36 +02:00
|
|
|
qb.where(
|
|
|
|
BaseActivitySummaryDao.Properties.ActivityKind.eq(activityKindFilter));
|
|
|
|
}
|
|
|
|
|
2020-10-17 13:37:32 +02:00
|
|
|
if (dateFromFilter != 0) {
|
2020-08-11 21:54:02 +02:00
|
|
|
qb.where(
|
2020-08-18 11:16:36 +02:00
|
|
|
BaseActivitySummaryDao.Properties.StartTime.gt(new Date(dateFromFilter)));
|
|
|
|
}
|
2020-10-17 13:37:32 +02:00
|
|
|
if (dateToFilter != 0) {
|
2020-08-11 21:54:02 +02:00
|
|
|
qb.where(
|
2020-08-18 11:16:36 +02:00
|
|
|
BaseActivitySummaryDao.Properties.EndTime.lt(new Date(dateToFilter)));
|
2020-08-11 21:54:02 +02:00
|
|
|
}
|
2020-10-17 13:37:32 +02:00
|
|
|
if (nameContainsFilter != null && nameContainsFilter.length() > 0) {
|
2020-08-24 00:09:10 +02:00
|
|
|
qb.where(
|
|
|
|
BaseActivitySummaryDao.Properties.Name.like("%" + nameContainsFilter + "%"));
|
|
|
|
}
|
2020-10-17 13:37:32 +02:00
|
|
|
if (itemsFilter != null) {
|
2020-08-31 23:22:17 +02:00
|
|
|
qb.where(
|
|
|
|
BaseActivitySummaryDao.Properties.Id.in(itemsFilter));
|
|
|
|
}
|
2020-11-22 22:33:55 +01:00
|
|
|
|
|
|
|
|
|
|
|
List<BaseActivitySummary> allSummaries = new ArrayList<>();
|
|
|
|
allSummaries.add(new BaseActivitySummary());
|
|
|
|
allSummaries.addAll(qb.build().list());
|
2017-10-19 21:52:38 +02:00
|
|
|
setItems(allSummaries, true);
|
|
|
|
} catch (Exception e) {
|
|
|
|
GB.toast("Error loading activity summaries.", Toast.LENGTH_SHORT, GB.ERROR, e);
|
|
|
|
}
|
|
|
|
}
|
2020-08-11 21:54:02 +02:00
|
|
|
|
2020-10-17 13:37:32 +02:00
|
|
|
public void setActivityKindFilter(int filter) {
|
|
|
|
this.activityKindFilter = filter;
|
2020-08-11 21:54:02 +02:00
|
|
|
}
|
2020-10-17 13:37:32 +02:00
|
|
|
|
|
|
|
public void setDateFromFilter(long date) {
|
|
|
|
this.dateFromFilter = date;
|
2020-08-18 11:16:36 +02:00
|
|
|
}
|
2020-10-17 13:37:32 +02:00
|
|
|
|
|
|
|
public void setDateToFilter(long date) {
|
|
|
|
this.dateToFilter = date;
|
2020-08-18 11:16:36 +02:00
|
|
|
}
|
2020-10-17 13:37:32 +02:00
|
|
|
|
|
|
|
public void setNameContainsFilter(String name) {
|
|
|
|
this.nameContainsFilter = name;
|
2020-08-24 00:09:10 +02:00
|
|
|
}
|
2017-10-19 21:52:38 +02:00
|
|
|
|
2020-10-17 13:37:32 +02:00
|
|
|
public void setItemsFilter(List items) {
|
|
|
|
this.itemsFilter = items;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setDeviceFilter(long device) {
|
|
|
|
this.deviceFilter = device;
|
2020-08-24 00:09:10 +02:00
|
|
|
}
|
|
|
|
|
2020-11-22 22:33:55 +01:00
|
|
|
public int gettActivityKindFilter() {
|
|
|
|
return this.activityKindFilter;
|
|
|
|
}
|
|
|
|
|
2020-11-07 17:31:15 +01:00
|
|
|
@Override
|
|
|
|
protected View fill_dashboard(BaseActivitySummary item, int position, View view, ViewGroup parent, Context context) {
|
2020-11-22 22:33:55 +01:00
|
|
|
LayoutInflater inflater = (LayoutInflater) context
|
|
|
|
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
|
|
|
view = inflater.inflate(R.layout.activity_summary_dashboard_item, parent, false);
|
|
|
|
|
|
|
|
double durationSum = 0;
|
|
|
|
double caloriesBurntSum = 0;
|
|
|
|
double distanceSum = 0;
|
|
|
|
double activeSecondsSum = 0;
|
|
|
|
double firstItemDate = 0;
|
|
|
|
double lastItemDate = 0;
|
|
|
|
int activitiesCount = getCount() - 1;
|
|
|
|
int activityIcon = 0;
|
|
|
|
boolean activitySame = true;
|
|
|
|
|
|
|
|
TextView durationSumView = view.findViewById(R.id.summary_dashboard_layout_duration_label);
|
|
|
|
TextView caloriesBurntSumView = view.findViewById(R.id.summary_dashboard_layout_calories_label);
|
|
|
|
TextView distanceSumView = view.findViewById(R.id.summary_dashboard_layout_distance_label);
|
|
|
|
TextView activeSecondsSumView = view.findViewById(R.id.summary_dashboard_layout_active_duration_label);
|
|
|
|
TextView timeStartView = view.findViewById(R.id.summary_dashboard_layout_from_label);
|
|
|
|
TextView timeEndView = view.findViewById(R.id.summary_dashboard_layout_to_label);
|
|
|
|
TextView activitiesCountView = view.findViewById(R.id.summary_dashboard_layout_count_label);
|
|
|
|
TextView activityKindView = view.findViewById(R.id.summary_dashboard_layout_activity_label);
|
|
|
|
ImageView activityIconView = view.findViewById(R.id.summary_dashboard_layout_activity_icon);
|
|
|
|
ImageView activityIconBigView = view.findViewById(R.id.summary_dashboard_layout_big_activity_icon);
|
|
|
|
|
|
|
|
for (BaseActivitySummary sportitem : getItems()) {
|
|
|
|
if (sportitem.getStartTime() == null) continue; //first item is empty, for dashboard
|
|
|
|
|
|
|
|
if (firstItemDate == 0) firstItemDate = sportitem.getStartTime().getTime();
|
|
|
|
lastItemDate = sportitem.getEndTime().getTime();
|
|
|
|
durationSum += sportitem.getEndTime().getTime() - sportitem.getStartTime().getTime();
|
|
|
|
|
|
|
|
if (activityIcon == 0) {
|
|
|
|
activityIcon = sportitem.getActivityKind();
|
|
|
|
} else {
|
|
|
|
if (activityIcon != sportitem.getActivityKind()) {
|
|
|
|
activitySame = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
ActivitySummaryJsonSummary activitySummaryJsonSummary = new ActivitySummaryJsonSummary(sportitem);
|
|
|
|
JSONObject summarySubdata = activitySummaryJsonSummary.getSummaryData();
|
|
|
|
|
|
|
|
if (summarySubdata != null) {
|
|
|
|
try {
|
|
|
|
if (summarySubdata.has("caloriesBurnt")) {
|
|
|
|
caloriesBurntSum += summarySubdata.getJSONObject("caloriesBurnt").getDouble("value");
|
|
|
|
}
|
|
|
|
if (summarySubdata.has("distanceMeters")) {
|
|
|
|
distanceSum += summarySubdata.getJSONObject("distanceMeters").getDouble("value");
|
|
|
|
}
|
|
|
|
if (summarySubdata.has("activeSeconds")) {
|
|
|
|
activeSecondsSum += summarySubdata.getJSONObject("activeSeconds").getDouble("value");
|
|
|
|
}
|
|
|
|
} catch (JSONException e) {
|
|
|
|
LOG.error("SportsActivity", e);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
DecimalFormat df = new DecimalFormat("#.##");
|
|
|
|
durationSumView.setText(String.format("%s", DateTimeUtils.formatDurationHoursMinutes((long) durationSum, TimeUnit.MILLISECONDS)));
|
|
|
|
caloriesBurntSumView.setText(String.format("%s %s", (long) caloriesBurntSum, context.getString(R.string.calories_unit)));
|
|
|
|
distanceSumView.setText(String.format("%s %s", df.format(distanceSum / 1000), context.getString(R.string.km)));
|
2021-12-28 22:10:06 +01:00
|
|
|
distanceSumView.setText(FormatUtils.getFormattedDistanceLabel(distanceSum));
|
2021-01-23 21:42:12 +01:00
|
|
|
|
2020-11-22 22:33:55 +01:00
|
|
|
activeSecondsSumView.setText(String.format("%s", DateTimeUtils.formatDurationHoursMinutes((long) activeSecondsSum, TimeUnit.SECONDS)));
|
|
|
|
activitiesCountView.setText(String.valueOf(activitiesCount));
|
|
|
|
String activityName = context.getString(R.string.activity_summaries_all_activities);
|
|
|
|
if (gettActivityKindFilter() != 0) {
|
|
|
|
activityName = ActivityKind.asString(gettActivityKindFilter(), context);
|
|
|
|
activityIconView.setImageResource(ActivityKind.getIconId(gettActivityKindFilter()));
|
|
|
|
activityIconBigView.setImageResource(ActivityKind.getIconId(gettActivityKindFilter()));
|
|
|
|
} else {
|
|
|
|
if (activitySame) {
|
|
|
|
activityIconView.setImageResource(ActivityKind.getIconId(activityIcon));
|
|
|
|
activityIconBigView.setImageResource(ActivityKind.getIconId(activityIcon));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
activityKindView.setText(activityName);
|
|
|
|
|
|
|
|
//start and end are inverted when filer not applied, because items are sorted the other way
|
|
|
|
timeStartView.setText((dateFromFilter != 0) ? DateTimeUtils.formatDate(new Date(dateFromFilter)) : DateTimeUtils.formatDate(new Date((long) lastItemDate)));
|
|
|
|
timeEndView.setText((dateToFilter != 0) ? DateTimeUtils.formatDate(new Date(dateToFilter)) : DateTimeUtils.formatDate(new Date((long) firstItemDate)));
|
|
|
|
return view;
|
2020-11-07 17:31:15 +01:00
|
|
|
}
|
|
|
|
|
2020-08-24 00:09:10 +02:00
|
|
|
@Override
|
2020-10-17 13:37:32 +02:00
|
|
|
protected String getDateLabel(BaseActivitySummary item) {
|
2017-10-19 21:52:38 +02:00
|
|
|
Date startTime = item.getStartTime();
|
2020-10-17 13:37:32 +02:00
|
|
|
String separator = ",";
|
2017-10-19 21:52:38 +02:00
|
|
|
if (startTime != null) {
|
2020-08-24 16:54:05 +02:00
|
|
|
String activityDay;
|
|
|
|
|
|
|
|
if (DateUtils.isToday(startTime.getTime())) {
|
|
|
|
activityDay = getContext().getString(R.string.activity_summary_today);
|
|
|
|
} else if (DateTimeUtils.isYesterday(startTime)) {
|
|
|
|
activityDay = getContext().getString(R.string.activity_summary_yesterday);
|
|
|
|
} else {
|
|
|
|
activityDay = DateTimeUtils.formatDate(startTime);
|
|
|
|
}
|
2020-10-17 13:37:32 +02:00
|
|
|
String activityTime = DateTimeUtils.formatTime(startTime.getHours(), startTime.getMinutes());
|
|
|
|
return String.format("%s%s %s", activityDay, separator, activityTime);
|
|
|
|
}
|
|
|
|
return "Unknown time";
|
|
|
|
}
|
2020-08-24 16:54:05 +02:00
|
|
|
|
2020-10-17 13:37:32 +02:00
|
|
|
@Override
|
|
|
|
protected boolean hasGPS(BaseActivitySummary item) {
|
|
|
|
if (item.getGpxTrack() != null) {
|
|
|
|
return true;
|
|
|
|
} else {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
protected boolean hasDate(BaseActivitySummary item) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
protected String getTimeFrom(BaseActivitySummary item) {
|
|
|
|
Date time = item.getStartTime();
|
|
|
|
return DateTimeUtils.formatTime(time.getHours(), time.getMinutes());
|
|
|
|
}
|
2020-08-07 09:21:14 +02:00
|
|
|
|
2020-10-17 13:37:32 +02:00
|
|
|
@Override
|
|
|
|
protected String getTimeTo(BaseActivitySummary item) {
|
|
|
|
Date time = item.getEndTime();
|
|
|
|
return DateTimeUtils.formatTime(time.getHours(), time.getMinutes());
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
protected String getActivityName(BaseActivitySummary item) {
|
|
|
|
String activityLabel = item.getName();
|
|
|
|
String separator = ",";
|
|
|
|
if (activityLabel == null) {
|
|
|
|
activityLabel = "";
|
|
|
|
separator = "";
|
2020-08-24 16:54:05 +02:00
|
|
|
}
|
2020-10-17 13:37:32 +02:00
|
|
|
|
|
|
|
String activityKindName = ActivityKind.asString(item.getActivityKind(), getContext());
|
|
|
|
return String.format("%s%s %s", activityKindName, separator, activityLabel);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
protected String getStepLabel(BaseActivitySummary item) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
protected String getDistanceLabel(BaseActivitySummary item) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
protected String getHrLabel(BaseActivitySummary item) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
protected String getIntensityLabel(BaseActivitySummary item) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
protected String getDurationLabel(BaseActivitySummary item) {
|
|
|
|
Long duration = item.getEndTime().getTime() - item.getStartTime().getTime();
|
|
|
|
return DateTimeUtils.formatDurationHoursMinutes(duration, TimeUnit.MILLISECONDS);
|
|
|
|
}
|
|
|
|
|
2021-02-25 22:48:04 +01:00
|
|
|
@Override
|
|
|
|
protected String getSpeedLabel(BaseActivitySummary item) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2020-11-07 17:31:15 +01:00
|
|
|
@Override
|
|
|
|
protected String getSessionCountLabel(BaseActivitySummary item) {
|
|
|
|
return "";
|
|
|
|
}
|
|
|
|
|
2020-10-17 13:37:32 +02:00
|
|
|
@Override
|
|
|
|
protected boolean hasHR(BaseActivitySummary item) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
protected boolean hasIntensity(BaseActivitySummary item) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
protected boolean hasDistance(BaseActivitySummary item) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
protected boolean hasSteps(BaseActivitySummary item) {
|
|
|
|
return false;
|
2017-10-19 21:52:38 +02:00
|
|
|
}
|
|
|
|
|
2020-11-07 17:31:15 +01:00
|
|
|
@Override
|
|
|
|
protected boolean hasTotalSteps(BaseActivitySummary item) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2020-11-22 22:33:55 +01:00
|
|
|
protected boolean isSummary(BaseActivitySummary item, int position) {
|
|
|
|
return position == 0;
|
2020-11-07 17:31:15 +01:00
|
|
|
}
|
|
|
|
|
2021-03-03 19:03:02 +01:00
|
|
|
@Override
|
|
|
|
protected boolean isEmptySession(BaseActivitySummary item, int position) { return false; }
|
|
|
|
|
2020-11-07 17:31:15 +01:00
|
|
|
@Override
|
|
|
|
protected boolean isEmptySummary(BaseActivitySummary item) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
protected String getStepTotalLabel(BaseActivitySummary item) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2017-10-19 21:52:38 +02:00
|
|
|
@Override
|
|
|
|
protected int getIcon(BaseActivitySummary item) {
|
|
|
|
return ActivityKind.getIconId(item.getActivityKind());
|
|
|
|
}
|
2020-10-17 13:37:32 +02:00
|
|
|
|
|
|
|
public void setBackgroundColor(int backgroundColor) {
|
|
|
|
this.backgroundColor = backgroundColor;
|
|
|
|
}
|
2017-10-19 21:52:38 +02:00
|
|
|
}
|