mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-08-24 00:00:47 +02:00
Make Sports Activities list use Activity List style
This commit is contained in:
parent
7c374181dc
commit
f60ba212c6
@ -22,13 +22,13 @@ import android.widget.ListView;
|
||||
import java.util.List;
|
||||
|
||||
import nodomain.freeyourgadget.gadgetbridge.R;
|
||||
import nodomain.freeyourgadget.gadgetbridge.adapter.AbstractItemAdapter;
|
||||
import nodomain.freeyourgadget.gadgetbridge.adapter.AbstractActivityListingAdapter;
|
||||
|
||||
public abstract class AbstractListActivity<T> extends AbstractGBActivity {
|
||||
private AbstractItemAdapter<T> itemAdapter;
|
||||
private AbstractActivityListingAdapter<T> itemAdapter;
|
||||
private ListView itemListView;
|
||||
|
||||
public void setItemAdapter(AbstractItemAdapter<T> itemAdapter) {
|
||||
public void setItemAdapter(AbstractActivityListingAdapter<T> itemAdapter) {
|
||||
this.itemAdapter = itemAdapter;
|
||||
itemListView.setAdapter(itemAdapter);
|
||||
}
|
||||
@ -61,7 +61,7 @@ public abstract class AbstractListActivity<T> extends AbstractGBActivity {
|
||||
this.itemAdapter.setDeviceFilter(device);
|
||||
}
|
||||
|
||||
public AbstractItemAdapter<T> getItemAdapter() {
|
||||
public AbstractActivityListingAdapter<T> getItemAdapter() {
|
||||
return itemAdapter;
|
||||
}
|
||||
|
||||
|
@ -24,6 +24,7 @@ import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.res.Resources;
|
||||
import android.graphics.Color;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.util.SparseBooleanArray;
|
||||
@ -268,6 +269,7 @@ public class ActivitySummariesActivity extends AbstractListActivity<BaseActivity
|
||||
ActivitySummariesAdapter activitySummariesAdapter = new ActivitySummariesAdapter(this, mGBDevice, activityFilter, dateFromFilter, dateToFilter, nameContainsFilter, deviceFilter, itemsFilter);
|
||||
int backgroundColor = getBackgroundColor(ActivitySummariesActivity.this);
|
||||
activitySummariesAdapter.setBackgroundColor(backgroundColor);
|
||||
activitySummariesAdapter.setShowTime(false);
|
||||
setItemAdapter(activitySummariesAdapter);
|
||||
|
||||
getItemListView().setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
||||
|
@ -15,15 +15,30 @@ public class ActivityListingAdapter extends AbstractActivityListingAdapter<StepA
|
||||
super(context);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getDateLabel(StepAnalysis.StepSession item) {
|
||||
return "";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean hasGPS(StepAnalysis.StepSession item) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean hasDate(StepAnalysis.StepSession item) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getTimeFrom(StepAnalysis.StepSession item) {
|
||||
Date time = item.getStepStart();
|
||||
Date time = item.getStartTime();
|
||||
return DateTimeUtils.formatTime(time.getHours(), time.getMinutes());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getTimeTo(StepAnalysis.StepSession item) {
|
||||
Date time = item.getStepEnd();
|
||||
Date time = item.getEndTime();
|
||||
return DateTimeUtils.formatTime(time.getHours(), time.getMinutes());
|
||||
}
|
||||
|
||||
@ -64,7 +79,7 @@ public class ActivityListingAdapter extends AbstractActivityListingAdapter<StepA
|
||||
|
||||
@Override
|
||||
protected String getDurationLabel(StepAnalysis.StepSession item) {
|
||||
long duration = item.getStepEnd().getTime() - item.getStepStart().getTime();
|
||||
long duration = item.getEndTime().getTime() - item.getStartTime().getTime();
|
||||
return DateTimeUtils.formatDurationHoursMinutes(duration, TimeUnit.MILLISECONDS);
|
||||
}
|
||||
|
||||
@ -95,10 +110,19 @@ public class ActivityListingAdapter extends AbstractActivityListingAdapter<StepA
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean hasSteps(StepAnalysis.StepSession item) {
|
||||
if (item.getSteps() > 0) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected int getIcon(StepAnalysis.StepSession item) {
|
||||
int activityKind = item.getActivityKind();
|
||||
return ActivityKind.getIconId(activityKind);
|
||||
return ActivityKind.getIconId(item.getActivityKind());
|
||||
}
|
||||
|
||||
|
||||
|
@ -168,19 +168,19 @@ public class StepAnalysis {
|
||||
}
|
||||
|
||||
public static class StepSession {
|
||||
private final Date stepStart;
|
||||
private final Date stepEnd;
|
||||
private final Date startTime;
|
||||
private final Date endTime;
|
||||
private final int steps;
|
||||
private final int heartRateAverage;
|
||||
private final float intensity;
|
||||
private final float distance;
|
||||
private final int activityKind;
|
||||
|
||||
StepSession(Date stepStart,
|
||||
Date stepEnd,
|
||||
StepSession(Date startTime,
|
||||
Date endTime,
|
||||
int steps, int heartRateAverage, float intensity, float distance, int activityKind) {
|
||||
this.stepStart = stepStart;
|
||||
this.stepEnd = stepEnd;
|
||||
this.startTime = startTime;
|
||||
this.endTime = endTime;
|
||||
this.steps = steps;
|
||||
this.heartRateAverage = heartRateAverage;
|
||||
this.intensity = intensity;
|
||||
@ -188,12 +188,12 @@ public class StepAnalysis {
|
||||
this.activityKind = activityKind;
|
||||
}
|
||||
|
||||
public Date getStepStart() {
|
||||
return stepStart;
|
||||
public Date getStartTime() {
|
||||
return startTime;
|
||||
}
|
||||
|
||||
public Date getStepEnd() {
|
||||
return stepEnd;
|
||||
public Date getEndTime() {
|
||||
return endTime;
|
||||
}
|
||||
|
||||
public int getSteps() {
|
||||
|
@ -45,6 +45,8 @@ public abstract class AbstractActivityListingAdapter<T> extends ArrayAdapter<T>
|
||||
private final List<T> items;
|
||||
private int backgroundColor = 0;
|
||||
private int alternateColor = 0;
|
||||
private boolean zebraStripes = true;
|
||||
private boolean showTime = true;
|
||||
|
||||
public AbstractActivityListingAdapter(Context context) {
|
||||
this(context, new ArrayList<T>());
|
||||
@ -74,22 +76,28 @@ public abstract class AbstractActivityListingAdapter<T> extends ArrayAdapter<T>
|
||||
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
||||
view = inflater.inflate(R.layout.activity_list_item, parent, false);
|
||||
}
|
||||
TextView timeFrom = view.findViewById(R.id.line_layout_timeFrom);
|
||||
TextView timeTo = view.findViewById(R.id.line_layout_timeTo);
|
||||
TextView activityName = view.findViewById(R.id.line_layout_activityName);
|
||||
TextView timeFrom = view.findViewById(R.id.line_layout_time_from);
|
||||
TextView timeTo = view.findViewById(R.id.line_layout_time_to);
|
||||
TextView activityName = view.findViewById(R.id.line_layout_activity_name);
|
||||
TextView stepLabel = view.findViewById(R.id.line_layout_step_label);
|
||||
TextView distanceLabel = view.findViewById(R.id.line_layout_distance_label);
|
||||
TextView hrLabel = view.findViewById(R.id.line_layout_hr_label);
|
||||
TextView intensityLabel = view.findViewById(R.id.line_layout_intensity_label);
|
||||
TextView durationLabel = view.findViewById(R.id.line_layout_duration_labe);
|
||||
|
||||
TextView durationLabel = view.findViewById(R.id.line_layout_duration_label);
|
||||
TextView dateLabel = view.findViewById(R.id.line_layout_date_label);
|
||||
|
||||
LinearLayout timeLayout = view.findViewById(R.id.line_layout_time);
|
||||
LinearLayout hrLayout = view.findViewById(R.id.line_layout_hr);
|
||||
LinearLayout stepsLayout = view.findViewById(R.id.line_layout_step);
|
||||
LinearLayout distanceLayout = view.findViewById(R.id.line_layout_distance);
|
||||
LinearLayout intensityLayout = view.findViewById(R.id.line_layout_intensity);
|
||||
LinearLayout dateLayout = view.findViewById(R.id.line_layout_date);
|
||||
LinearLayout list_item_subparent_layout = view.findViewById(R.id.list_item_subparent_layout);
|
||||
|
||||
RelativeLayout parentLayout = view.findViewById(R.id.list_item_parent_layout);
|
||||
|
||||
ImageView activityIcon = view.findViewById(R.id.line_layout_activityIcon);
|
||||
ImageView activityIcon = view.findViewById(R.id.line_layout_activity_icon);
|
||||
ImageView gpsIcon = view.findViewById(R.id.line_layout_gps_icon);
|
||||
|
||||
timeFrom.setText(getTimeFrom(item));
|
||||
timeTo.setText(getTimeTo(item));
|
||||
@ -99,6 +107,8 @@ public abstract class AbstractActivityListingAdapter<T> extends ArrayAdapter<T>
|
||||
hrLabel.setText(getHrLabel(item));
|
||||
intensityLabel.setText(getIntensityLabel(item));
|
||||
durationLabel.setText(getDurationLabel(item));
|
||||
dateLabel.setText(getDateLabel(item));
|
||||
|
||||
|
||||
if (!hasHR(item)) {
|
||||
hrLayout.setVisibility(View.GONE);
|
||||
@ -118,15 +128,44 @@ public abstract class AbstractActivityListingAdapter<T> extends ArrayAdapter<T>
|
||||
distanceLayout.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
if (!hasSteps(item)) {
|
||||
stepsLayout.setVisibility(View.GONE);
|
||||
} else {
|
||||
stepsLayout.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
if (!hasDate(item)) {
|
||||
dateLayout.setVisibility(View.GONE);
|
||||
} else {
|
||||
dateLayout.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
if (!showTime) {
|
||||
timeLayout.setVisibility(View.GONE);
|
||||
} else {
|
||||
timeLayout.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
if (!hasGPS(item)) {
|
||||
gpsIcon.setVisibility(View.GONE);
|
||||
} else {
|
||||
gpsIcon.setVisibility(View.VISIBLE);
|
||||
}
|
||||
activityIcon.setImageResource(getIcon(item));
|
||||
|
||||
if (position % 2 == 0) {
|
||||
if (zebraStripes && position % 2 == 0) {
|
||||
parentLayout.setBackgroundColor(alternateColor);
|
||||
}
|
||||
|
||||
return view;
|
||||
}
|
||||
|
||||
protected abstract String getDateLabel(T item);
|
||||
|
||||
protected abstract boolean hasGPS(T item);
|
||||
|
||||
protected abstract boolean hasDate(T item);
|
||||
|
||||
protected abstract String getTimeFrom(T item);
|
||||
|
||||
protected abstract String getTimeTo(T item);
|
||||
@ -149,6 +188,16 @@ public abstract class AbstractActivityListingAdapter<T> extends ArrayAdapter<T>
|
||||
|
||||
protected abstract boolean hasDistance(T item);
|
||||
|
||||
protected abstract boolean hasSteps(T item);
|
||||
|
||||
public void setZebraStripes(boolean enable) {
|
||||
zebraStripes = enable;
|
||||
}
|
||||
|
||||
public void setShowTime(boolean enable) {
|
||||
showTime = enable;
|
||||
}
|
||||
|
||||
@DrawableRes
|
||||
protected abstract int getIcon(T item);
|
||||
|
||||
@ -167,4 +216,22 @@ public abstract class AbstractActivityListingAdapter<T> extends ArrayAdapter<T>
|
||||
}
|
||||
}
|
||||
|
||||
public void setActivityKindFilter(int activityKind) {
|
||||
this.setActivityKindFilter(activityKind);
|
||||
}
|
||||
|
||||
public void setDateFromFilter(long date) {
|
||||
}
|
||||
|
||||
public void setDateToFilter(long date) {
|
||||
}
|
||||
|
||||
public void setNameContainsFilter(String name) {
|
||||
}
|
||||
|
||||
public void setItemsFilter(List items) {
|
||||
}
|
||||
|
||||
public void setDeviceFilter(long device) {
|
||||
}
|
||||
}
|
||||
|
@ -61,24 +61,7 @@ public abstract class AbstractItemAdapter<T> extends ArrayAdapter<T> {
|
||||
this.horizontalAlignment = horizontalAlignment;
|
||||
}
|
||||
|
||||
public void setActivityKindFilter(int activityKind){
|
||||
this.setActivityKindFilter(activityKind);
|
||||
}
|
||||
|
||||
public void setDateFromFilter(long date){
|
||||
}
|
||||
|
||||
public void setDateToFilter(long date){
|
||||
}
|
||||
|
||||
public void setNameContainsFilter(String name){
|
||||
}
|
||||
|
||||
public void setItemsFilter(List items) {
|
||||
}
|
||||
|
||||
public void setDeviceFilter(long device) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public View getView(int position, View view, ViewGroup parent) {
|
||||
|
@ -40,14 +40,15 @@ import nodomain.freeyourgadget.gadgetbridge.util.GB;
|
||||
|
||||
import static nodomain.freeyourgadget.gadgetbridge.activities.ActivitySummariesFilter.ALL_DEVICES;
|
||||
|
||||
public class ActivitySummariesAdapter extends AbstractItemAdapter<BaseActivitySummary> {
|
||||
public class ActivitySummariesAdapter extends AbstractActivityListingAdapter<BaseActivitySummary> {
|
||||
private final GBDevice device;
|
||||
private int activityKindFilter;
|
||||
long dateFromFilter=0;
|
||||
long dateToFilter=0;
|
||||
long dateFromFilter = 0;
|
||||
long dateToFilter = 0;
|
||||
long deviceFilter;
|
||||
String nameContainsFilter;
|
||||
List<Long>itemsFilter;
|
||||
List<Long> itemsFilter;
|
||||
private int activityKindFilter;
|
||||
private int backgroundColor = 0;
|
||||
|
||||
public ActivitySummariesAdapter(Context context, GBDevice device, int activityKindFilter, long dateFromFilter, long dateToFilter, String nameContainsFilter, long deviceFilter, List itemsFilter) {
|
||||
super(context);
|
||||
@ -81,24 +82,24 @@ public class ActivitySummariesAdapter extends AbstractItemAdapter<BaseActivitySu
|
||||
dbDevice.getId())).orderDesc(BaseActivitySummaryDao.Properties.StartTime);
|
||||
}
|
||||
|
||||
if (activityKindFilter !=0) {
|
||||
if (activityKindFilter != 0) {
|
||||
qb.where(
|
||||
BaseActivitySummaryDao.Properties.ActivityKind.eq(activityKindFilter));
|
||||
}
|
||||
|
||||
if (dateFromFilter !=0) {
|
||||
if (dateFromFilter != 0) {
|
||||
qb.where(
|
||||
BaseActivitySummaryDao.Properties.StartTime.gt(new Date(dateFromFilter)));
|
||||
}
|
||||
if (dateToFilter !=0) {
|
||||
if (dateToFilter != 0) {
|
||||
qb.where(
|
||||
BaseActivitySummaryDao.Properties.EndTime.lt(new Date(dateToFilter)));
|
||||
}
|
||||
if (nameContainsFilter !=null && nameContainsFilter.length() > 0) {
|
||||
if (nameContainsFilter != null && nameContainsFilter.length() > 0) {
|
||||
qb.where(
|
||||
BaseActivitySummaryDao.Properties.Name.like("%" + nameContainsFilter + "%"));
|
||||
}
|
||||
if (itemsFilter !=null) {
|
||||
if (itemsFilter != null) {
|
||||
qb.where(
|
||||
BaseActivitySummaryDao.Properties.Id.in(itemsFilter));
|
||||
}
|
||||
@ -109,42 +110,36 @@ public class ActivitySummariesAdapter extends AbstractItemAdapter<BaseActivitySu
|
||||
}
|
||||
}
|
||||
|
||||
public void setActivityKindFilter(int filter){
|
||||
this.activityKindFilter=filter;
|
||||
public void setActivityKindFilter(int filter) {
|
||||
this.activityKindFilter = filter;
|
||||
}
|
||||
public void setDateFromFilter(long date){
|
||||
this.dateFromFilter=date;
|
||||
}
|
||||
public void setDateToFilter(long date){
|
||||
this.dateToFilter=date;
|
||||
}
|
||||
public void setNameContainsFilter(String name){
|
||||
this.nameContainsFilter=name;
|
||||
}
|
||||
public void setItemsFilter(List items) { this.itemsFilter = items; }
|
||||
public void setDeviceFilter(long device) { this.deviceFilter = device; }
|
||||
|
||||
@Override
|
||||
protected String getName(BaseActivitySummary item) {
|
||||
String name = item.getName();
|
||||
if (name == null) name="";
|
||||
String gpxTrack = item.getGpxTrack();
|
||||
String hasGps = " ";
|
||||
if (gpxTrack != null) {
|
||||
hasGps=" 🛰️ ";
|
||||
}
|
||||
return ActivityKind.asString(item.getActivityKind(), getContext())+ hasGps + name;
|
||||
public void setDateFromFilter(long date) {
|
||||
this.dateFromFilter = date;
|
||||
}
|
||||
|
||||
public void setDateToFilter(long date) {
|
||||
this.dateToFilter = date;
|
||||
}
|
||||
|
||||
public void setNameContainsFilter(String name) {
|
||||
this.nameContainsFilter = name;
|
||||
}
|
||||
|
||||
public void setItemsFilter(List items) {
|
||||
this.itemsFilter = items;
|
||||
}
|
||||
|
||||
public void setDeviceFilter(long device) {
|
||||
this.deviceFilter = device;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getDetails(BaseActivitySummary item) {
|
||||
protected String getDateLabel(BaseActivitySummary item) {
|
||||
Date startTime = item.getStartTime();
|
||||
|
||||
String separator = ",";
|
||||
if (startTime != null) {
|
||||
String activityDay;
|
||||
String activityTime;
|
||||
String activityDayTime;
|
||||
Long duration = item.getEndTime().getTime() - item.getStartTime().getTime();
|
||||
|
||||
if (DateUtils.isToday(startTime.getTime())) {
|
||||
activityDay = getContext().getString(R.string.activity_summary_today);
|
||||
@ -153,21 +148,103 @@ public class ActivitySummariesAdapter extends AbstractItemAdapter<BaseActivitySu
|
||||
} else {
|
||||
activityDay = DateTimeUtils.formatDate(startTime);
|
||||
}
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.setTime(startTime);
|
||||
int hours = calendar.get(Calendar.HOUR_OF_DAY);
|
||||
int minutes = calendar.get(Calendar.MINUTE);
|
||||
|
||||
activityTime = DateTimeUtils.formatTime(hours, minutes);
|
||||
activityDayTime = String.format("%s, %s", activityDay, activityTime);
|
||||
|
||||
return activityDayTime + " (" + DateTimeUtils.formatDurationHoursMinutes(duration, TimeUnit.MILLISECONDS) + ")";
|
||||
String activityTime = DateTimeUtils.formatTime(startTime.getHours(), startTime.getMinutes());
|
||||
return String.format("%s%s %s", activityDay, separator, activityTime);
|
||||
}
|
||||
return "Unknown time";
|
||||
}
|
||||
|
||||
@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());
|
||||
}
|
||||
|
||||
@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 = "";
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
@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;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getIcon(BaseActivitySummary item) {
|
||||
return ActivityKind.getIconId(item.getActivityKind());
|
||||
}
|
||||
|
||||
public void setBackgroundColor(int backgroundColor) {
|
||||
this.backgroundColor = backgroundColor;
|
||||
}
|
||||
}
|
||||
|
5
app/src/main/res/drawable/list_selector.xml
Normal file
5
app/src/main/res/drawable/list_selector.xml
Normal file
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="@drawable/selected" android:state_activated="true" />
|
||||
</selector>
|
@ -3,16 +3,20 @@
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/list_item_parent_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?android:attr/activatedBackgroundIndicator">
|
||||
android:layout_height="wrap_content">
|
||||
<!--
|
||||
android:background="?android:attr/activatedBackgroundIndicator"
|
||||
-->
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/list_item_subparent_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="5dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:background="@drawable/list_selector"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<LinearLayout
|
||||
@ -21,12 +25,13 @@
|
||||
android:orientation="horizontal">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/line_layout_time"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/line_layout_timeFrom"
|
||||
android:id="@+id/line_layout_time_from"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="end"
|
||||
@ -35,9 +40,9 @@
|
||||
android:text="14:30" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/line_layout_timeTo"
|
||||
android:id="@+id/line_layout_time_to"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_gravity="end"
|
||||
android:layout_weight="1"
|
||||
android:gravity="bottom"
|
||||
@ -53,7 +58,7 @@
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/line_layout_activityIcon"
|
||||
android:id="@+id/line_layout_activity_icon"
|
||||
android:layout_width="56dp"
|
||||
android:layout_height="56dp"
|
||||
android:layout_marginTop="4dp"
|
||||
@ -70,7 +75,7 @@
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/line_layout_activityName"
|
||||
android:id="@+id/line_layout_activity_name"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:maxLines="1"
|
||||
@ -78,17 +83,35 @@
|
||||
android:text="Running"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/line_layout_duration_labe"
|
||||
<LinearLayout
|
||||
android:id="@+id/line_layout_duration_gps"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="2dp"
|
||||
android:layout_marginEnd="2dp"
|
||||
android:layout_weight="1"
|
||||
android:gravity="end"
|
||||
android:maxLines="1"
|
||||
android:scrollHorizontally="false"
|
||||
android:text="25min" />
|
||||
android:layout_gravity="start"
|
||||
android:gravity="start"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/line_layout_duration_label"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="2dp"
|
||||
android:layout_marginEnd="2dp"
|
||||
android:layout_weight="1"
|
||||
android:gravity="end"
|
||||
android:maxLines="1"
|
||||
android:scrollHorizontally="false"
|
||||
android:text="25min" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/line_layout_gps_icon"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_gravity="end"
|
||||
android:contentDescription="@string/candidate_item_device_image"
|
||||
app:srcCompat="@android:drawable/ic_menu_mylocation" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
@ -192,7 +215,7 @@
|
||||
<LinearLayout
|
||||
android:id="@+id/line_layout_hr"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="start"
|
||||
android:gravity="start"
|
||||
android:orientation="horizontal">
|
||||
@ -220,6 +243,37 @@
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/line_layout_date"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="start"
|
||||
android:gravity="start"
|
||||
android:orientation="horizontal">
|
||||
<!--
|
||||
<ImageView
|
||||
android:id="@+id/line_layout_date_icon"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_gravity="start"
|
||||
android:contentDescription="@string/candidate_item_device_image"
|
||||
app:srcCompat="@drawable/ic_calendar_today" />
|
||||
-->
|
||||
|
||||
<TextView
|
||||
android:id="@+id/line_layout_date_label"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="start"
|
||||
android:layout_weight="1"
|
||||
android:gravity="start"
|
||||
android:maxLines="1"
|
||||
android:scrollHorizontally="false"
|
||||
android:text="1.1.1973" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
@ -35,4 +35,6 @@
|
||||
<color name="alternate_row_background_light">#FFEDEDED</color>
|
||||
<color name="alternate_row_background_dark">#545254</color>
|
||||
|
||||
<drawable name="selected">@color/accent</drawable>
|
||||
|
||||
</resources>
|
Loading…
Reference in New Issue
Block a user