summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobrun <tobrun.van.nuland@gmail.com>2018-10-18 12:12:07 +0200
committerTobrun <tobrun@mapbox.com>2018-12-19 14:10:32 +0100
commitb50df6612e5d7f74bbac410cf711a2f248c0f3ce (patch)
tree9fcdd3c12bb128e3770ff8a589de47c1b892a268
parent40ba1c5f9ea90033994e2cec7e38de831d095f93 (diff)
downloadqtlocation-mapboxgl-b50df6612e5d7f74bbac410cf711a2f248c0f3ce.tar.gz
[android] - example with recyclerview
-rw-r--r--platform/android/MapboxGLAndroidSDKTestApp/src/main/AndroidManifest.xml11
-rw-r--r--platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/RecyclerViewActivity.kt2
-rw-r--r--platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_recyclerview.xml12
-rw-r--r--platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/item_map.xml12
-rw-r--r--platform/android/MapboxGLAndroidSDKTestApp/src/main/res/values/descriptions.xml1
-rw-r--r--platform/android/MapboxGLAndroidSDKTestApp/src/main/res/values/titles.xml1
6 files changed, 38 insertions, 1 deletions
diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/AndroidManifest.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/AndroidManifest.xml
index 14066123d3..1ec0116047 100644
--- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/AndroidManifest.xml
+++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/AndroidManifest.xml
@@ -873,6 +873,17 @@
android:value=".activity.FeatureOverviewActivity" />
</activity>
+ <activity
+ android:name=".activity.maplayout.RecyclerViewActivity"
+ android:description="@string/description_recyclerview"
+ android:label="@string/activity_recyclerview">
+ <meta-data
+ android:name="@string/category"
+ android:value="@string/category_maplayout" />
+ <meta-data
+ android:name="android.support.PARENT_ACTIVITY"
+ android:value=".activity.FeatureOverviewActivity" />
+ </activity>
<!-- For Instrumentation tests -->
<activity
android:name=".activity.style.RuntimeStyleTestActivity"
diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/RecyclerViewActivity.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/RecyclerViewActivity.kt
index 7dbac1e7a7..d35c977df0 100644
--- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/RecyclerViewActivity.kt
+++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/RecyclerViewActivity.kt
@@ -35,7 +35,7 @@ class RecyclerViewActivity : AppCompatActivity() {
(recyclerView.adapter as ItemAdapter).onSaveInstanceState(outState)
}
- override fun onLowMemory() {gi
+ override fun onLowMemory() {
super.onLowMemory()
// to release memory, we need to call MapView#onLowMemory
(recyclerView.adapter as ItemAdapter).onLowMemory()
diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_recyclerview.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_recyclerview.xml
new file mode 100644
index 0000000000..7d57f112b7
--- /dev/null
+++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_recyclerview.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<android.support.constraint.ConstraintLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+
+ <android.support.v7.widget.RecyclerView
+ android:id="@+id/recyclerView"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent" />
+
+</android.support.constraint.ConstraintLayout> \ No newline at end of file
diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/item_map.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/item_map.xml
new file mode 100644
index 0000000000..c4c17a25ff
--- /dev/null
+++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/item_map.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<com.mapbox.mapboxsdk.maps.MapView
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+ android:id="@id/mapView"
+ android:layout_width="match_parent"
+ android:layout_height="256dp"
+ app:mapbox_cameraTargetLat="45.38301927899065"
+ app:mapbox_cameraTargetLng="8.63525390625"
+ app:mapbox_renderTextureMode="true"
+ app:mapbox_cameraZoom="7"
+ app:mapbox_styleUrl="@string/mapbox_style_mapbox_streets"/>
diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/values/descriptions.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/values/descriptions.xml
index 67447bce74..abd46d4c8c 100644
--- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/values/descriptions.xml
+++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/values/descriptions.xml
@@ -76,4 +76,5 @@
<string name="description_location_modes">Showcases location render and tracking modes</string>
<string name="description_location_fragment">Uses LocationComponent in a Fragment</string>
<string name="description_location_manual">Force location updates and don\'t rely on the engine</string>
+ <string name="description_recyclerview">Show a MapView as a recyclerView item</string>
</resources>
diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/values/titles.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/values/titles.xml
index efd7476c4d..dd7900478b 100644
--- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/values/titles.xml
+++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/values/titles.xml
@@ -76,4 +76,5 @@
<string name="activity_location_modes">Location Modes Activity</string>
<string name="activity_location_fragment">Location Fragment</string>
<string name="activity_location_manual">Manual Location updates</string>
+ <string name="activity_recyclerview">RecyclerView</string>
</resources> \ No newline at end of file