[android] reworked instrumentation test activity to use a local style again
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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": {
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user