forked from upstream-mirrors/OpenTracks
Cleanup: renaming Marker.category to typeLocalized.
This commit is contained in:
@@ -311,7 +311,7 @@ public class ContentProviderUtils {
|
||||
int idIndex = cursor.getColumnIndexOrThrow(MarkerColumns._ID);
|
||||
int nameIndex = cursor.getColumnIndexOrThrow(MarkerColumns.NAME);
|
||||
int descriptionIndex = cursor.getColumnIndexOrThrow(MarkerColumns.DESCRIPTION);
|
||||
int categoryIndex = cursor.getColumnIndexOrThrow(MarkerColumns.CATEGORY);
|
||||
int typeLocalizedIndex = cursor.getColumnIndexOrThrow(MarkerColumns.TYPE_LOCALIZED);
|
||||
int trackIdIndex = cursor.getColumnIndexOrThrow(MarkerColumns.TRACKID);
|
||||
int longitudeIndex = cursor.getColumnIndexOrThrow(MarkerColumns.LONGITUDE);
|
||||
int latitudeIndex = cursor.getColumnIndexOrThrow(MarkerColumns.LATITUDE);
|
||||
@@ -367,7 +367,7 @@ public class ContentProviderUtils {
|
||||
new Track.Id(cursor.getLong(trackIdIndex)),
|
||||
!cursor.isNull(nameIndex) ? cursor.getString(nameIndex) : "",
|
||||
!cursor.isNull(descriptionIndex) ? cursor.getString(descriptionIndex) : "",
|
||||
!cursor.isNull(categoryIndex) ? cursor.getString(categoryIndex) : "",
|
||||
!cursor.isNull(typeLocalizedIndex) ? cursor.getString(typeLocalizedIndex) : "",
|
||||
position,
|
||||
photoUrl
|
||||
);
|
||||
@@ -472,7 +472,7 @@ public class ContentProviderUtils {
|
||||
|
||||
values.put(MarkerColumns.NAME, marker.name());
|
||||
values.put(MarkerColumns.DESCRIPTION, marker.description());
|
||||
values.put(MarkerColumns.CATEGORY, marker.category());
|
||||
values.put(MarkerColumns.TYPE_LOCALIZED, marker.typeLocalized());
|
||||
|
||||
values.put(MarkerColumns.LONGITUDE, (int) (marker.position().longitude() * 1E6));
|
||||
values.put(MarkerColumns.LATITUDE, (int) (marker.position().latitude() * 1E6));
|
||||
@@ -521,7 +521,7 @@ public class ContentProviderUtils {
|
||||
} else {
|
||||
selection = MarkerColumns.NAME + " LIKE ? OR " +
|
||||
MarkerColumns.DESCRIPTION + " LIKE ? OR " +
|
||||
MarkerColumns.CATEGORY + " LIKE ?";
|
||||
MarkerColumns.TYPE_LOCALIZED + " LIKE ?";
|
||||
selectionArgs = new String[]{"%" + query + "%", "%" + query + "%", "%" + query + "%"};
|
||||
sortOrder = MarkerColumns.DEFAULT_SORT_ORDER + " DESC";
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ public record Marker(
|
||||
@NonNull
|
||||
String description,
|
||||
@NonNull
|
||||
String category,
|
||||
String typeLocalized,
|
||||
|
||||
//Some data might not be used.
|
||||
Position position,
|
||||
|
||||
@@ -34,7 +34,7 @@ public final class MarkerBuilder {
|
||||
private Marker.Id id;
|
||||
private String name;
|
||||
private String description;
|
||||
private String category;
|
||||
private String typeLocalized;
|
||||
private final Track.Id trackId;
|
||||
|
||||
//Some data might not be used.
|
||||
@@ -48,7 +48,7 @@ public final class MarkerBuilder {
|
||||
this.trackId = trackId;
|
||||
this.name = "";
|
||||
this.description = "";
|
||||
this.category = "";
|
||||
this.typeLocalized = "";
|
||||
this.photoUrl = null;
|
||||
|
||||
if (!trackPoint.hasLocation())
|
||||
@@ -57,11 +57,11 @@ public final class MarkerBuilder {
|
||||
this.position = trackPoint.getPosition();
|
||||
}
|
||||
|
||||
public MarkerBuilder(@Nullable Track.Id trackId, @NonNull TrackPoint trackPoint, String name, String description, String category, Uri photoUrl) {
|
||||
public MarkerBuilder(@Nullable Track.Id trackId, @NonNull TrackPoint trackPoint, String name, String description, String typeLocalized, Uri photoUrl) {
|
||||
this(trackId, trackPoint);
|
||||
this.name = name;
|
||||
this.description = description;
|
||||
this.category = category;
|
||||
this.typeLocalized = typeLocalized;
|
||||
this.photoUrl = photoUrl;
|
||||
}
|
||||
|
||||
@@ -70,7 +70,7 @@ public final class MarkerBuilder {
|
||||
this.trackId = marker.trackId();
|
||||
this.name = marker.name();
|
||||
this.description = marker.description();
|
||||
this.category = marker.category();
|
||||
this.typeLocalized = marker.typeLocalized();
|
||||
this.position = marker.position();
|
||||
this.photoUrl = marker.photoUrl();
|
||||
}
|
||||
@@ -102,8 +102,8 @@ public final class MarkerBuilder {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public void setCategory(String category) {
|
||||
this.category = category;
|
||||
public void setTypeLocalized(String typeLocalized) {
|
||||
this.typeLocalized = typeLocalized;
|
||||
}
|
||||
|
||||
public Track.Id getTrackId() {
|
||||
@@ -128,7 +128,7 @@ public final class MarkerBuilder {
|
||||
trackId,
|
||||
name,
|
||||
description,
|
||||
category,
|
||||
typeLocalized,
|
||||
position,
|
||||
photoUrl
|
||||
);
|
||||
|
||||
@@ -38,7 +38,7 @@ public interface MarkerColumns extends BaseColumns {
|
||||
// Columns
|
||||
String NAME = "name"; // marker name
|
||||
String DESCRIPTION = "description"; // marker description
|
||||
String CATEGORY = "category"; // marker category
|
||||
String TYPE_LOCALIZED = "category";
|
||||
String TRACKID = "trackid"; // track id
|
||||
String LONGITUDE = "longitude"; // longitude
|
||||
String LATITUDE = "latitude"; // latitude
|
||||
@@ -53,7 +53,7 @@ public interface MarkerColumns extends BaseColumns {
|
||||
+ _ID + " INTEGER PRIMARY KEY AUTOINCREMENT, "
|
||||
+ NAME + " TEXT, "
|
||||
+ DESCRIPTION + " TEXT, "
|
||||
+ CATEGORY + " TEXT, "
|
||||
+ TYPE_LOCALIZED + " TEXT, "
|
||||
+ TRACKID + " INTEGER NOT NULL, "
|
||||
+ LONGITUDE + " INTEGER, "
|
||||
+ LATITUDE + " INTEGER, "
|
||||
|
||||
Reference in New Issue
Block a user