From 4bbdb241a0a47cff3c59432bc5165737c34b9149 Mon Sep 17 00:00:00 2001 From: Tobrun Date: Wed, 24 Jan 2018 12:21:08 +0100 Subject: [android] - rename initRenderSurface to onSurfaceCreated --- .../main/java/com/mapbox/mapboxsdk/maps/MapView.java | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 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 7aa5d268d2..2e7d4c4270 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 @@ -297,7 +297,7 @@ public class MapView extends FrameLayout { mapRenderer = new TextureViewMapRenderer(getContext(), textureView, options.getLocalIdeographFontFamily()) { @Override protected void onSurfaceCreated(GL10 gl, EGLConfig config) { - initRenderSurface(); + MapView.this.onSurfaceCreated(); super.onSurfaceCreated(gl, config); } }; @@ -309,7 +309,7 @@ public class MapView extends FrameLayout { mapRenderer = new GLSurfaceViewMapRenderer(getContext(), glSurfaceView, options.getLocalIdeographFontFamily()) { @Override public void onSurfaceCreated(GL10 gl, EGLConfig config) { - initRenderSurface(); + MapView.this.onSurfaceCreated(); super.onSurfaceCreated(gl, config); } }; @@ -321,16 +321,13 @@ public class MapView extends FrameLayout { nativeMapView.resizeView(getMeasuredWidth(), getMeasuredHeight()); } - private void initRenderSurface() { + private void onSurfaceCreated() { hasSurface = true; - post(new Runnable() { - @Override - public void run() { - // Initialise only when not destroyed and only once - if (!destroyed && mapboxMap == null) { - initialiseMap(); - mapboxMap.onStart(); - } + post(() -> { + // Initialise only when not destroyed and only once + if (!destroyed && mapboxMap == null) { + initialiseMap(); + mapboxMap.onStart(); } }); } -- cgit v1.2.1