From 0cfd9792ff5af2050be3aa16b172014b8e74bdf4 Mon Sep 17 00:00:00 2001 From: Guardiola31337 Date: Wed, 1 Nov 2017 10:27:59 -0700 Subject: [PATCH] adapt code so that it uses mapbox-android-core dependency --- .../testapp/geocoding/GeocodingServiceActivity.java | 6 +++--- .../testapp/geocoding/GeocodingWidgetActivity.java | 6 +++--- .../android/testapp/location/LocationEngineActivity.java | 8 ++++---- mapbox/dependencies.gradle | 1 + .../services/android/location/LostLocationEngine.java | 6 +++--- .../services/android/location/MockLocationEngine.java | 4 ++-- .../mapbox/services/android/MockLocationEngineTest.java | 2 +- mapbox/libandroid-telemetry/build.gradle | 1 + .../services/android/telemetry/MapboxTelemetry.java | 6 +++--- 9 files changed, 21 insertions(+), 19 deletions(-) diff --git a/mapbox/app/src/main/java/com/mapbox/services/android/testapp/geocoding/GeocodingServiceActivity.java b/mapbox/app/src/main/java/com/mapbox/services/android/testapp/geocoding/GeocodingServiceActivity.java index 686bc8020..0c354f99b 100644 --- a/mapbox/app/src/main/java/com/mapbox/services/android/testapp/geocoding/GeocodingServiceActivity.java +++ b/mapbox/app/src/main/java/com/mapbox/services/android/testapp/geocoding/GeocodingServiceActivity.java @@ -13,10 +13,10 @@ import android.widget.TextView; import android.widget.Toast; +import com.mapbox.services.android.core.location.LocationEngine; +import com.mapbox.services.android.core.location.LocationEngineListener; +import com.mapbox.services.android.core.location.LocationEngineProvider; import com.mapbox.services.android.geocoder.AndroidGeocoder; -import com.mapbox.services.android.telemetry.location.LocationEngine; -import com.mapbox.services.android.telemetry.location.LocationEngineListener; -import com.mapbox.services.android.telemetry.location.LocationEngineProvider; import com.mapbox.services.android.testapp.R; import com.mapbox.services.android.testapp.geocoding.service.Constants; import com.mapbox.services.android.testapp.geocoding.service.FetchAddressIntentService; diff --git a/mapbox/app/src/main/java/com/mapbox/services/android/testapp/geocoding/GeocodingWidgetActivity.java b/mapbox/app/src/main/java/com/mapbox/services/android/testapp/geocoding/GeocodingWidgetActivity.java index dcda05ff3..f27534b84 100644 --- a/mapbox/app/src/main/java/com/mapbox/services/android/testapp/geocoding/GeocodingWidgetActivity.java +++ b/mapbox/app/src/main/java/com/mapbox/services/android/testapp/geocoding/GeocodingWidgetActivity.java @@ -13,9 +13,9 @@ import com.mapbox.mapboxsdk.maps.MapView; import com.mapbox.mapboxsdk.maps.MapboxMap; import com.mapbox.mapboxsdk.maps.OnMapReadyCallback; -import com.mapbox.services.android.telemetry.location.LocationEngine; -import com.mapbox.services.android.telemetry.location.LocationEngineListener; -import com.mapbox.services.android.telemetry.location.LocationEngineProvider; +import com.mapbox.services.android.core.location.LocationEngine; +import com.mapbox.services.android.core.location.LocationEngineListener; +import com.mapbox.services.android.core.location.LocationEngineProvider; import com.mapbox.services.android.testapp.R; import com.mapbox.services.android.testapp.Utils; import com.mapbox.services.android.ui.geocoder.GeocoderAutoCompleteView; diff --git a/mapbox/app/src/main/java/com/mapbox/services/android/testapp/location/LocationEngineActivity.java b/mapbox/app/src/main/java/com/mapbox/services/android/testapp/location/LocationEngineActivity.java index 16d0fc862..b0fda072b 100644 --- a/mapbox/app/src/main/java/com/mapbox/services/android/testapp/location/LocationEngineActivity.java +++ b/mapbox/app/src/main/java/com/mapbox/services/android/testapp/location/LocationEngineActivity.java @@ -10,11 +10,11 @@ import android.widget.Spinner; import android.widget.TextView; +import com.mapbox.services.android.core.location.LocationEngine; +import com.mapbox.services.android.core.location.LocationEngineListener; +import com.mapbox.services.android.core.location.LocationEnginePriority; +import com.mapbox.services.android.core.location.LocationEngineProvider; import com.mapbox.services.android.location.MockLocationEngine; -import com.mapbox.services.android.telemetry.location.LocationEngine; -import com.mapbox.services.android.telemetry.location.LocationEngineListener; -import com.mapbox.services.android.telemetry.location.LocationEnginePriority; -import com.mapbox.services.android.telemetry.location.LocationEngineProvider; import com.mapbox.services.android.testapp.R; import com.mapbox.services.commons.models.Position; diff --git a/mapbox/dependencies.gradle b/mapbox/dependencies.gradle index c1877d6ac..bc5baa513 100644 --- a/mapbox/dependencies.gradle +++ b/mapbox/dependencies.gradle @@ -18,6 +18,7 @@ ext { // mapbox mapbox : 'com.mapbox.mapboxsdk:mapbox-android-sdk:5.1.4@aar', + mapboxAndroidCore : 'com.mapbox.mapboxsdk:mapbox-android-core:0.1.1@aar', // gson gson : 'com.google.code.gson:gson:2.8.0', diff --git a/mapbox/libandroid-services/src/main/java/com/mapbox/services/android/location/LostLocationEngine.java b/mapbox/libandroid-services/src/main/java/com/mapbox/services/android/location/LostLocationEngine.java index ee0d39812..4fc06ae0a 100644 --- a/mapbox/libandroid-services/src/main/java/com/mapbox/services/android/location/LostLocationEngine.java +++ b/mapbox/libandroid-services/src/main/java/com/mapbox/services/android/location/LostLocationEngine.java @@ -4,9 +4,9 @@ import android.location.Location; import android.support.annotation.Nullable; -import com.mapbox.services.android.telemetry.location.LocationEngine; -import com.mapbox.services.android.telemetry.location.LocationEngineListener; -import com.mapbox.services.android.telemetry.location.LocationEnginePriority; +import com.mapbox.services.android.core.location.LocationEngine; +import com.mapbox.services.android.core.location.LocationEngineListener; +import com.mapbox.services.android.core.location.LocationEnginePriority; import com.mapzen.android.lost.api.LocationListener; import com.mapzen.android.lost.api.LocationRequest; import com.mapzen.android.lost.api.LocationServices; diff --git a/mapbox/libandroid-services/src/main/java/com/mapbox/services/android/location/MockLocationEngine.java b/mapbox/libandroid-services/src/main/java/com/mapbox/services/android/location/MockLocationEngine.java index 7268a4ddd..8d55b587c 100644 --- a/mapbox/libandroid-services/src/main/java/com/mapbox/services/android/location/MockLocationEngine.java +++ b/mapbox/libandroid-services/src/main/java/com/mapbox/services/android/location/MockLocationEngine.java @@ -6,8 +6,8 @@ import android.support.annotation.Nullable; import com.mapbox.services.Constants; -import com.mapbox.services.android.telemetry.location.LocationEngine; -import com.mapbox.services.android.telemetry.location.LocationEngineListener; +import com.mapbox.services.android.core.location.LocationEngine; +import com.mapbox.services.android.core.location.LocationEngineListener; import com.mapbox.services.api.directions.v5.models.DirectionsRoute; import com.mapbox.services.api.utils.turf.TurfConstants; import com.mapbox.services.api.utils.turf.TurfMeasurement; diff --git a/mapbox/libandroid-services/src/test/java/com/mapbox/services/android/MockLocationEngineTest.java b/mapbox/libandroid-services/src/test/java/com/mapbox/services/android/MockLocationEngineTest.java index d320ec077..217af81c7 100644 --- a/mapbox/libandroid-services/src/test/java/com/mapbox/services/android/MockLocationEngineTest.java +++ b/mapbox/libandroid-services/src/test/java/com/mapbox/services/android/MockLocationEngineTest.java @@ -2,8 +2,8 @@ import android.location.Location; +import com.mapbox.services.android.core.location.LocationEngineListener; import com.mapbox.services.android.location.MockLocationEngine; -import com.mapbox.services.android.telemetry.location.LocationEngineListener; import org.junit.Assert; import org.junit.Test; diff --git a/mapbox/libandroid-telemetry/build.gradle b/mapbox/libandroid-telemetry/build.gradle index cff55d64d..c5780d647 100644 --- a/mapbox/libandroid-telemetry/build.gradle +++ b/mapbox/libandroid-telemetry/build.gradle @@ -26,6 +26,7 @@ android { } dependencies { + compile rootProject.ext.dep.mapboxAndroidCore // Android Support libraries compile rootProject.ext.dep.supportAppcompat diff --git a/mapbox/libandroid-telemetry/src/main/java/com/mapbox/services/android/telemetry/MapboxTelemetry.java b/mapbox/libandroid-telemetry/src/main/java/com/mapbox/services/android/telemetry/MapboxTelemetry.java index 8e6b92873..3f1e25f99 100644 --- a/mapbox/libandroid-telemetry/src/main/java/com/mapbox/services/android/telemetry/MapboxTelemetry.java +++ b/mapbox/libandroid-telemetry/src/main/java/com/mapbox/services/android/telemetry/MapboxTelemetry.java @@ -21,13 +21,13 @@ import android.util.Log; import android.view.WindowManager; +import com.mapbox.services.android.core.location.LocationEngine; +import com.mapbox.services.android.core.location.LocationEngineListener; +import com.mapbox.services.android.core.location.LocationEngineProvider; import com.mapbox.services.android.telemetry.backoff.ExponentialBackoff; import com.mapbox.services.android.telemetry.connectivity.ConnectivityReceiver; import com.mapbox.services.android.telemetry.constants.TelemetryConstants; import com.mapbox.services.android.telemetry.http.TelemetryClient; -import com.mapbox.services.android.telemetry.location.LocationEngine; -import com.mapbox.services.android.telemetry.location.LocationEngineListener; -import com.mapbox.services.android.telemetry.location.LocationEngineProvider; import com.mapbox.services.android.telemetry.navigation.MapboxNavigationEvent; import com.mapbox.services.android.telemetry.permissions.PermissionsManager; import com.mapbox.services.android.telemetry.service.TelemetryService;