diff --git a/GDirectionsApiUtils/app/gradle_nexus_release.gradle b/GDirectionsApiUtils/app/gradle_nexus_release.gradle
index 77f914c..e2bf6d3 100644
--- a/GDirectionsApiUtils/app/gradle_nexus_release.gradle
+++ b/GDirectionsApiUtils/app/gradle_nexus_release.gradle
@@ -1,4 +1,10 @@
+//The open source file
+//apply from: 'gradle_nexus_release_var.gradle'
+//TODO but if you are me use this one:
apply from: 'gradle_nexus_release_var_def.gradle'
+
+
+
//When CatBus blocks the release go in builds_hooks.gradle and uncomment the comments about catbus
uploadArchives {
diff --git a/GDirectionsApiUtils/app/gradle_nexus_release_var_def.gradle b/GDirectionsApiUtils/app/gradle_nexus_release_var.gradle
similarity index 84%
rename from GDirectionsApiUtils/app/gradle_nexus_release_var_def.gradle
rename to GDirectionsApiUtils/app/gradle_nexus_release_var.gradle
index d09400f..ab1f3bb 100644
--- a/GDirectionsApiUtils/app/gradle_nexus_release_var_def.gradle
+++ b/GDirectionsApiUtils/app/gradle_nexus_release_var.gradle
@@ -66,21 +66,11 @@ project.ext {
//Define where to deploy
//--------------------------------------
- NEXUS_USERNAME = "ACMS"
- NEXUS_PASSWORD ='@cms$$123'
- NEXUS_URL = "https://nexus.kamereon.org"
+ NEXUS_USERNAME = "UserName"
+ NEXUS_PASSWORD ='Password'
+ NEXUS_URL = "https://nexus.organization.org"
- SNAPSHOT_REPOSITORY_URL = "https://nexus.kamereon.org/repository/maven-snapshots"
- RELEASE_REPOSITORY_URL = "https://nexus.kamereon.org/repository/android_releases"
+ SNAPSHOT_REPOSITORY_URL = "https://nexus.organization.org/repository/maven-snapshots"
+ RELEASE_REPOSITORY_URL = "https://nexus.organization.org/repository/android_releases"
-//Define your GPG for signing your archives
-//-----------------------------------------
-//signing.keyId=9CF79442
-//signing.password=sylpheo_acms
-//signing.secretKeyRingFile=./gpg_key.asc
-
-//Reference:
-//http://zserge.com/blog/gradle-maven-publish.html
-//https://github.com/A-CMS/alliance-platform-parent/blob/master/pom.xml
-//https://maven.apache.org/scm/git.html
}
\ No newline at end of file
diff --git a/GDirectionsApiUtils/app/src/main/AndroidManifest.xml b/GDirectionsApiUtils/app/src/main/AndroidManifest.xml
index 9ec8472..366fab2 100644
--- a/GDirectionsApiUtils/app/src/main/AndroidManifest.xml
+++ b/GDirectionsApiUtils/app/src/main/AndroidManifest.xml
@@ -26,6 +26,7 @@
+
diff --git a/GDirectionsApiUtils/app/src/main/java/com/android2ee/formation/librairies/google/map/utils/direction/GDirectionsApiUtils.java b/GDirectionsApiUtils/app/src/main/java/com/android2ee/formation/librairies/google/map/utils/direction/GDirectionsApiUtils.java
index 33437f0..a625e8a 100644
--- a/GDirectionsApiUtils/app/src/main/java/com/android2ee/formation/librairies/google/map/utils/direction/GDirectionsApiUtils.java
+++ b/GDirectionsApiUtils/app/src/main/java/com/android2ee/formation/librairies/google/map/utils/direction/GDirectionsApiUtils.java
@@ -1,4 +1,4 @@
-/**
+/*
*
* - GoogleMapSample
* - com.android2ee.formation.librairies.google.map.utils.direction
@@ -31,6 +31,7 @@
package com.android2ee.formation.librairies.google.map.utils.direction;
import android.graphics.Color;
+import android.support.annotation.NonNull;
import android.util.Log;
import com.android2ee.formation.librairies.google.map.utils.direction.com.IGDirectionServer;
@@ -61,7 +62,8 @@
/**
* @author Mathias Seguy (Android2EE)
- * @goals This class aims to make a layer over the Direction Api.
+ * This class aims to make a layer over the Direction Api.
+ *
* To have a Google Direction and Draw it You just have to:
*
* - Implements the DCACallBack and its method public void onDirectionLoaded(GDirection
@@ -85,32 +87,36 @@
* GDirectionsApiUtils.drawGDirection(direction, mMap);
* }
*/
+@SuppressWarnings({"DanglingJavadoc", "WeakerAccess"})
public class GDirectionsApiUtils {
+
/***********************************************************
- * Attributes
+ * Constants/Keys
**********************************************************/
private static final String TAG = "GDirectionsApiUtils";
- private static WeakReference callbackWeakRef;
-
- private static LatLngBounds.Builder latLngBuilder;
- private static LatLngBounds bounds;
+ @SuppressWarnings("unused")
+ public static final String BASE_GDIR_URL = "https://maps.googleapis.com/";
- /******************************************************************************************/
- /** Public Method **************************************************************************/
- /******************************************************************************************/
+ /***********************************************************
+ * Attributes
+ **********************************************************/
+ private static WeakReference callbackWeakRef;
+ /***********************************************************
+ * Business Methods
+ **********************************************************/
/**
* Draw on the given map the given GDirection object
*
* @param direction The google direction to draw
* @param map The map to draw on
*/
+ @SuppressWarnings("unused")
public static void drawGDirection(GDirection direction, GoogleMap map) {
drawGDirection(direction, map, null);
}
-
/**
* Draw on the given map the given GDirection object
*
@@ -122,7 +128,7 @@ public static void drawGDirection(GDirection direction, GoogleMap map, GDirectio
// The polyline option to create polyline
PolylineOptions lineOptions = null;
// index of GDPoint within the current GDPath
- int i = 0;
+ int i;
// index of the current GDPath
int pathIndex = 0;
// index of the current GDLegs
@@ -226,7 +232,7 @@ public static void drawGDirectionWithoutPathMarker(GDirection direction, GoogleM
} else {
maxDotsDisplayed = GDirectionMapsOptions.MAX_DOTS_DISPLAYED_DEFAULT;
}
- latLngBuilder = new LatLngBounds.Builder();
+ LatLngBounds.Builder latLngBuilder = new LatLngBounds.Builder();
//Was there but unused so I use it
GDirection reducedDirection = GDirectionsApiUtils.reduce(direction, maxDotsDisplayed);
@@ -269,19 +275,17 @@ public static void drawGDirectionWithoutPathMarker(GDirection direction, GoogleM
}
}
- bounds = latLngBuilder.build();
+ LatLngBounds bounds = latLngBuilder.build();
map.animateCamera(CameraUpdateFactory.newLatLngBounds(bounds, 100));
- map.addPolyline(lineOptions.addAll(pathList));
-
- reducedDirection = null;
+ if (lineOptions != null) {
+ map.addPolyline(lineOptions.addAll(pathList));
+ }
}
/**
* The goal of this method is to reduce the number of point to draw
* according to the value of MapOtion.maxDotsDisplayed
- *
- * @param gDir
*/
public static GDirection reduce(GDirection gDir, int maxDotsDisplayed) {
int gWeight = gDir.getWeight();
@@ -300,7 +304,6 @@ public static GDirection reduce(GDirection gDir, int maxDotsDisplayed) {
GDPath currentPath;
ArrayList currentPointList;
-// int currentPathIndex = 1;
//We browse every legs
for (GDLegs legs : gDir.getLegsList()) {
//for each leg, we find eth number of path
@@ -337,26 +340,33 @@ public static GDirection reduce(GDirection gDir, int maxDotsDisplayed) {
* Find the direction between two points on the maps (direction is the path to follow to go from
* start to end points)
*
- * @param callback The DCACallBack to prevent when data have been retrieve and built. It will receive
- * a GDirection
- * @param data builder GDirection
+ * @param serverBaseUrl The server URL to be called (without the endpoint path)
+ * @param callback The DCACallBack to prevent when data have been retrieve and built.
+ * It will receive a GDirection
+ * @param data Built GDirection
*/
- public static void getDirection(final DCACallBack callback, GDirectionData data) {
- callbackWeakRef = new WeakReference(callback);
- loadGDirections(data);
+ public static void getDirection(String serverBaseUrl,
+ final DCACallBack callback,
+ GDirectionData data) {
+ callbackWeakRef = new WeakReference<>(callback);
+ loadGDirections(serverBaseUrl, data);
}
/**
* Make the real job of loading directions
*
- * @param data
+ * @param serverBaseUrl The server URL to be called (without the endpoint path)
+ * @param data Built GDirection
*/
- private static void loadGDirections(GDirectionData data) {
- IGDirectionServer gDirectionServer = RetrofitBuilder.getBaseRetrofit().create(IGDirectionServer.class);
+ private static void loadGDirections(@NonNull String serverBaseUrl,
+ @NonNull GDirectionData data) {
+ IGDirectionServer gDirectionServer = RetrofitBuilder
+ .getBaseRetrofit(serverBaseUrl)
+ .create(IGDirectionServer.class);
+
Call
> call = gDirectionServer.getGDirections(
data.getStart().latitude + "," + data.getStart().longitude,
data.getEnd().latitude + "," + data.getEnd().longitude,
- false,
data.getMode().toString(),
data.getWaypoints(),
data.isAlternative(),
@@ -366,10 +376,10 @@ private static void loadGDirections(GDirectionData data) {
data.getRegion(),
data.getDeparture_time(),
data.getArrival_time(),
- data.getGoogleApiKey()
+ data.getGoogle_api_key()
);
- call.enqueue(new Callback>() {
+ call.enqueue(new Callback>() {
@Override
public void onResponse(Call> call, Response> response) {
DCACallBack callBack = callbackWeakRef.get();
diff --git a/GDirectionsApiUtils/app/src/main/java/com/android2ee/formation/librairies/google/map/utils/direction/com/IGDirectionServer.java b/GDirectionsApiUtils/app/src/main/java/com/android2ee/formation/librairies/google/map/utils/direction/com/IGDirectionServer.java
index 6a55fd4..2f05a7d 100644
--- a/GDirectionsApiUtils/app/src/main/java/com/android2ee/formation/librairies/google/map/utils/direction/com/IGDirectionServer.java
+++ b/GDirectionsApiUtils/app/src/main/java/com/android2ee/formation/librairies/google/map/utils/direction/com/IGDirectionServer.java
@@ -6,29 +6,28 @@
import retrofit2.Call;
import retrofit2.http.GET;
-import retrofit2.http.Path;
import retrofit2.http.Query;
/**
* Created by Safi on 02/05/2017.
+ * Updated by Anthony St. on 22/01/2019.
*/
public interface IGDirectionServer {
- public final String BASE_URL = "https://maps.googleapis.com/";
@GET("maps/api/directions/json")
Call> getGDirections(
- @Query("origin") String origin,//data.getStart().latitude + ","+ data.getStart().longitude
- @Query("destination") String destination,//data.getEnd().latitude + "," + data.getEnd().longitude
- @Query("sensor") boolean sensor,//"&sensor=false"
- @Query("mode") String mode,//data.getMode()
- @Query("waypoints") String waypoints,//data.getWaypoints()
- @Query("alternatives") boolean alternatives,//data.isAlternative()
- @Query("avoid") String avoid,//data.getAvoid()
- @Query("language") String language,//data.getLanguage()
- @Query("units") String units,//data.getUs()
- @Query("region") String region,//data.getRegion()
- @Query("departure_time") String departure_time,//data.getDeparture_time()
- @Query("arrival_time") String arrival_time,//data.getArrival_time()
- @Query("key") String googleApiKey//data.getArrival_time()
+ @Query("origin") String origin, //data.getStart().latitude + ","+ data.getStart().longitude
+ @Query("destination") String destination, //data.getEnd().latitude + "," + data.getEnd().longitude
+ @Query("mode") String mode, //data.getMode()
+ @Query("waypoints") String waypoints, //data.getWaypoints()
+ @Query("alternatives") boolean alternatives, //data.isAlternative()
+ @Query("avoid") String avoid, //data.getAvoid()
+ @Query("language") String language, //data.getLanguage()
+ @Query("units") String units, //data.getUs()
+ @Query("region") String region, //data.getRegion()
+ @Query("departure_time") String departure_time, //data.getDeparture_time()
+ @Query("arrival_time") String arrival_time, //data.getArrival_time()
+ @Query("key") String googleApiKey //data.getGoogle_api_key()
);
+
}
diff --git a/GDirectionsApiUtils/app/src/main/java/com/android2ee/formation/librairies/google/map/utils/direction/com/RetrofitBuilder.java b/GDirectionsApiUtils/app/src/main/java/com/android2ee/formation/librairies/google/map/utils/direction/com/RetrofitBuilder.java
index cfaaee7..f59eac7 100644
--- a/GDirectionsApiUtils/app/src/main/java/com/android2ee/formation/librairies/google/map/utils/direction/com/RetrofitBuilder.java
+++ b/GDirectionsApiUtils/app/src/main/java/com/android2ee/formation/librairies/google/map/utils/direction/com/RetrofitBuilder.java
@@ -1,5 +1,6 @@
package com.android2ee.formation.librairies.google.map.utils.direction.com;
+import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.util.Log;
@@ -9,17 +10,18 @@
import okhttp3.OkHttpClient;
import okhttp3.logging.HttpLoggingInterceptor;
import retrofit2.Retrofit;
-import retrofit2.converter.moshi.MoshiConverterFactory;
-import static com.android2ee.formation.librairies.google.map.utils.direction.com.IGDirectionServer.BASE_URL;
import static okhttp3.logging.HttpLoggingInterceptor.Level.BODY;
import static okhttp3.logging.HttpLoggingInterceptor.Level.NONE;
+@SuppressWarnings("DanglingJavadoc")
public class RetrofitBuilder {
- private static final String TAG = "GD_RetrofitBuilder";
+
/***********************************************************
* Constants / Keys.
**********************************************************/
+ private static final String TAG = "GD_RetrofitBuilder";
+
private static Retrofit baseRetrofit = null;
/**
* Default Cache size when not provided
@@ -35,12 +37,10 @@ public class RetrofitBuilder {
**********************************************************/
/**
* This method will be remove in a close future. Please use the new method.
- *
- * @return
*/
- public static Retrofit getBaseRetrofit() {
+ public static Retrofit getBaseRetrofit(@NonNull String serverBaseUrl) {
if (baseRetrofit == null) {
- baseRetrofit = buildRetrofit(BASE_URL);
+ baseRetrofit = buildRetrofit(serverBaseUrl);
}
return baseRetrofit;
}
@@ -76,7 +76,7 @@ protected static Retrofit buildRetrofit(String baseUrl, OkHttpClient.Builder bui
private static Retrofit buildRetrofit(String baseUrl, @Nullable OkHttpClient.Builder builder, @Nullable String cacheName, int cacheSize) {
if (builder == null) {
builder = new OkHttpClient.Builder()
- .addInterceptor(provideHttpLoggingInterceptor());
+ .addInterceptor(provideHttpLoggingInterceptor());
}
// if(cacheName==null){
// addCache(builder, defaultCacheName, defaultCacheSize);
diff --git a/GDirectionsApiUtils/app/src/main/java/com/android2ee/formation/librairies/google/map/utils/direction/model/GDPoint.java b/GDirectionsApiUtils/app/src/main/java/com/android2ee/formation/librairies/google/map/utils/direction/model/GDPoint.java
index ea05508..859603a 100644
--- a/GDirectionsApiUtils/app/src/main/java/com/android2ee/formation/librairies/google/map/utils/direction/model/GDPoint.java
+++ b/GDirectionsApiUtils/app/src/main/java/com/android2ee/formation/librairies/google/map/utils/direction/model/GDPoint.java
@@ -53,7 +53,6 @@ public class GDPoint implements Parcelable{
/**
* The builder
- * @param coordinate retrieve from JSon
*/
public GDPoint(double lat,double lng) {
super();
diff --git a/GDirectionsApiUtils/app/src/main/java/com/android2ee/formation/librairies/google/map/utils/direction/model/GDirection.java b/GDirectionsApiUtils/app/src/main/java/com/android2ee/formation/librairies/google/map/utils/direction/model/GDirection.java
index 0b112ca..6fd0dc3 100644
--- a/GDirectionsApiUtils/app/src/main/java/com/android2ee/formation/librairies/google/map/utils/direction/model/GDirection.java
+++ b/GDirectionsApiUtils/app/src/main/java/com/android2ee/formation/librairies/google/map/utils/direction/model/GDirection.java
@@ -32,10 +32,10 @@
import android.os.Parcel;
import android.os.Parcelable;
-import java.util.List;
-
import com.google.android.gms.maps.model.LatLng;
+import java.util.List;
+
/**
* @author Mathias Seguy (Android2EE)
* @goals
@@ -72,9 +72,6 @@ public class GDirection implements Parcelable{
public GDirection() {
}
- /**
- * @param pathsList
- */
public GDirection(List legsList) {
super();
this.mLegsList = legsList;
diff --git a/GDirectionsApiUtils/app/src/main/java/com/android2ee/formation/librairies/google/map/utils/direction/util/GDirectionData.java b/GDirectionsApiUtils/app/src/main/java/com/android2ee/formation/librairies/google/map/utils/direction/util/GDirectionData.java
index f4884e2..67ee43b 100644
--- a/GDirectionsApiUtils/app/src/main/java/com/android2ee/formation/librairies/google/map/utils/direction/util/GDirectionData.java
+++ b/GDirectionsApiUtils/app/src/main/java/com/android2ee/formation/librairies/google/map/utils/direction/util/GDirectionData.java
@@ -1,9 +1,12 @@
package com.android2ee.formation.librairies.google.map.utils.direction.util;
+import android.support.annotation.NonNull;
+import android.support.annotation.Nullable;
+
import com.google.android.gms.maps.model.LatLng;
/**
- *
+ *
* @param mode
* The direction mode (driving,walking...)
* @param waypoints
@@ -22,539 +25,563 @@
* the departure time only if we are in transit or driving mode
* @param arrival time
* The arrival time wanted, only if we are in transit mode
-**/
-
+ **/
+@SuppressWarnings({"JavadocReference", "DanglingJavadoc"})
public class GDirectionData {
- /**
- * Mandatory
- * The google Api key to use to be allowed by google server
- * And receive something else than a 200 and empty road.
- * Don't forget to enable billing on the api
- */
- String googleApiKey;
-
- /**
- * start position to the request
- */
- LatLng start;
- /**
- * end position to the request
- */
- LatLng end;
- /**
- * mode The direction mode (driving,walking...)
- */
- Mode mode;
- /**
- * waypoints, The waypoints do you want for the request
- */
- String waypoints;
- /**
- * alternative, alternatives routes ?
- */
- boolean alternative;
- /**
- * avoid, avoid route type ( highways, tolls, ferries)
- */
- Avoid avoid;
- /**
- * language The language (fr, es, ...) need language code here
- */
- String language;
- /**
- * us, The unit system (metric , imperial)
- */
- UnitSystem us;
- /**
- * region, The region (fr, es, ...) need country code here
- */
- String region;
- /**
- * departure_time, the departure time only if we are in transit or driving mode
- */
- String departure_time;
- /**
- * arrival_time, The arrival time wanted, only if we are in transit mode
- */
- String arrival_time;
-
-
- /**
- * Constructor private, we can just build this class by the Builder
- * must have a startPoint and endPoint
- * @param start
- * the start position
- * @param end
- * the end position
- */
- private GDirectionData(LatLng start, LatLng end,String googleApiKey) {
- super();
- this.start = start;
- this.end = end;
- this.googleApiKey=googleApiKey;
- }
-
- /**
- * Get start position
- * @return start Position
- */
- public LatLng getStart() {
- return start;
- }
-
- /**
- * Get end position
- * @return end position
- */
- public LatLng getEnd() {
- return end;
- }
-
- /**
- * Get mode
- * @return mode
- */
- public Mode getMode() {
- return mode;
- }
-
- /**
- * get waypoints
- * @return waypoints
- */
- public String getWaypoints() {
- return waypoints;
- }
-
- /**
- * Get alternative route
- * @return alternative
- */
- public boolean isAlternative() {
- return alternative;
- }
-
- /**
- * Get avoid
- * @return avoid
- */
- public Avoid getAvoid() {
- return avoid;
- }
-
- /**
- * Get language
- * @return language
- */
- public String getLanguage() {
- return language;
- }
-
- /**
- * Get unit system
- * @return unit system
- */
- public UnitSystem getUs() {
- return us;
- }
-
- /**
- * Get region
- * @return region
- */
- public String getRegion() {
- return region;
- }
-
- /**
- * Get departure_time
- * @return departure_time
- */
- public String getDeparture_time() {
- return departure_time;
- }
-
- /**
- * Get arrival_time
- * @return arrival_time
- */
- public String getArrival_time() {
- return arrival_time;
- }
-
- /**
- * Get googleApiKey
- * @return googleApiKey
- */
- public String getGoogleApiKey() {
- return googleApiKey;
- }
-
- /**
- * Builder
- * @author florian
- *
- */
- public static class Builder {
- /**
- * Mandatory
- * The google Api key to use to be allowed by google server
- * And receive something else than a 200 and empty road.
- * Don't forget to enable billing on the api
- */
- String googleApiKey;
- /**
- * start position
- */
- LatLng start;
- /**
- * end position
- */
- LatLng end;
- /**
- * mode The direction mode (driving,walking...)
- */
- Mode mode;
- /**
- * waypoints, The waypoints do you want for the request
- */
- String waypoints;
- /**
- * alternative, alternatives routes ?
- */
- boolean alternative;
- /**
- * avoid, avoid route type ( highways, tolls, ferries)
- */
- Avoid avoid;
- /**
- * language, language type fr, es, etc.
- */
- String language;
- /**
- * us, The unit system (metric , imperial)
- */
- UnitSystem us;
- /**
- * Region, region type fr, es, etc.
- */
- String region;
-
- /**
- * Constructor of the Builder, required start at end always
- * @param start
- * start position
- * @param end
- * end position
- */
- public Builder(LatLng start, LatLng end, String googleApiKey) {
- super();
- this.start = start;
- this.end = end;
- this.googleApiKey=googleApiKey;
- this.mode = null;
- this.waypoints = null;
- this.alternative = false;
- this.avoid = null;
- this.language = null;
- this.us = null;
- this.region = null;
- }
-
- /**
- * Get start position
- * @return start position
- */
- public LatLng getStart() {
- return start;
- }
-
- /**
- * Get end position
- * @return end position
- */
- public LatLng getEnd() {
- return end;
- }
-
- /**
- * Get mode
- * @return mode
- */
- public Mode getMode() {
- return mode;
- }
-
- /**
- * Set Mode
- * @param mode
- * @return builder
- */
- public Builder setMode(Mode mode) {
- this.mode = mode;
- return this;
- }
-
- /**
- * Get waypoints
- * @return waypoints
- */
- public String getWaypoints() {
- return waypoints;
- }
-
- /**
- * Set waypoints
- * @param waypoints
- * @return builder
- */
- public Builder setWaypoints(String waypoints) {
- this.waypoints = waypoints;
- return this;
- }
-
- /**
- * Get alternative
- * @return alternative
- */
- public boolean isAlternative() {
- return alternative;
- }
-
- /**
- * Set Alternatives
- * @param alternative
- * @return builder
- */
- public Builder setAlternative(boolean alternative) {
- this.alternative = alternative;
- return this;
- }
-
- /**
- * Get avoid
- * @return avoid
- */
- public Avoid getAvoid() {
- return avoid;
- }
-
- /**
- * Set Avoid
- * @param avoid
- * @return builder
- */
- public Builder setAvoid(Avoid avoid) {
- this.avoid = avoid;
- return this;
- }
-
- /**
- * Get language
- * @return language
- */
- public String getLanguage() {
- return language;
- }
-
- /**
- * Set language
- * @param language
- * @return builder
- */
- public Builder setLanguage(String language) {
- this.language = language;
- return this;
- }
-
- /**
- * Get unit system
- * @return unit system
- */
- public UnitSystem getUs() {
- return us;
- }
-
- /**
- * Set unit system
- * @param us
- * @return builder
- */
- public Builder setUs(UnitSystem us) {
- this.us = us;
- return this;
- }
-
- /**
- * Get region
- * @return region
- */
- public String getRegion() {
- return region;
- }
-
- /**
- * Set region
- * @param region
- * @return builder
- */
- public Builder setRegion(String region) {
- this.region = region;
- return this;
- }
-
- /**
- * Get the googleApiKey
- * @return googleApiKey
- */
- public String getGoogleApiKey() {
- return googleApiKey;
- }
-
- /**
- * Set the googleApiKey
- * @return googleApiKey
- */
- public Builder setGoogleApiKey(String googleApiKey) {
- this.googleApiKey = googleApiKey;
- return this;
- }
-
- /**
- * Build method, need to construct data to request gDirection of Google
- * @return GDirectionData
- */
- public GDirectionData build() {
- // create object
- GDirectionData result = new GDirectionData(start, end,googleApiKey);
- // insert parameters given
- result.mode = mode;
- result.waypoints = waypoints;
- result.alternative = alternative;
- result.avoid = avoid;
- result.language = language;
- result.us = us;
- result.region = region;
- result.departure_time = null;
- result.arrival_time = null;
- return result;
- }
-
- }
-
- /**
- * Creator :)
- * @author florian
- *
- */
- public abstract static class Creator {
-
- public Builder mBuilder;
-
- public void setBuilder(Builder builder) {
- if (mBuilder != builder) {
- mBuilder = builder;
- }
- }
-
- /**
- * Check if Builder present else throw an error
- */
- protected void checkBuilder() {
- if (mBuilder == null) {
- throw new IllegalArgumentException("Creator requires a valid Builder object");
- }
- }
-
- public abstract GDirectionData build();
-
- }
-
- /**
- * DepartureCreator
- * @author florian
- *
- */
- public static class DepartureCreator extends Creator {
-
- String departure_time;
-
- public DepartureCreator() {
- }
-
- public DepartureCreator(Builder builder) {
- setBuilder(builder);
- }
-
- public String getDeparture_time() {
- return departure_time;
- }
-
- public DepartureCreator setDeparture_time(String departure_time) {
- this.departure_time = departure_time;
- return this;
- }
-
- @Override
- public GDirectionData build() {
- checkBuilder();
- if (mBuilder.getMode() != Mode.MODE_TRANSIT && mBuilder.getMode() != Mode.MODE_DRIVING) {
- throw new IllegalArgumentException("Mode is not correct requires a Transit/Driving mode for the DepartureCreator");
- }
- GDirectionData data = mBuilder.build();
- data.departure_time = departure_time;
- return data;
- }
-
-
- }
-
- /**
- * TransitCreator
- * @author florian
- *
- */
- public static class TansitCreator extends Creator {
-
- String departure_time;
- String arrival_time;
-
- public TansitCreator() {
- }
-
- public TansitCreator(Builder builder) {
- setBuilder(builder);
- }
-
- public String getDeparture_time() {
- return departure_time;
- }
-
- public TansitCreator setDeparture_time(String departure_time) {
- this.departure_time = departure_time;
- return this;
- }
-
- public String getArrival_time() {
- return arrival_time;
- }
-
- public TansitCreator setArrival_time(String arrival_time) {
- this.arrival_time = arrival_time;
- return this;
- }
-
- @Override
- public GDirectionData build() {
- checkBuilder();
- if (mBuilder.getMode() == Mode.MODE_TRANSIT) {
- throw new IllegalArgumentException("Mode is not correct requires a Transit mode for the TransitCreator");
- }
- GDirectionData data = mBuilder.build();
- data.departure_time = departure_time;
- data.arrival_time = arrival_time;
- return data;
- }
- }
+
+ /**
+ * start position to the request
+ */
+ @NonNull
+ private LatLng start;
+ /**
+ * end position to the request
+ */
+ @NonNull
+ private LatLng end;
+ /**
+ * mode The direction mode (driving,walking...)
+ */
+ private Mode mode;
+ /**
+ * waypoints, The waypoints do you want for the request
+ */
+ private String waypoints;
+ /**
+ * alternative, alternatives routes ?
+ */
+ private boolean alternative;
+ /**
+ * avoid, avoid route type ( highways, tolls, ferries)
+ */
+ private Avoid avoid;
+ /**
+ * language The language (fr, es, ...) need language code here
+ */
+ private String language;
+ /**
+ * us, The unit system (metric , imperial)
+ */
+ private UnitSystem us;
+ /**
+ * region, The region (fr, es, ...) need country code here
+ */
+ private String region;
+ /**
+ * departure_time, the departure time only if we are in transit or driving mode
+ */
+ private String departure_time;
+ /**
+ * arrival_time, The arrival time wanted, only if we are in transit mode
+ */
+ private String arrival_time;
+ /**
+ * google_api_key, The Google API key for the Directions API call.
+ * Optional if handled by your own server.
+ */
+ @Nullable
+ private String google_api_key;
+
+ /**
+ * Constructor private, we can just build this class by the Builder
+ * must have a startPoint and endPoint
+ *
+ * @param start the start position
+ * @param end the end position
+ */
+ private GDirectionData(@NonNull LatLng start,
+ @NonNull LatLng end) {
+ super();
+ this.start = start;
+ this.end = end;
+ }
+
+ /**
+ * Get start position
+ *
+ * @return start Position
+ */
+ @NonNull
+ public LatLng getStart() {
+ return start;
+ }
+
+ /**
+ * Get end position
+ *
+ * @return end position
+ */
+ @NonNull
+ public LatLng getEnd() {
+ return end;
+ }
+
+ /**
+ * Get mode
+ *
+ * @return mode
+ */
+ public Mode getMode() {
+ return mode;
+ }
+
+ /**
+ * get waypoints
+ *
+ * @return waypoints
+ */
+ public String getWaypoints() {
+ return waypoints;
+ }
+
+ /**
+ * Get alternative route
+ *
+ * @return alternative
+ */
+ public boolean isAlternative() {
+ return alternative;
+ }
+
+ /**
+ * Get avoid
+ *
+ * @return avoid
+ */
+ public Avoid getAvoid() {
+ return avoid;
+ }
+
+ /**
+ * Get language
+ *
+ * @return language
+ */
+ public String getLanguage() {
+ return language;
+ }
+
+ /**
+ * Get unit system
+ *
+ * @return unit system
+ */
+ public UnitSystem getUs() {
+ return us;
+ }
+
+ /**
+ * Get region
+ *
+ * @return region
+ */
+ public String getRegion() {
+ return region;
+ }
+
+ /**
+ * Get departure_time
+ *
+ * @return departure_time
+ */
+ public String getDeparture_time() {
+ return departure_time;
+ }
+
+ /**
+ * Get arrival_time
+ *
+ * @return arrival_time
+ */
+ public String getArrival_time() {
+ return arrival_time;
+ }
+
+ /**
+ * Get the Google API key.
+ *
+ * @return google_api_key
+ */
+ @Nullable
+ public String getGoogle_api_key() {
+ return google_api_key;
+ }
+
+ /**
+ * Builder
+ *
+ * @author florian
+ */
+ public static class Builder {
+ /**
+ * start position
+ */
+ @NonNull
+ LatLng start;
+ /**
+ * end position
+ */
+ @NonNull
+ LatLng end;
+ /**
+ * mode The direction mode (driving,walking...)
+ */
+ Mode mode;
+ /**
+ * waypoints, The waypoints do you want for the request
+ */
+ String waypoints;
+ /**
+ * alternative, alternatives routes ?
+ */
+ boolean alternative;
+ /**
+ * avoid, avoid route type ( highways, tolls, ferries)
+ */
+ Avoid avoid;
+ /**
+ * language, language type fr, es, etc.
+ */
+ String language;
+ /**
+ * us, The unit system (metric , imperial)
+ */
+ UnitSystem us;
+ /**
+ * Region, region type fr, es, etc.
+ */
+ String region;
+ /**
+ * Google API key (optional)
+ */
+ @Nullable
+ String googleApiKey;
+
+ /**
+ * Constructor of the Builder, required start at end always
+ *
+ * @param start start position
+ * @param end end position
+ */
+ public Builder(@NonNull LatLng start,
+ @NonNull LatLng end) {
+ super();
+ this.start = start;
+ this.end = end;
+ this.mode = null;
+ this.waypoints = null;
+ this.alternative = false;
+ this.avoid = null;
+ this.language = null;
+ this.us = null;
+ this.region = null;
+ this.googleApiKey = null;
+ }
+
+ /**
+ * Get start position
+ *
+ * @return start position
+ */
+ @NonNull
+ public LatLng getStart() {
+ return start;
+ }
+
+ /**
+ * Get end position
+ *
+ * @return end position
+ */
+ @NonNull
+ public LatLng getEnd() {
+ return end;
+ }
+
+ /**
+ * Get mode
+ *
+ * @return mode
+ */
+ public Mode getMode() {
+ return mode;
+ }
+
+ /**
+ * Set Mode
+ *
+ * @return builder
+ */
+ public Builder setMode(Mode mode) {
+ this.mode = mode;
+ return this;
+ }
+
+ /**
+ * Get waypoints
+ *
+ * @return waypoints
+ */
+ public String getWaypoints() {
+ return waypoints;
+ }
+
+ /**
+ * Set waypoints
+ *
+ * @return builder
+ */
+ public Builder setWaypoints(String waypoints) {
+ this.waypoints = waypoints;
+ return this;
+ }
+
+ /**
+ * Get alternative
+ *
+ * @return alternative
+ */
+ public boolean isAlternative() {
+ return alternative;
+ }
+
+ /**
+ * Set Alternatives
+ *
+ * @return builder
+ */
+ public Builder setAlternative(boolean alternative) {
+ this.alternative = alternative;
+ return this;
+ }
+
+ /**
+ * Get avoid
+ *
+ * @return avoid
+ */
+ public Avoid getAvoid() {
+ return avoid;
+ }
+
+ /**
+ * Set Avoid
+ *
+ * @return builder
+ */
+ public Builder setAvoid(Avoid avoid) {
+ this.avoid = avoid;
+ return this;
+ }
+
+ /**
+ * Get language
+ *
+ * @return language
+ */
+ public String getLanguage() {
+ return language;
+ }
+
+ /**
+ * Set language
+ *
+ * @return builder
+ */
+ public Builder setLanguage(String language) {
+ this.language = language;
+ return this;
+ }
+
+ /**
+ * Get unit system
+ *
+ * @return unit system
+ */
+ public UnitSystem getUs() {
+ return us;
+ }
+
+ /**
+ * Set unit system
+ *
+ * @return builder
+ */
+ public Builder setUs(UnitSystem us) {
+ this.us = us;
+ return this;
+ }
+
+ /**
+ * Get region
+ *
+ * @return region
+ */
+ public String getRegion() {
+ return region;
+ }
+
+ /**
+ * Set region
+ *
+ * @return builder
+ */
+ public Builder setRegion(String region) {
+ this.region = region;
+ return this;
+ }
+
+ /**
+ * Set Google API key (optional)
+ *
+ * @return builder
+ */
+ @Nullable
+ public String getGoogleApiKey() {
+ return googleApiKey;
+ }
+
+ /**
+ * Get Google API key (optional)
+ */
+ public void setGoogleApiKey(@Nullable String googleApiKey) {
+ this.googleApiKey = googleApiKey;
+ }
+
+ /**
+ * Build method, need to construct data to request gDirection of Google
+ *
+ * @return GDirectionData
+ */
+ public GDirectionData build() {
+ // create object
+ GDirectionData result = new GDirectionData(start, end);
+ // insert parameters given
+ result.mode = mode;
+ result.waypoints = waypoints;
+ result.alternative = alternative;
+ result.avoid = avoid;
+ result.language = language;
+ result.us = us;
+ result.region = region;
+ result.departure_time = null;
+ result.arrival_time = null;
+ result.google_api_key = googleApiKey;
+ return result;
+ }
+ }
+
+ /**
+ * Creator :)
+ *
+ * @author florian
+ */
+ public abstract static class Creator {
+
+ public Builder mBuilder;
+
+ public void setBuilder(Builder builder) {
+ if (mBuilder != builder) {
+ mBuilder = builder;
+ }
+ }
+
+ /**
+ * Check if Builder present else throw an error
+ */
+ protected void checkBuilder() {
+ if (mBuilder == null) {
+ throw new IllegalArgumentException("Creator requires a valid Builder object");
+ }
+ }
+
+ public abstract GDirectionData build();
+
+ }
+
+ /**
+ * DepartureCreator
+ *
+ * @author florian
+ */
+ public static class DepartureCreator extends Creator {
+
+ String departure_time;
+
+ public DepartureCreator() {
+ }
+
+ public DepartureCreator(Builder builder) {
+ setBuilder(builder);
+ }
+
+ public String getDeparture_time() {
+ return departure_time;
+ }
+
+ public DepartureCreator setDeparture_time(String departure_time) {
+ this.departure_time = departure_time;
+ return this;
+ }
+
+ @Override
+ public GDirectionData build() {
+ checkBuilder();
+ if (mBuilder.getMode() != Mode.MODE_TRANSIT && mBuilder.getMode() != Mode.MODE_DRIVING) {
+ throw new IllegalArgumentException("Mode is not correct requires a Transit/Driving mode for the DepartureCreator");
+ }
+ GDirectionData data = mBuilder.build();
+ data.departure_time = departure_time;
+ return data;
+ }
+ }
+
+ /**
+ * TransitCreator
+ *
+ * @author florian
+ */
+ public static class TansitCreator extends Creator {
+
+ String departure_time;
+ String arrival_time;
+
+ public TansitCreator() {
+ }
+
+ public TansitCreator(Builder builder) {
+ setBuilder(builder);
+ }
+
+ public String getDeparture_time() {
+ return departure_time;
+ }
+
+ public TansitCreator setDeparture_time(String departure_time) {
+ this.departure_time = departure_time;
+ return this;
+ }
+
+ public String getArrival_time() {
+ return arrival_time;
+ }
+
+ public TansitCreator setArrival_time(String arrival_time) {
+ this.arrival_time = arrival_time;
+ return this;
+ }
+
+ @Override
+ public GDirectionData build() {
+ checkBuilder();
+ if (mBuilder.getMode() == Mode.MODE_TRANSIT) {
+ throw new IllegalArgumentException("Mode is not correct requires a Transit mode for the TransitCreator");
+ }
+ GDirectionData data = mBuilder.build();
+ data.departure_time = departure_time;
+ data.arrival_time = arrival_time;
+ return data;
+ }
+ }
}
diff --git a/GDirectionsApiUtils/app/src/main/java/com/android2ee/formation/librairies/google/map/utils/direction/util/GDirectionMapsOptions.java b/GDirectionsApiUtils/app/src/main/java/com/android2ee/formation/librairies/google/map/utils/direction/util/GDirectionMapsOptions.java
index c1aa577..0bdbffe 100644
--- a/GDirectionsApiUtils/app/src/main/java/com/android2ee/formation/librairies/google/map/utils/direction/util/GDirectionMapsOptions.java
+++ b/GDirectionsApiUtils/app/src/main/java/com/android2ee/formation/librairies/google/map/utils/direction/util/GDirectionMapsOptions.java
@@ -1,11 +1,11 @@
package com.android2ee.formation.librairies.google.map.utils.direction.util;
-import java.util.ArrayList;
-
import com.android2ee.formation.librairies.google.map.utils.direction.IGDFormatter;
import com.android2ee.formation.librairies.google.map.utils.direction.model.GDColor;
import com.google.android.gms.maps.model.PolylineOptions;
+import java.util.ArrayList;
+
/**
*
* @param formatter
@@ -16,6 +16,7 @@
* polyline options
**/
+@SuppressWarnings("JavadocReference")
public class GDirectionMapsOptions {
/**
diff --git a/GDirectionsApiUtils/app/src/main/java/com/android2ee/formation/librairies/google/map/utils/direction/view/GMapActivity.java b/GDirectionsApiUtils/app/src/main/java/com/android2ee/formation/librairies/google/map/utils/direction/view/GMapActivity.java
index fbf721e..10ca761 100644
--- a/GDirectionsApiUtils/app/src/main/java/com/android2ee/formation/librairies/google/map/utils/direction/view/GMapActivity.java
+++ b/GDirectionsApiUtils/app/src/main/java/com/android2ee/formation/librairies/google/map/utils/direction/view/GMapActivity.java
@@ -1,16 +1,18 @@
package com.android2ee.formation.librairies.google.map.utils.direction.view;
+import android.content.Context;
+import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
+import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
+import android.text.TextUtils;
import android.util.Log;
import com.android2ee.formation.librairies.google.map.utils.direction.DCACallBack;
import com.android2ee.formation.librairies.google.map.utils.direction.GDirectionsApiUtils;
import com.android2ee.formation.librairies.google.map.utils.direction.model.GDColor;
-import com.android2ee.formation.librairies.google.map.utils.direction.model.GDLegs;
-import com.android2ee.formation.librairies.google.map.utils.direction.model.GDPath;
import com.android2ee.formation.librairies.google.map.utils.direction.model.GDPoint;
import com.android2ee.formation.librairies.google.map.utils.direction.model.GDirection;
import com.android2ee.formation.librairies.google.map.utils.direction.util.Avoid;
@@ -27,7 +29,6 @@
import com.google.android.gms.maps.model.Dot;
import com.google.android.gms.maps.model.Gap;
import com.google.android.gms.maps.model.LatLng;
-import com.google.android.gms.maps.model.Marker;
import com.google.android.gms.maps.model.MarkerOptions;
import com.google.android.gms.maps.model.PatternItem;
import com.google.android.gms.maps.model.PolylineOptions;
@@ -38,54 +39,116 @@
/**
* Created by Harini on 22-06-2017.
+ * Updated by Anthony St. on 22-01-2019.
*/
+@SuppressWarnings("DanglingJavadoc")
public class GMapActivity extends AppCompatActivity implements DCACallBack {
+
/***********************************************************
- * Attributes
+ * Constants/Keys
**********************************************************/
private static final String TAG = "GMapActivity";
- /**
- * The google Api key to use, this one come from the manifest
- * It's used for test
- * You need to uncomment the activity and meta data in the manifest to enable this activity
- * You also need to define (in your gradle) it's an application, not a lib
- * If you want to test
- */
- private static final String GoogleApiKey = "AIzaSyD8l3CwDegfSPPDDPW31QK5XbxnbysoZ5c";//"AIzaSyCkmF88VZEneajCLRXP50NB7Fla3pFG3oE";
+
+ public static final String EXTRA_SERVER_BASE_URL = "extra.server_base_url";
+ public static final String EXTRA_GOOGLE_API_KEY = "extra.google_api_key";
+
+ /***********************************************************
+ * Attributes
+ **********************************************************/
/**
* Represents the Google Map
*/
private GoogleMap mMap;
+ /**
+ * The server base URL
+ */
+ private String serverBaseUrl;
+
+ /**
+ * The Google API key (optional)
+ */
+ @Nullable
+ private String googleApiKey;
+
+ /***********************************************************
+ * Intent Builder
+ **********************************************************/
+ /**
+ * Get intent to start this Activity.
+ *
+ * @param context The context to start the activity.
+ * @param serverBaseUrl The server base URL.
+ * @param googleApiKey The google API key for Directions API
+ * (optional if handled by your own server)
+ * @return The start Intent.
+ */
+ @SuppressWarnings("unused")
+ @NonNull
+ public static Intent getStartIntent(@NonNull Context context,
+ @NonNull String serverBaseUrl,
+ @Nullable String googleApiKey) {
+ Intent intent = new Intent(context, GMapActivity.class);
+ intent.putExtra(EXTRA_SERVER_BASE_URL, serverBaseUrl);
+ intent.putExtra(EXTRA_GOOGLE_API_KEY, googleApiKey);
+ return intent;
+ }
+
+ /***********************************************************
+ * LifeCycle
+ **********************************************************/
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
+
setContentView(R.layout.activity_sample);
+
+ retrieveExtras();
initializeGMap();
}
+ private void retrieveExtras() {
+ if (getIntent() == null || getIntent().getExtras() == null) {
+ serverBaseUrl = GDirectionsApiUtils.BASE_GDIR_URL;
+ //Should not be used
+ googleApiKey = "AIzaSyCkmF88VZEneajCLRXP50NB7Fla3pFG3oE";
+ return;
+ }
+ serverBaseUrl = getIntent().getExtras()
+ .getString(EXTRA_SERVER_BASE_URL, GDirectionsApiUtils.BASE_GDIR_URL);
+ googleApiKey = getIntent().getExtras()
+ .getString(EXTRA_GOOGLE_API_KEY, null);
+ }
+
/**
* Get the Google Direction between mDevice location and the touched location using the Walk
*
- * @param startPoint
- * @param endPoint
+ * @param startPoint The start point as a lat/long
+ * @param endPoint The end point as a lat/long
*/
- private void getDirections(LatLng startPoint, LatLng endPoint) {
- GDirectionData.Builder builder = new GDirectionData.Builder(startPoint, endPoint,GoogleApiKey)
+ private void getDirections(@NonNull LatLng startPoint,
+ @NonNull LatLng endPoint) {
+ GDirectionData.Builder builder = new GDirectionData.Builder(startPoint, endPoint)
.setMode(Mode.MODE_DRIVING)
.setAvoid(Avoid.AVOID_HIGHWAYS)
.setLanguage("fr")
.setAlternative(true)
.setUs(UnitSystem.US_METRIC);
+
+ if (!TextUtils.isEmpty(googleApiKey)) {
+ builder.setGoogleApiKey(googleApiKey);
+ }
+
GDirectionData data = new GDirectionData.DepartureCreator(builder)
.setDeparture_time("now")
.build();
- GDirectionsApiUtils.getDirection(this, data);
+
+ GDirectionsApiUtils.getDirection(serverBaseUrl, this, data);
}
@Override
public void onDirectionLoaded(List directions) {
- ArrayList colors = new ArrayList();
+ ArrayList colors = new ArrayList<>();
colors.add(new GDColor(Color.MAGENTA, BitmapDescriptorFactory.HUE_MAGENTA));
colors.add(new GDColor(Color.BLUE, BitmapDescriptorFactory.HUE_BLUE));
colors.add(new GDColor(Color.RED, BitmapDescriptorFactory.HUE_ORANGE));
@@ -95,7 +158,7 @@ public void onDirectionLoaded(List directions) {
for (int i = 0; i < directions.size(); i++) {
- ArrayList color = new ArrayList();
+ ArrayList color = new ArrayList<>();
color.add(colors.get(i));
if( i != 0 ) {
@@ -124,12 +187,12 @@ public void onDirectionLoaded(List directions) {
Log.d(TAG, "End Latitude : " + path.getLatLng().latitude + " End Longitude : " + path.getLatLng().longitude );
mMap.addMarker(new MarkerOptions().position(directions.get(i).getLegsList().get(0).getPathsList().get(0).getPath().get(0).getLatLng())
- .icon(((colors != null && colors.size() > 0) ?
+ .icon((!colors.isEmpty() ?
BitmapDescriptorFactory.defaultMarker(colors.get(0 % colors.size()).colorPin) :
BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_AZURE))));
mMap.addMarker(new MarkerOptions().position(path.getLatLng())
- .icon(((colors != null && colors.size() > 0) ?
+ .icon((!colors.isEmpty() ?
BitmapDescriptorFactory.defaultMarker(colors.get(0 % colors.size()).colorPin) :
BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_AZURE))));
@@ -141,10 +204,10 @@ public void onDirectionLoaded(List directions) {
@Override
public void onDirectionLoadedFailure() {
-
+ //ignore
}
- /***********************************************************
+ /**********************************************************
* Managing Google Map
**********************************************************/
/**
@@ -158,12 +221,14 @@ public void onDirectionLoadedFailure() {
private void initializeGMap() {
// Obtain the SupportMapFragment and get notified when the map is ready to be used.
SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.vlca_fgt_map);
- mapFragment.getMapAsync(new OnMapReadyCallback() {
- @Override
- public void onMapReady(GoogleMap googleMap) {
- onFinishInitializationGMap(googleMap);
- }
- });
+ if (mapFragment != null) {
+ mapFragment.getMapAsync(new OnMapReadyCallback() {
+ @Override
+ public void onMapReady(GoogleMap googleMap) {
+ onFinishInitializationGMap(googleMap);
+ }
+ });
+ }
}
/**
diff --git a/GDirectionsApiUtils/app/src/main/res/layout/activity_sample.xml b/GDirectionsApiUtils/app/src/main/res/layout/activity_sample.xml
index 1b96913..a3084af 100644
--- a/GDirectionsApiUtils/app/src/main/res/layout/activity_sample.xml
+++ b/GDirectionsApiUtils/app/src/main/res/layout/activity_sample.xml
@@ -1,17 +1,17 @@
+ android:layout_height="match_parent"
+ class="com.google.android.gms.maps.SupportMapFragment"
+ map:mapType="normal"
+ tools:context="com.android2ee.formation.librairies.google.map.utils.direction.view.GMapActivity" />
\ No newline at end of file
diff --git a/GDirectionsApiUtils/app/var_definition.gradle b/GDirectionsApiUtils/app/var_definition.gradle
index 537eba2..464ad23 100644
--- a/GDirectionsApiUtils/app/var_definition.gradle
+++ b/GDirectionsApiUtils/app/var_definition.gradle
@@ -10,11 +10,11 @@ println 'in the var_defintion'
**********************************************************/
project.ext{
- versionName = "1.0.10"
+ versionName = "2.0.0"
compileSdk = 28
minSdk = 14
targetSdk = 28
- versionCode = 10
+ versionCode = 12
useSupportLibVectorDrawable = true
//build var
@@ -27,7 +27,6 @@ project.ext{
//natif tools
buildToolsVersion = "28.0.3"
supportLibVersion = "28.0.0"
- supportAnnotationVersion = "28.0.0"
//natif
androidTestVersion = "1.0.2"
diff --git a/GDirectionsApiUtils/build.gradle b/GDirectionsApiUtils/build.gradle
index 5ee8c75..2a1d5af 100644
--- a/GDirectionsApiUtils/build.gradle
+++ b/GDirectionsApiUtils/build.gradle
@@ -6,7 +6,7 @@ buildscript {
jcenter()
}
dependencies {
- classpath 'com.android.tools.build:gradle:3.2.1'
+ classpath 'com.android.tools.build:gradle:3.3.0'
}
}
diff --git a/GDirectionsApiUtils/gradle/wrapper/gradle-wrapper.properties b/GDirectionsApiUtils/gradle/wrapper/gradle-wrapper.properties
index a9286cc..bb4dc9c 100644
--- a/GDirectionsApiUtils/gradle/wrapper/gradle-wrapper.properties
+++ b/GDirectionsApiUtils/gradle/wrapper/gradle-wrapper.properties
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip