diff options
author | Łukasz Paczos <lukasz.paczos@mapbox.com> | 2018-12-19 16:03:10 +0100 |
---|---|---|
committer | Łukasz Paczos <lukasz.paczos@mapbox.com> | 2018-12-20 14:41:27 +0100 |
commit | aa3a788c6b34c40154abf3f0a584d8abc0e85f0d (patch) | |
tree | 100230a2b7530e4c0b7571dcbf1a2927d174ebcf | |
parent | e7375d6a919cd50e3c2e3ebd51dd7b99450e58eb (diff) | |
download | qtlocation-mapboxgl-aa3a788c6b34c40154abf3f0a584d8abc0e85f0d.tar.gz |
[android] reworked instrumentation test activity to use a local style again
3 files changed, 5 insertions, 19 deletions
diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/testapp/utils/OnMapReadyIdlingResource.java b/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/testapp/utils/OnMapReadyIdlingResource.java index 1bcab3932e..7696447289 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/testapp/utils/OnMapReadyIdlingResource.java +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/testapp/utils/OnMapReadyIdlingResource.java @@ -5,6 +5,7 @@ import android.os.Handler; import android.os.Looper; import android.support.annotation.WorkerThread; import android.support.test.espresso.IdlingResource; + import com.mapbox.mapboxsdk.maps.MapView; import com.mapbox.mapboxsdk.maps.MapboxMap; import com.mapbox.mapboxsdk.maps.Style; @@ -35,7 +36,7 @@ public class OnMapReadyIdlingResource implements IdlingResource { private void initMap(MapboxMap mapboxMap) { this.mapboxMap = mapboxMap; - mapboxMap.setStyle(Style.MAPBOX_STREETS); + mapboxMap.setStyle(new Style.Builder().fromUrl("asset://streets.json")); } @Override diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/assets/streets.json b/platform/android/MapboxGLAndroidSDKTestApp/src/main/assets/streets.json index a7ec419347..5ab289344a 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/assets/streets.json +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/assets/streets.json @@ -49,8 +49,8 @@ "ios": "4.4.0" } }, - "center": [-122.4241, 37.78], - "zoom": 9, + "center": [0.0, 0.0], + "zoom": 0, "bearing": 0, "pitch": 0, "sources": { diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/espresso/EspressoTestActivity.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/espresso/EspressoTestActivity.java index d7e3b8eccf..251913dcfb 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/espresso/EspressoTestActivity.java +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/espresso/EspressoTestActivity.java @@ -1,19 +1,16 @@ package com.mapbox.mapboxsdk.testapp.activity.espresso; import android.os.Bundle; -import android.support.annotation.NonNull; import android.support.v7.app.AppCompatActivity; import com.mapbox.mapboxsdk.maps.MapView; import com.mapbox.mapboxsdk.maps.MapboxMap; -import com.mapbox.mapboxsdk.maps.OnMapReadyCallback; -import com.mapbox.mapboxsdk.maps.Style; import com.mapbox.mapboxsdk.testapp.R; /** * Base activity for instrumentation testing. */ -public class EspressoTestActivity extends AppCompatActivity implements OnMapReadyCallback { +public class EspressoTestActivity extends AppCompatActivity { public MapView mapView; protected MapboxMap mapboxMap; @@ -26,18 +23,6 @@ public class EspressoTestActivity extends AppCompatActivity implements OnMapRead // Initialize map as normal mapView = findViewById(R.id.mapView); mapView.onCreate(savedInstanceState); - mapView.getMapAsync(this); - } - - @Override - public void onMapReady(@NonNull final MapboxMap map) { - map.setStyle(new Style.Builder().fromUrl("asset://streets.json"), - style -> mapboxMap = map - ); - } - - public MapboxMap getMapboxMap() { - return mapboxMap; } @Override |