summaryrefslogtreecommitdiff
path: root/platform/android/MapboxGLAndroidSDKTestApp
diff options
context:
space:
mode:
authorChris Loer <chris.loer@gmail.com>2017-12-15 09:12:04 -0800
committerChris Loer <chris.loer@gmail.com>2017-12-15 10:12:41 -0800
commit218dcf2a330b7ad112780c14a4ba6ce5dd94499e (patch)
tree9d570f78b4b45c7e2ac5a25ca68d1d2a37af5b74 /platform/android/MapboxGLAndroidSDKTestApp
parent56f6077ea4b770e35f82a87e0bdb00f4a189d009 (diff)
downloadqtlocation-mapboxgl-218dcf2a330b7ad112780c14a4ba6ce5dd94499e.tar.gz
[android] Add Configuration hook for local ideograph font family and demo activityupstream/android-agua-tinysdf
Diffstat (limited to 'platform/android/MapboxGLAndroidSDKTestApp')
-rw-r--r--platform/android/MapboxGLAndroidSDKTestApp/src/main/AndroidManifest.xml64
-rw-r--r--platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/LocalGlyphActivity.java81
-rw-r--r--platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_local_glyph.xml17
-rw-r--r--platform/android/MapboxGLAndroidSDKTestApp/src/main/res/values/descriptions.xml1
-rw-r--r--platform/android/MapboxGLAndroidSDKTestApp/src/main/res/values/titles.xml2
5 files changed, 142 insertions, 23 deletions
diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/AndroidManifest.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/AndroidManifest.xml
index ee26f39f57..6f311788ba 100644
--- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/AndroidManifest.xml
+++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/AndroidManifest.xml
@@ -367,9 +367,10 @@
android:name="android.support.PARENT_ACTIVITY"
android:value=".activity.FeatureOverviewActivity"/>
</activity>
- <activity android:name=".activity.snapshot.MapSnapshotterActivity"
- android:description="@string/description_map_snapshotter"
- android:label="@string/activity_map_snapshotter">
+ <activity
+ android:name=".activity.snapshot.MapSnapshotterActivity"
+ android:description="@string/description_map_snapshotter"
+ android:label="@string/activity_map_snapshotter">
<meta-data
android:name="@string/category"
android:value="@string/category_imagegenerator"/>
@@ -377,9 +378,10 @@
android:name="android.support.PARENT_ACTIVITY"
android:value=".activity.FeatureOverviewActivity"/>
</activity>
- <activity android:name=".activity.snapshot.MapSnapshotterReuseActivity"
- android:description="@string/description_map_snapshotter_reuse"
- android:label="@string/activity_map_snapshotter_reuse">
+ <activity
+ android:name=".activity.snapshot.MapSnapshotterReuseActivity"
+ android:description="@string/description_map_snapshotter_reuse"
+ android:label="@string/activity_map_snapshotter_reuse">
<meta-data
android:name="@string/category"
android:value="@string/category_imagegenerator"/>
@@ -387,9 +389,10 @@
android:name="android.support.PARENT_ACTIVITY"
android:value=".activity.FeatureOverviewActivity"/>
</activity>
- <activity android:name=".activity.snapshot.MapSnapshotterMarkerActivity"
- android:description="@string/description_map_snapshotter_marker"
- android:label="@string/activity_map_snapshotter_marker">
+ <activity
+ android:name=".activity.snapshot.MapSnapshotterMarkerActivity"
+ android:description="@string/description_map_snapshotter_marker"
+ android:label="@string/activity_map_snapshotter_marker">
<meta-data
android:name="@string/category"
android:value="@string/category_imagegenerator"/>
@@ -586,8 +589,8 @@
</activity>
<activity
android:name=".activity.style.AnimatedImageSourceActivity"
- android:label="@string/activity_animated_image_source"
- android:description="@string/description_animated_image_source">
+ android:description="@string/description_animated_image_source"
+ android:label="@string/activity_animated_image_source">
<meta-data
android:name="@string/category"
android:value="@string/category_style"/>
@@ -720,36 +723,51 @@
android:name="android.support.PARENT_ACTIVITY"
android:value=".activity.FeatureOverviewActivity"/>
</activity>
- <activity android:name=".activity.maplayout.BottomSheetActivity"
- android:description="@string/description_bottom_sheet"
- android:label="@string/activity_bottom_sheet">
+ <activity
+ android:name=".activity.maplayout.BottomSheetActivity"
+ android:description="@string/description_bottom_sheet"
+ android:label="@string/activity_bottom_sheet">
<meta-data
android:name="@string/category"
android:value="@string/category_maplayout"/>
</activity>
<!-- TextureView -->
- <activity android:name=".activity.textureview.TextureViewDebugModeActivity"
- android:description="@string/description_textureview_debug"
- android:label="@string/activity_textureview_debug">
+ <activity
+ android:name=".activity.textureview.TextureViewDebugModeActivity"
+ android:description="@string/description_textureview_debug"
+ android:label="@string/activity_textureview_debug">
<meta-data
android:name="@string/category"
android:value="@string/category_textureview"/>
</activity>
- <activity android:name=".activity.textureview.TextureViewResizeActivity"
- android:description="@string/description_textureview_resize"
- android:label="@string/activity_textureview_resize">
+ <activity
+ android:name=".activity.textureview.TextureViewResizeActivity"
+ android:description="@string/description_textureview_resize"
+ android:label="@string/activity_textureview_resize">
<meta-data
android:name="@string/category"
android:value="@string/category_textureview"/>
</activity>
- <activity android:name=".activity.textureview.TextureViewAnimationActivity"
- android:description="@string/description_textureview_animate"
- android:label="@string/activity_textureview_animate">
+ <activity
+ android:name=".activity.textureview.TextureViewAnimationActivity"
+ android:description="@string/description_textureview_animate"
+ android:label="@string/activity_textureview_animate">
<meta-data
android:name="@string/category"
android:value="@string/category_textureview"/>
</activity>
+ <activity
+ android:name=".activity.maplayout.LocalGlyphActivity"
+ android:description="@string/description_local_glyph"
+ android:label="@string/activity_local_glyph">
+ <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
diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/LocalGlyphActivity.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/LocalGlyphActivity.java
new file mode 100644
index 0000000000..bc07765bf7
--- /dev/null
+++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/LocalGlyphActivity.java
@@ -0,0 +1,81 @@
+package com.mapbox.mapboxsdk.testapp.activity.maplayout;
+
+import android.os.Bundle;
+import android.support.annotation.NonNull;
+import android.support.v7.app.AppCompatActivity;
+
+import com.mapbox.mapboxsdk.camera.CameraPosition;
+import com.mapbox.mapboxsdk.camera.CameraUpdateFactory;
+import com.mapbox.mapboxsdk.geometry.LatLng;
+import com.mapbox.mapboxsdk.maps.MapView;
+import com.mapbox.mapboxsdk.maps.MapboxMap;
+import com.mapbox.mapboxsdk.maps.OnMapReadyCallback;
+import com.mapbox.mapboxsdk.testapp.R;
+
+public class LocalGlyphActivity extends AppCompatActivity {
+ private MapView mapView;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_local_glyph);
+
+ mapView = (MapView) findViewById(R.id.mapView);
+ mapView.onCreate(savedInstanceState);
+ mapView.getMapAsync(new OnMapReadyCallback() {
+ @Override
+ public void onMapReady(@NonNull MapboxMap mapboxMap) {
+ // Set initial position to Suzhou
+ mapboxMap.moveCamera(CameraUpdateFactory.newCameraPosition(
+ new CameraPosition.Builder()
+ .target(new LatLng(31.3003, 120.7457))
+ .zoom(11)
+ .bearing(0)
+ .tilt(0)
+ .build()));
+ }
+ });
+ }
+
+ @Override
+ protected void onStart() {
+ super.onStart();
+ mapView.onStart();
+ }
+
+ @Override
+ protected void onResume() {
+ super.onResume();
+ mapView.onResume();
+ }
+
+ @Override
+ protected void onPause() {
+ super.onPause();
+ mapView.onPause();
+ }
+
+ @Override
+ protected void onStop() {
+ super.onStop();
+ mapView.onStop();
+ }
+
+ @Override
+ public void onLowMemory() {
+ super.onLowMemory();
+ mapView.onLowMemory();
+ }
+
+ @Override
+ protected void onDestroy() {
+ super.onDestroy();
+ mapView.onDestroy();
+ }
+
+ @Override
+ protected void onSaveInstanceState(Bundle outState) {
+ super.onSaveInstanceState(outState);
+ mapView.onSaveInstanceState(outState);
+ }
+}
diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_local_glyph.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_local_glyph.xml
new file mode 100644
index 0000000000..856dd24752
--- /dev/null
+++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_local_glyph.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:tools="http://schemas.android.com/tools"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="vertical"
+ tools:context=".activity.maplayout.LocalGlyphActivity">
+
+ <com.mapbox.mapboxsdk.maps.MapView
+ android:id="@id/mapView"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ app:mapbox_localIdeographFontFamily="Droid Sans" />
+
+</LinearLayout>
diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/values/descriptions.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/values/descriptions.xml
index 33d9638712..7acd8b1ef8 100644
--- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/values/descriptions.xml
+++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/values/descriptions.xml
@@ -67,4 +67,5 @@
<string name="description_textureview_debug">Use TextureView to render the map</string>
<string name="description_textureview_resize">Resize a map rendered on a TextureView</string>
<string name="description_textureview_animate">Animate a map rendered on a TextureView</string>
+ <string name="description_local_glyph">Suzhou using Droid Sans for Chinese glyphs</string>
</resources> \ No newline at end of file
diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/values/titles.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/values/titles.xml
index b90cedc518..c4d13e1068 100644
--- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/values/titles.xml
+++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/values/titles.xml
@@ -67,4 +67,6 @@
<string name="activity_textureview_debug">TextureView debug</string>
<string name="activity_textureview_resize">TextureView resize</string>
<string name="activity_textureview_animate">TextureView animation</string>
+ <string name="activity_grid_source">Grid Source</string>
+ <string name="activity_local_glyph">Local CJK glyph generation</string>
</resources> \ No newline at end of file