[android] - move camera logic to dedicated transform class (#6919)

* [android] - move camera logic to dedicated transform class

post camera updates to the message queue, this makes calling an new camera update in the on finish of another update possible. Simplify transform.java implementation.

* fail the step if instrumentation tests fail, fixup typo
This commit is contained in:
Tobrun
2016-11-23 10:53:39 +01:00
committed by GitHub
parent 4577c56745
commit edb487b74d
13 changed files with 409 additions and 636 deletions

View File

@@ -45,7 +45,7 @@ public class MarkerViewTest {
}
@Test
public void addMarkerTest() {
public void addMarkerViewTest() {
ViewUtils.checkViewIsDisplayed(R.id.mapView);
MapboxMap mapboxMap = rule.getActivity().getMapboxMap();
assertEquals("Markers should be empty", 0, mapboxMap.getMarkers().size());
@@ -107,6 +107,8 @@ public class MarkerViewTest {
public void perform(UiController uiController, View view) {
mapboxMap.getMarkerViewManager().addMarkerViewAdapter(new MarkerViewActivity.TextAdapter(view.getContext(), mapboxMap));
marker = mapboxMap.addMarker(options);
mapboxMap.invalidate();
uiController.loopMainThreadForAtLeast(250);
}
}
@@ -131,11 +133,11 @@ public class MarkerViewTest {
@Override
public void perform(UiController uiController, View view) {
mapboxMap.selectMarker(marker);
mapboxMap.invalidate();
uiController.loopMainThreadForAtLeast(250);
}
}
@After
public void unregisterIdlingResource() {
Espresso.unregisterIdlingResources(idlingResource);

View File

@@ -231,6 +231,7 @@ public class CameraMoveTest {
@Override
public void perform(UiController uiController, View view) {
mapboxMap.moveCamera(cameraUpdate);
uiController.loopMainThreadForAtLeast(100);
}
}
}