[android] #4308 - add some simple gesture tests
This commit is contained in:
@@ -11,8 +11,18 @@ public class MapboxMapUtils {
|
||||
* @param mapView
|
||||
* @return
|
||||
*/
|
||||
public static MapboxMap getMapboxMap(MapView mapView){
|
||||
public static MapboxMap getMapboxMap(MapView mapView) {
|
||||
return mapView.getMapboxMap();
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the direction of the user
|
||||
*
|
||||
* @param mapView
|
||||
* @param direction
|
||||
*/
|
||||
public static void setDirection(MapView mapView, double direction) {
|
||||
mapView.setDirection(direction);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.mapbox.mapboxsdk.testapp.robotium;
|
||||
|
||||
import com.mapbox.mapboxsdk.camera.CameraUpdateFactory;
|
||||
import com.mapbox.mapboxsdk.geometry.LatLng;
|
||||
import com.mapbox.mapboxsdk.maps.MapboxMapUtils;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
public class SimpleRotateTest extends BaseMainActivityTest {
|
||||
|
||||
@Override
|
||||
public void setUp() throws Exception {
|
||||
super.setUp();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRotate() {
|
||||
mapboxMap.moveCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(47.376271, 8.539116), 15));
|
||||
double rotation = 0;
|
||||
for (int i = 0; i < 180; i++) {
|
||||
rotation += 1;
|
||||
MapboxMapUtils.setDirection(mapView, rotation);
|
||||
solo.sleep(100);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.mapbox.mapboxsdk.testapp.robotium;
|
||||
|
||||
import com.mapbox.mapboxsdk.camera.CameraUpdateFactory;
|
||||
import com.mapbox.mapboxsdk.constants.MapboxConstants;
|
||||
import com.mapbox.mapboxsdk.geometry.LatLng;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
public class SimpleZoomTest extends BaseMainActivityTest {
|
||||
|
||||
@Override
|
||||
public void setUp() throws Exception {
|
||||
super.setUp();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testZoomIn() {
|
||||
float currentZoomlevel = MapboxConstants.MINIMUM_ZOOM;
|
||||
while (currentZoomlevel < MapboxConstants.MAXIMUM_ZOOM - 5) {
|
||||
mapboxMap.animateCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(47.376271, 8.539116),currentZoomlevel));
|
||||
currentZoomlevel++;
|
||||
solo.sleep(1400);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user