[android] move style callback invocation to MapboxMap

This commit is contained in:
Łukasz Paczos
2018-12-05 15:32:06 +01:00
committed by Tobrun
parent acbe2475f9
commit f8f8e0b749
10 changed files with 131 additions and 169 deletions

View File

@@ -168,7 +168,6 @@ class LocationComponentTest : BaseActivityTest() {
assertThat(mapboxMap.isLayerVisible(FOREGROUND_LAYER), `is`(true))
assertThat(mapboxMap.isLayerVisible(BACKGROUND_LAYER), `is`(true))
assertThat(mapboxMap.isLayerVisible(SHADOW_LAYER), `is`(true))
assertThat(mapboxMap.isLayerVisible(ACCURACY_LAYER), `is`(true))
assertThat(mapboxMap.isLayerVisible(BEARING_LAYER), `is`(false))
}
}

View File

@@ -41,7 +41,7 @@ fun MapboxMap.waitForLayer(uiController: UiController, location: Location, layer
var counter = 0
val delay = MapboxTestingUtils.MAP_RENDER_DELAY
while (
if (shouldDisappear) this.queryRenderedFeatures(location, layerId).isNotEmpty() else this.queryRenderedFeatures(location, layerId).isEmpty()
if (shouldDisappear) this.queryRenderedFeatures(location, layerId).isNotEmpty() else (this.style == null || this.queryRenderedFeatures(location, layerId).isEmpty())
&& delay * counter < MapboxTestingUtils.RENDER_TIMEOUT) {
uiController.loopMainThreadForAtLeast(delay)
counter++

View File

@@ -504,9 +504,9 @@ public class ExpressionTest extends BaseActivityTest {
validateTestSetup();
invoke(mapboxMap, (uiController, mapboxMap) -> {
LatLng latLng = new LatLng(51, 17);
mapboxMap.addSource(new GeoJsonSource("source", Point.fromLngLat(latLng.getLongitude(), latLng.getLatitude())));
mapboxMap.getStyle().addSource(new GeoJsonSource("source", Point.fromLngLat(latLng.getLongitude(), latLng.getLatitude())));
SymbolLayer layer = new SymbolLayer("layer", "source");
mapboxMap.addLayer(layer);
mapboxMap.getStyle().addLayer(layer);
Formatted formatted = new Formatted(
new FormattedSection("test", 1.5),