summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortobrun <tobrun.van.nuland@gmail.com>2018-03-06 14:47:58 +0100
committerTobrun <tobrun@mapbox.com>2018-03-06 17:51:58 +0100
commit990999402caca7e149e44a2ac73694d751ed7bc4 (patch)
tree528a153f44a2cc324eb1b27da05e75f8098b3cbb
parent19d08db2e45d14dc02be59b2343c56cb9dd0cc3c (diff)
downloadqtlocation-mapboxgl-990999402caca7e149e44a2ac73694d751ed7bc4.tar.gz
[android] - revert java8 support in the SDK
-rw-r--r--platform/android/MapboxGLAndroidSDK/build.gradle4
-rw-r--r--platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapGestureDetector.java2
-rw-r--r--platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapView.java13
-rw-r--r--platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/Transform.java2
-rw-r--r--platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/offline/OfflineRegion.java84
5 files changed, 68 insertions, 37 deletions
diff --git a/platform/android/MapboxGLAndroidSDK/build.gradle b/platform/android/MapboxGLAndroidSDK/build.gradle
index 94b816c1ab..f82968051d 100644
--- a/platform/android/MapboxGLAndroidSDK/build.gradle
+++ b/platform/android/MapboxGLAndroidSDK/build.gradle
@@ -106,8 +106,8 @@ android {
}
compileOptions {
- sourceCompatibility JavaVersion.VERSION_1_8
- targetCompatibility JavaVersion.VERSION_1_8
+ sourceCompatibility JavaVersion.VERSION_1_7
+ targetCompatibility JavaVersion.VERSION_1_7
}
lintOptions {
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapGestureDetector.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapGestureDetector.java
index 17ade7b5fa..d6bde6c481 100644
--- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapGestureDetector.java
+++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapGestureDetector.java
@@ -764,7 +764,7 @@ final class MapGestureDetector {
}
}
- private Animator createScaleAnimator(double currentZoom, double zoomAddition, PointF animationFocalPoint,
+ private Animator createScaleAnimator(double currentZoom, double zoomAddition, final PointF animationFocalPoint,
long animationTime) {
ValueAnimator animator = ValueAnimator.ofFloat((float) currentZoom, (float) (currentZoom + zoomAddition));
animator.setDuration(animationTime);
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapView.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapView.java
index 4f5ce2c926..79d1abe398 100644
--- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapView.java
+++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapView.java
@@ -313,11 +313,14 @@ public class MapView extends FrameLayout {
private void onSurfaceCreated() {
hasSurface = true;
- post(() -> {
- // Initialise only when not destroyed and only once
- if (!destroyed && mapboxMap == null) {
- initialiseMap();
- mapboxMap.onStart();
+ post(new Runnable() {
+ @Override
+ public void run() {
+ // Initialise only when not destroyed and only once
+ if (!destroyed && mapboxMap == null) {
+ MapView.this.initialiseMap();
+ mapboxMap.onStart();
+ }
}
});
}
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/Transform.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/Transform.java
index 83f853bfc2..f76e54984b 100644
--- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/Transform.java
+++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/Transform.java
@@ -234,7 +234,7 @@ final class Transform implements MapView.OnMapChangedListener {
setZoom(zoom, focalPoint, 0);
}
- void setZoom(double zoom, @NonNull PointF focalPoint, long duration) {
+ void setZoom(double zoom, @NonNull PointF focalPoint, final long duration) {
if (mapView != null) {
mapView.addOnMapChangedListener(new MapView.OnMapChangedListener() {
@Override
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/offline/OfflineRegion.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/offline/OfflineRegion.java
index 090e9576ee..946d3694d5 100644
--- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/offline/OfflineRegion.java
+++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/offline/OfflineRegion.java
@@ -5,7 +5,6 @@ import android.os.Looper;
import android.support.annotation.IntDef;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
-
import com.mapbox.mapboxsdk.LibraryLoader;
import com.mapbox.mapboxsdk.Mapbox;
import com.mapbox.mapboxsdk.storage.FileSource;
@@ -250,9 +249,12 @@ public class OfflineRegion {
@Override
public void onStatusChanged(final OfflineRegionStatus status) {
if (deliverMessages()) {
- handler.post(() -> {
- if (observer != null) {
- observer.onStatusChanged(status);
+ handler.post(new Runnable() {
+ @Override
+ public void run() {
+ if (observer != null) {
+ observer.onStatusChanged(status);
+ }
}
});
}
@@ -261,9 +263,12 @@ public class OfflineRegion {
@Override
public void onError(final OfflineRegionError error) {
if (deliverMessages()) {
- handler.post(() -> {
- if (observer != null) {
- observer.onError(error);
+ handler.post(new Runnable() {
+ @Override
+ public void run() {
+ if (observer != null) {
+ observer.onError(error);
+ }
}
});
}
@@ -272,9 +277,12 @@ public class OfflineRegion {
@Override
public void mapboxTileCountLimitExceeded(final long limit) {
if (deliverMessages()) {
- handler.post(() -> {
- if (observer != null) {
- observer.mapboxTileCountLimitExceeded(limit);
+ handler.post(new Runnable() {
+ @Override
+ public void run() {
+ if (observer != null) {
+ observer.mapboxTileCountLimitExceeded(limit);
+ }
}
});
}
@@ -313,17 +321,23 @@ public class OfflineRegion {
getOfflineRegionStatus(new OfflineRegionStatusCallback() {
@Override
public void onStatus(final OfflineRegionStatus status) {
- handler.post(() -> {
- callback.onStatus(status);
- FileSource.getInstance(Mapbox.getApplicationContext()).deactivate();
+ handler.post(new Runnable() {
+ @Override
+ public void run() {
+ callback.onStatus(status);
+ FileSource.getInstance(Mapbox.getApplicationContext()).deactivate();
+ }
});
}
@Override
public void onError(final String error) {
- handler.post(() -> {
- callback.onError(error);
- FileSource.getInstance(Mapbox.getApplicationContext()).deactivate();
+ handler.post(new Runnable() {
+ @Override
+ public void run() {
+ callback.onError(error);
+ FileSource.getInstance(Mapbox.getApplicationContext()).deactivate();
+ }
});
}
});
@@ -353,19 +367,25 @@ public class OfflineRegion {
deleteOfflineRegion(new OfflineRegionDeleteCallback() {
@Override
public void onDelete() {
- handler.post((Runnable) () -> {
- callback.onDelete();
- FileSource.getInstance(Mapbox.getApplicationContext()).deactivate();
- OfflineRegion.this.finalize();
+ handler.post(new Runnable() {
+ @Override
+ public void run() {
+ callback.onDelete();
+ FileSource.getInstance(Mapbox.getApplicationContext()).deactivate();
+ OfflineRegion.this.finalize();
+ }
});
}
@Override
public void onError(final String error) {
- handler.post(() -> {
- isDeleted = false;
- FileSource.getInstance(Mapbox.getApplicationContext()).deactivate();
- callback.onError(error);
+ handler.post(new Runnable() {
+ @Override
+ public void run() {
+ isDeleted = false;
+ FileSource.getInstance(Mapbox.getApplicationContext()).deactivate();
+ callback.onError(error);
+ }
});
}
});
@@ -386,15 +406,23 @@ public class OfflineRegion {
updateOfflineRegionMetadata(bytes, new OfflineRegionUpdateMetadataCallback() {
@Override
public void onUpdate(final byte[] metadata) {
- handler.post(() -> {
- OfflineRegion.this.metadata = metadata;
- callback.onUpdate(metadata);
+ handler.post(new Runnable() {
+ @Override
+ public void run() {
+ OfflineRegion.this.metadata = metadata;
+ callback.onUpdate(metadata);
+ }
});
}
@Override
public void onError(final String error) {
- handler.post(() -> callback.onError(error));
+ handler.post(new Runnable() {
+ @Override
+ public void run() {
+ callback.onError(error);
+ }
+ });
}
});
}