summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapView.java29
1 files changed, 1 insertions, 28 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 1c92b3fe0b..829721744b 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
@@ -5,7 +5,6 @@ import android.graphics.Bitmap;
import android.graphics.PointF;
import android.graphics.drawable.ColorDrawable;
import android.opengl.GLSurfaceView;
-import android.os.Build;
import android.os.Bundle;
import android.support.annotation.CallSuper;
import android.support.annotation.IntDef;
@@ -20,7 +19,6 @@ import android.view.MotionEvent;
import android.view.TextureView;
import android.view.View;
import android.view.ViewGroup;
-import android.view.ViewTreeObserver;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.ZoomButtonsController;
@@ -144,8 +142,7 @@ public class MapView extends FrameLayout implements NativeMapView.ViewCallback {
// add accessibility support
setContentDescription(context.getString(R.string.mapbox_mapActionDescription));
setWillNotDraw(false);
-
- getViewTreeObserver().addOnGlobalLayoutListener(new MapViewLayoutListener(this, options));
+ initialiseDrawingSurface(options);
}
private void initialiseMap() {
@@ -1366,30 +1363,6 @@ public class MapView extends FrameLayout implements NativeMapView.ViewCallback {
void onMapChanged(@MapChange int change);
}
- private static class MapViewLayoutListener implements ViewTreeObserver.OnGlobalLayoutListener {
-
- private WeakReference<MapView> mapViewWeakReference;
- private MapboxMapOptions options;
-
- MapViewLayoutListener(MapView mapView, MapboxMapOptions options) {
- this.mapViewWeakReference = new WeakReference<>(mapView);
- this.options = options;
- }
-
- @Override
- public void onGlobalLayout() {
- MapView mapView = mapViewWeakReference.get();
- if (mapView != null) {
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
- mapView.getViewTreeObserver().removeOnGlobalLayoutListener(this);
- } else {
- mapView.getViewTreeObserver().removeGlobalOnLayoutListener(this);
- }
- mapView.initialiseDrawingSurface(options);
- }
- }
- }
-
private class FocalPointInvalidator implements FocalPointChangeListener {
private final List<FocalPointChangeListener> focalPointChangeListeners = new ArrayList<>();