From c0544d85008fb393ce9c8f29fb9b20e71d057b9e Mon Sep 17 00:00:00 2001 From: Ivo van Dongen Date: Tue, 18 Jul 2017 19:14:40 +0200 Subject: [android] remove texture view --- .../java/com/mapbox/mapboxsdk/maps/MapView.java | 18 ++++------- .../mapbox/mapboxsdk/maps/MapboxMapOptions.java | 36 ++-------------------- .../src/main/res-public/values/public.xml | 3 -- .../src/main/res/values/attrs.xml | 3 -- .../activity/annotation/PolygonActivity.java | 2 -- .../src/main/res/layout/fragment_dialog_map.xml | 1 - 6 files changed, 8 insertions(+), 55 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 149a9fbaa2..4d2019d68b 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 @@ -137,7 +137,7 @@ public class MapView extends FrameLayout { } else { getViewTreeObserver().removeGlobalOnLayoutListener(this); } - initialiseDrawingSurface(mapboxMapOptions); + initialiseDrawingSurface(); } }); } @@ -279,17 +279,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( @@ -703,22 +698,6 @@ public class MapboxMapOptions implements Parcelable { return this; } - /** - * Enable TextureView as rendered surface. - *

- * Since the 4.2.0 release we replaced our TextureView with an SurfaceView implemenation. - * Enabling this option will use the deprecated TextureView instead. - *

- * - * @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. @@ -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 CREATOR = new Parcelable.Creator() { 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 @@ - - - diff --git a/platform/android/MapboxGLAndroidSDK/src/main/res/values/attrs.xml b/platform/android/MapboxGLAndroidSDK/src/main/res/values/attrs.xml index 281fe8afe3..b673224094 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/res/values/attrs.xml +++ b/platform/android/MapboxGLAndroidSDK/src/main/res/values/attrs.xml @@ -114,9 +114,6 @@ - - - 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() diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/fragment_dialog_map.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/fragment_dialog_map.xml index afebfa1c47..b8ea3d847e 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/fragment_dialog_map.xml +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/fragment_dialog_map.xml @@ -12,7 +12,6 @@ mapbox:mapbox_cameraTargetLat="47.6077" mapbox:mapbox_cameraTargetLng="-122.3421" mapbox:mapbox_cameraZoom="11" - mapbox:mapbox_renderTextureMode="true" mapbox:mapbox_styleUrl="mapbox://styles/mapbox/streets-v10" /> -- cgit v1.2.1