diff options
author | Tobrun <tobrun.van.nuland@gmail.com> | 2016-11-09 12:56:49 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-09 12:56:49 +0100 |
commit | 33aa14c939cec4b732151b2f864ad84e41cbacd3 (patch) | |
tree | ea3917fa1b7924f935e444775c47b3577a29a870 /platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/maps/MapViewUtils.java | |
parent | 2411ec83b12fd2457f6f22fe5a4de9122503a2e2 (diff) | |
download | qtlocation-mapboxgl-33aa14c939cec4b732151b2f864ad84e41cbacd3.tar.gz |
[android] - instrumentation tests upgrade, move view checking to utility class, remove inheritance in runtime style test (#6803)
update gitignore for generated tests
add camera move test
add realtime geojson to be excluded when generating Activity sanity tests
by default show workaround for showing a MapView in a dialog
add annotation tests
remove older camera tests, introduce tests for move, ease and animate, bring back setLatLng and getLatLng on MapView, add tests for internal camera API.
compass view tests
add tests for attribution and logo.
fix annotation tests
Rename Actiivity test class, split up annotation tests, added MarkerView tests, added infowindow tests, added MyLocationView tests
fix addRemoveLayer test by integrating map interactions inside a ViewAction
Diffstat (limited to 'platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/maps/MapViewUtils.java')
-rw-r--r-- | platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/maps/MapViewUtils.java | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/maps/MapViewUtils.java b/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/maps/MapViewUtils.java new file mode 100644 index 0000000000..da9c3f9c8f --- /dev/null +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/maps/MapViewUtils.java @@ -0,0 +1,37 @@ +package com.mapbox.mapboxsdk.maps; + +import com.mapbox.mapboxsdk.geometry.LatLng; + +/** + * Utility class to bypass package visibility + */ +public class MapViewUtils { + + public static void setDirection(MapView mapView, float direction) { + mapView.setBearing(direction); + } + + public static float getDirection(MapView mapView) { + return (float) mapView.getDirection(); + } + + public static void setTilt(MapView mapView, float tilt) { + mapView.setTilt((double) tilt); + } + + public static float getTilt(MapView mapView) { + return (float) mapView.getTilt(); + } + + public static void setLatLng(MapView mapView, LatLng latLng) { + mapView.setCenterCoordinate(latLng); + } + + public static LatLng getLatLng(MapView mapView) { + return mapView.getCenterCoordinate(); + } + + public static int[] getContentPadding(MapView mapView) { + return new int[]{mapView.getContentPaddingLeft(), mapView.getContentPaddingTop(), mapView.getContentPaddingRight(), mapView.getContentPaddingBottom()}; + } +} |