From 49e870ce723f7563a78b35a4145303f9f492159e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Paczos?= Date: Fri, 14 Dec 2018 15:49:38 +0100 Subject: [PATCH] [android] dismiss the foreground color only when the style is loaded --- .../main/java/com/mapbox/mapboxsdk/maps/MapView.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 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 cc1ffbbd3df..0f705246533 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 @@ -1002,10 +1002,12 @@ private class InitialRenderCallback implements OnDidFinishRenderingFrameListener @Override public void onDidFinishRenderingFrame(boolean fully) { - renderCount++; - if (renderCount == 2) { - MapView.this.setForeground(null); - removeOnDidFinishRenderingFrameListener(this); + if (mapboxMap != null && mapboxMap.getStyle() != null && mapboxMap.getStyle().isFullyLoaded()) { + renderCount++; + if (renderCount == 3) { + MapView.this.setForeground(null); + removeOnDidFinishRenderingFrameListener(this); + } } }