summaryrefslogtreecommitdiff
path: root/platform/android/MapboxGLAndroidSDKTestApp
diff options
context:
space:
mode:
authorAsheem Mamoowala <asheem.mamoowala@mapbox.com>2017-12-07 15:50:46 -0800
committerChris Loer <chris.loer@mapbox.com>2017-12-11 10:43:00 -0800
commitbee60130d31f502a0bf4f07f4674c6a8a21619e8 (patch)
tree137e1998d56560efe3f96959a1eaa1378e4d8bd8 /platform/android/MapboxGLAndroidSDKTestApp
parent56aa7dad4f218215f249a9a2484f8c144ecbde9f (diff)
downloadqtlocation-mapboxgl-bee60130d31f502a0bf4f07f4674c6a8a21619e8.tar.gz
[android] Add Configuration hook for local ideograph font family and demo activity
Diffstat (limited to 'platform/android/MapboxGLAndroidSDKTestApp')
-rw-r--r--platform/android/MapboxGLAndroidSDKTestApp/src/main/AndroidManifest.xml68
-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/strings.xml1
-rw-r--r--platform/android/MapboxGLAndroidSDKTestApp/src/main/res/values/titles.xml2
6 files changed, 144 insertions, 26 deletions
diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/AndroidManifest.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/AndroidManifest.xml
index 2ced75fc75..2533c5de35 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"/>
@@ -597,8 +600,8 @@
</activity>
<activity
android:name=".activity.style.GridSourceActivity"
- android:label="@string/title_activity_grid_source"
- android:description="@string/description_grid_source">
+ android:description="@string/description_grid_source"
+ android:label="@string/activity_grid_source">
<meta-data
android:name="@string/category"
android:value="@string/category_style"/>
@@ -730,36 +733,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..c621e2ead0
--- /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_map_simple);
+
+ 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 d0aab04d93..8d82433a3e 100644
--- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/values/descriptions.xml
+++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/values/descriptions.xml
@@ -68,4 +68,5 @@
<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_grid_source">Example Custom Geometry Source</string>
+ <string name="description_local_glyph">Test local glyph generation for CJK ideographs</string>
</resources> \ No newline at end of file
diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/values/strings.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/values/strings.xml
index b2bae9279f..15a916fac9 100644
--- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/values/strings.xml
+++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/values/strings.xml
@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Mapbox Android SDK TestApp</string>
- <string name="title_activity_grid_source">Grid Source</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 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