fix #1957 open MarkerEditActivity to receive external marker (#1960)

* fix #1957 add CreateMarkerActivity to receive external marker
This commit is contained in:
Peter Storch
2024-07-30 15:24:18 +02:00
committed by GitHub
parent d8acf7df22
commit 389c4bed96
20 changed files with 226 additions and 415 deletions
@@ -27,8 +27,6 @@ import androidx.annotation.Nullable;
import java.time.Duration;
import java.time.Instant;
import de.dennisguse.opentracks.stats.TrackStatistics;
/**
* NOTE: A marker is indirectly (via it's location) assigned to one {@link TrackPoint} with trackPoint.hasLocation() == true.
*
@@ -53,10 +51,6 @@ public final class Marker {
private Altitude altitude;
private Float bearing;
//TODO It is the distance from the track starting point; rename to something more meaningful
private Distance length;
private Duration duration;
@Deprecated //TODO Make an URI instead of String
private String photoUrl = "";
@@ -65,7 +59,6 @@ public final class Marker {
this.time = time;
}
@Deprecated //TODO Marker cannot be created without length AND duration!
public Marker(@Nullable Track.Id trackId, @NonNull TrackPoint trackPoint) {
this.trackId = trackId;
@@ -75,20 +68,15 @@ public final class Marker {
throw new RuntimeException("Marker requires a trackpoint with a location.");
setTrackPoint(trackPoint);
this.length = Distance.of(0); //TODO Not cool!
this.duration = Duration.ofMillis(0); //TODO Not cool!
}
@Deprecated
public Marker(String name, String description, String category, String icon, @NonNull Track.Id trackId, @NonNull TrackStatistics statistics, @NonNull TrackPoint trackPoint, String photoUrl) {
public Marker(String name, String description, String category, String icon, @NonNull Track.Id trackId, @NonNull TrackPoint trackPoint, String photoUrl) {
this(trackId, trackPoint);
this.name = name;
this.description = description;
this.category = category;
this.icon = icon;
this.length = statistics.getTotalDistance();
this.duration = statistics.getTotalTime();
this.photoUrl = photoUrl;
}
@@ -234,22 +222,6 @@ public final class Marker {
this.bearing = bearing;
}
public Distance getLength() {
return length;
}
public void setLength(Distance length) {
this.length = length;
}
public Duration getDuration() {
return duration;
}
public void setDuration(@NonNull Duration duration) {
this.duration = duration;
}
public String getPhotoUrl() {
return photoUrl;
}