summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvo van Dongen <info@ivovandongen.nl>2017-07-18 19:14:40 +0200
committerIvo van Dongen <info@ivovandongen.nl>2017-09-18 10:07:03 +0300
commit9b3814f428022d96c1194ecb0898fa16dfc6a168 (patch)
treea48efcb3ebfa4b645e0537c229cc671eaccf86fc
parent1132f18b951305bf550eb4b0998e8335854a6924 (diff)
downloadqtlocation-mapboxgl-9b3814f428022d96c1194ecb0898fa16dfc6a168.tar.gz
[android] remove texture view
-rw-r--r--platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapView.java18
-rw-r--r--platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMapOptions.java36
-rw-r--r--platform/android/MapboxGLAndroidSDK/src/main/res-public/values/public.xml3
-rw-r--r--platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/annotation/PolygonActivity.java2
4 files changed, 8 insertions, 51 deletions
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 4d6189ddcf..1fa53f6515 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
@@ -133,7 +133,7 @@ public class MapView extends FrameLayout {
} else {
getViewTreeObserver().removeGlobalOnLayoutListener(this);
}
- initialiseDrawingSurface(mapboxMapOptions);
+ initialiseDrawingSurface();
}
});
}
@@ -229,17 +229,11 @@ public class MapView extends FrameLayout {
}
}
- private void initialiseDrawingSurface(MapboxMapOptions mapboxMapOptions) {
- if (mapboxMapOptions.getTextureMode()) {
- TextureView textureView = new TextureView(getContext());
- textureView.setSurfaceTextureListener(new SurfaceTextureListener());
- addView(textureView, 0);
- } else {
- SurfaceView surfaceView = (SurfaceView) findViewById(R.id.surfaceView);
- surfaceView.setZOrderMediaOverlay(mapboxMapOptions.getRenderSurfaceOnTop());
- surfaceView.getHolder().addCallback(new SurfaceCallback());
- surfaceView.setVisibility(View.VISIBLE);
- }
+ private void initialiseDrawingSurface() {
+ SurfaceView surfaceView = (SurfaceView) findViewById(R.id.surfaceView);
+ surfaceView.setZOrderMediaOverlay(mapboxMapOptions.getRenderSurfaceOnTop());
+ surfaceView.getHolder().addCallback(new SurfaceCallback());
+ surfaceView.setVisibility(View.VISIBLE);
}
/**
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMapOptions.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMapOptions.java
index 94e2fbcf3b..7b979f5563 100644
--- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMapOptions.java
+++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMapOptions.java
@@ -85,9 +85,6 @@ public class MapboxMapOptions implements Parcelable {
private String apiBaseUrl;
- @Deprecated
- private boolean textureMode;
-
private String style;
/**
@@ -155,7 +152,7 @@ public class MapboxMapOptions implements Parcelable {
style = in.readString();
apiBaseUrl = in.readString();
- textureMode = in.readByte() != 0;
+
prefetchesTiles = in.readByte() != 0;
zMediaOverlay = in.readByte() != 0;
}
@@ -299,8 +296,6 @@ public class MapboxMapOptions implements Parcelable {
ColorUtils.getPrimaryColor(context)));
mapboxMapOptions.myLocationAccuracyThreshold(
typedArray.getFloat(R.styleable.mapbox_MapView_mapbox_myLocationAccuracyThreshold, 0));
- mapboxMapOptions.textureMode(
- typedArray.getBoolean(R.styleable.mapbox_MapView_mapbox_renderTextureMode, false));
mapboxMapOptions.setPrefetchesTiles(
typedArray.getBoolean(R.styleable.mapbox_MapView_mapbox_enableTilePrefetch, true));
mapboxMapOptions.renderSurfaceOnTop(
@@ -704,22 +699,6 @@ public class MapboxMapOptions implements Parcelable {
}
/**
- * Enable TextureView as rendered surface.
- * <p>
- * Since the 4.2.0 release we replaced our TextureView with an SurfaceView implemenation.
- * Enabling this option will use the deprecated TextureView instead.
- * </p>
- *
- * @param textureMode True to enable texture mode
- * @return This
- * @deprecated As of the 4.2.0 release, using TextureView is deprecated.
- */
- public MapboxMapOptions textureMode(boolean textureMode) {
- this.textureMode = textureMode;
- return this;
- }
-
- /**
* Enable tile pre-fetching. Loads tiles at a lower zoom-level to pre-render
* a low resolution preview while more detailed tiles are loaded.
* Enabled by default
@@ -1070,16 +1049,6 @@ public class MapboxMapOptions implements Parcelable {
return debugActive;
}
- /**
- * Returns true if TextureView is being used a render view.
- *
- * @return True if TextureView is used.
- * @deprecated As of the 4.2.0 release, using TextureView is deprecated.
- */
- public boolean getTextureMode() {
- return textureMode;
- }
-
public static final Parcelable.Creator<MapboxMapOptions> CREATOR = new Parcelable.Creator<MapboxMapOptions>() {
public MapboxMapOptions createFromParcel(Parcel in) {
return new MapboxMapOptions(in);
@@ -1143,7 +1112,7 @@ public class MapboxMapOptions implements Parcelable {
dest.writeString(style);
dest.writeString(apiBaseUrl);
- dest.writeByte((byte) (textureMode ? 1 : 0));
+
dest.writeByte((byte) (prefetchesTiles ? 1 : 0));
dest.writeByte((byte) (zMediaOverlay ? 1 : 0));
}
@@ -1320,7 +1289,6 @@ public class MapboxMapOptions implements Parcelable {
result = 31 * result + (myLocationAccuracyThreshold != +0.0f
? Float.floatToIntBits(myLocationAccuracyThreshold) : 0);
result = 31 * result + (apiBaseUrl != null ? apiBaseUrl.hashCode() : 0);
- result = 31 * result + (textureMode ? 1 : 0);
result = 31 * result + (style != null ? style.hashCode() : 0);
result = 31 * result + (prefetchesTiles ? 1 : 0);
result = 31 * result + (zMediaOverlay ? 1 : 0);
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/res-public/values/public.xml b/platform/android/MapboxGLAndroidSDK/src/main/res-public/values/public.xml
index d59eef7427..40045f851f 100644
--- a/platform/android/MapboxGLAndroidSDK/src/main/res-public/values/public.xml
+++ b/platform/android/MapboxGLAndroidSDK/src/main/res-public/values/public.xml
@@ -72,9 +72,6 @@
<public name="mapbox_uiAttributionMarginRight" type="attr" />
<public name="mapbox_uiAttributionMarginBottom" type="attr" />
- <!-- Deprecated to use TextureView-->
- <public name="mapbox_renderTextureMode" type="attr" />
-
<public name="mapbox_enableTilePrefetch" type="attr" />
<public name="mapbox_enableZMediaOverlay" type="attr" />
diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/annotation/PolygonActivity.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/annotation/PolygonActivity.java
index fecfe2a842..49c9663672 100644
--- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/annotation/PolygonActivity.java
+++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/annotation/PolygonActivity.java
@@ -57,8 +57,6 @@ public class PolygonActivity extends AppCompatActivity implements OnMapReadyCall
// configure inital map state
MapboxMapOptions options = new MapboxMapOptions()
.attributionTintColor(RED_COLOR)
- // deprecated feature!
- .textureMode(true)
.compassFadesWhenFacingNorth(false)
.styleUrl(Style.MAPBOX_STREETS)
.camera(new CameraPosition.Builder()