summaryrefslogtreecommitdiff
path: root/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/location/utils/LocationComponentAction.kt
diff options
context:
space:
mode:
authorŁukasz Paczos <lukas.paczos@gmail.com>2018-09-05 14:30:36 +0200
committerŁukasz Paczos <lukasz.paczos@mapbox.com>2018-09-12 13:59:11 +0200
commit907612e93d8a2b156d4604fda348707ccb347836 (patch)
tree830bc854430f31e5f688d3d849fbb81599ea0ce0 /platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/location/utils/LocationComponentAction.kt
parentcf7752c80c1dab6a818fb5093bee5cd964990525 (diff)
downloadqtlocation-mapboxgl-907612e93d8a2b156d4604fda348707ccb347836.tar.gz
[android] updated naming scheme and packages structure for LocationLayerPlugin, now called LocationComponent
Diffstat (limited to 'platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/location/utils/LocationComponentAction.kt')
-rw-r--r--platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/location/utils/LocationComponentAction.kt40
1 files changed, 40 insertions, 0 deletions
diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/location/utils/LocationComponentAction.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/location/utils/LocationComponentAction.kt
new file mode 100644
index 0000000000..ad80a3333e
--- /dev/null
+++ b/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/location/utils/LocationComponentAction.kt
@@ -0,0 +1,40 @@
+package com.mapbox.mapboxsdk.location.utils
+
+import android.content.Context
+import android.support.test.espresso.UiController
+import android.support.test.espresso.ViewAction
+import android.support.test.espresso.matcher.ViewMatchers.isDisplayed
+import android.view.View
+import com.mapbox.mapboxsdk.maps.MapboxMap
+import com.mapbox.mapboxsdk.location.LocationComponent
+import org.hamcrest.Matcher
+
+class LocationComponentAction(private val mapboxMap: MapboxMap,
+ private val onPerformLocationComponentAction: OnPerformLocationComponentAction) : ViewAction {
+
+ override fun getConstraints(): Matcher<View> {
+ return isDisplayed()
+ }
+
+ override fun getDescription(): String {
+ return javaClass.simpleName
+ }
+
+ override fun perform(uiController: UiController, view: View) {
+ val component = mapboxMap.locationComponent
+
+ while (mapboxMap.getSource("mapbox-location-source") == null) {
+ uiController.loopMainThreadForAtLeast(MapboxTestingUtils.MAP_RENDER_DELAY)
+ }
+
+ onPerformLocationComponentAction.onLocationComponentAction(
+ component,
+ mapboxMap,
+ uiController,
+ view.context)
+ }
+
+ interface OnPerformLocationComponentAction {
+ fun onLocationComponentAction(component: LocationComponent, mapboxMap: MapboxMap, uiController: UiController, context: Context)
+ }
+} \ No newline at end of file