summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
authorTobrun <tobrun.van.nuland@gmail.com>2018-09-05 09:52:32 +0200
committerTobrun <tobrun@mapbox.com>2018-09-05 12:36:49 +0200
commit5aca8e9ffbc90e9b431869e616f8451b09c352ef (patch)
treea1fed63472d2dfe473a28c9700e502848a802274 /platform
parente5bc05e650a718c948c9fdb7a53c6a233188c95b (diff)
downloadqtlocation-mapboxgl-5aca8e9ffbc90e9b431869e616f8451b09c352ef.tar.gz
[android] - make kotlin activity compatible with sanity tests
Diffstat (limited to 'platform')
-rw-r--r--platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/DraggableMarkerActivity.kt4
1 files changed, 4 insertions, 0 deletions
diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/DraggableMarkerActivity.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/DraggableMarkerActivity.kt
index 48ebc2c154..94282bf7fa 100644
--- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/DraggableMarkerActivity.kt
+++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/DraggableMarkerActivity.kt
@@ -44,6 +44,9 @@ class DraggableMarkerActivity : AppCompatActivity() {
supportActionBar?.height ?: 0
}
+ // View property is required for activity sanity tests
+ // we perform reflection on this requires using findViewById
+ private lateinit var mapView: MapView
private lateinit var mapboxMap: MapboxMap
private val featureCollection = FeatureCollection.fromFeatures(mutableListOf())
private val source = GeoJsonSource(sourceId, featureCollection)
@@ -59,6 +62,7 @@ class DraggableMarkerActivity : AppCompatActivity() {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_draggable_marker)
+ mapView = findViewById(R.id.mapView)
mapView.onCreate(savedInstanceState)
mapView.getMapAsync { mapboxMap ->
this.mapboxMap = mapboxMap