merge with develop

This commit is contained in:
Sem van der Hoeven
2021-01-12 13:56:46 +01:00
11 changed files with 319 additions and 0 deletions

View File

@@ -20,6 +20,7 @@ public enum Data {
private double zoom = 0;
private SharedPreferences.Editor editor;
private Context context;
private LocationProximityListener locationProximityListener;
public void setContext(Context context) {
this.context = context;
@@ -29,6 +30,15 @@ public enum Data {
this.editor = editor;
}
public LocationProximityListener getLocationProximityListener() {
return locationProximityListener;
}
public void setLocationProximityListener(LocationProximityListener locationProximityListener) {
this.locationProximityListener = locationProximityListener;
}
public double getZoom() {
return zoom;
}
@@ -72,6 +82,11 @@ public enum Data {
return locationsVisited;
}
@FunctionalInterface
public interface LocationProximityListener {
void onLocationVisited(Location location);
}
public void saveVisitedNamesList(){
Gson gson = new Gson();
String json = gson.toJson(visitedNames);

View File

@@ -25,6 +25,8 @@ public class Location implements Parcelable {
private String imageUrl;
private String iconUrl;
private boolean visited;
public Location(@NotNull String name, String coordinates, String description, @Nullable String imageUrl) {
this.name = name;
this.coordinates = coordinates;
@@ -171,4 +173,12 @@ public class Location implements Parcelable {
parcel.writeString(description);
parcel.writeString(imageUrl);
}
public boolean isVisited() {
return visited;
}
public void setVisited(boolean visited) {
this.visited = visited;
}
}

View File

@@ -13,6 +13,15 @@ public enum RouteHandler {
private int stepCount = 0;
private RouteFinishedListener routeFinishedListener;
private long startedTime;
private double currentRouteDuration;
public void setCurrentRouteDuration(double currentRouteDuration) {
this.currentRouteDuration = currentRouteDuration;
}
public double getCurrentRouteDuration() {
return currentRouteDuration;
}
private Polyline currentRouteLine;
@@ -20,6 +29,7 @@ public enum RouteHandler {
this.currentRouteLine = currentRouteLine;
}
public Polyline getCurrentRouteLine() {
return currentRouteLine;
}