forked from upstream-mirrors/OpenTracks
Cleanup.
This commit is contained in:
@@ -292,15 +292,9 @@ public class CustomContentProvider extends ContentProvider {
|
||||
public int update(@NonNull Uri url, ContentValues values, String where, String[] selectionArgs) {
|
||||
String table;
|
||||
switch (getUrlType(url)) {
|
||||
case TRACKPOINTS -> {
|
||||
table = TrackPointsColumns.TABLE_NAME;
|
||||
}
|
||||
case TRACKS -> {
|
||||
table = TracksColumns.TABLE_NAME;
|
||||
}
|
||||
case MARKERS -> {
|
||||
table = MarkerColumns.TABLE_NAME;
|
||||
}
|
||||
case TRACKPOINTS -> table = TrackPointsColumns.TABLE_NAME;
|
||||
case TRACKS -> table = TracksColumns.TABLE_NAME;
|
||||
case MARKERS -> table = MarkerColumns.TABLE_NAME;
|
||||
default -> throw new IllegalArgumentException("Unknown url " + url);
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import de.dennisguse.opentracks.settings.UnitSystem;
|
||||
|
||||
public record Distance(double distance_m) {
|
||||
|
||||
public static Distance ZERO = Distance.of(0);
|
||||
public static final Distance ZERO = Distance.of(0);
|
||||
|
||||
public static Distance of(double distance_m) {
|
||||
return new Distance(distance_m);
|
||||
|
||||
@@ -6,7 +6,7 @@ import de.dennisguse.opentracks.settings.UnitSystem;
|
||||
|
||||
public record Speed(double speed_mps) {
|
||||
|
||||
public static Speed ZERO = Speed.of(0);
|
||||
public static final Speed ZERO = Speed.of(0);
|
||||
|
||||
public static Speed of(Distance distance, Duration duration) {
|
||||
if (duration.isZero()) {
|
||||
@@ -20,11 +20,6 @@ public record Speed(double speed_mps) {
|
||||
return new Speed(speed_mps);
|
||||
}
|
||||
|
||||
@Deprecated //TODO Remove
|
||||
public static Speed of(String speed_mps) {
|
||||
return of(Float.parseFloat(speed_mps));
|
||||
}
|
||||
|
||||
public static Speed ofKMH(double speed_kmh) {
|
||||
return of(Distance.ofKilometer(speed_kmh), Duration.ofHours(1));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user