summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorŁukasz Paczos <lukasz.paczos@mapbox.com>2018-03-16 13:21:11 +0100
committerGitHub <noreply@github.com>2018-03-16 13:21:11 +0100
commitd59646fc1f80caa7420eb4ada61a5d238505c3f6 (patch)
treebe93090c8f7c5a1350fff903a6af66bf7a7cb042
parent146e615baeaf6744921f52326d2cc14df0e95e3f (diff)
downloadqtlocation-mapboxgl-d59646fc1f80caa7420eb4ada61a5d238505c3f6.tar.gz
Test activity for gestures manager (#11449)
-rw-r--r--platform/android/MapboxGLAndroidSDKTestApp/src/main/AndroidManifest.xml292
-rw-r--r--platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/camera/GestureDetectorActivity.java428
-rw-r--r--platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/utils/ResourceUtils.java6
-rw-r--r--platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_gesture_detector.xml26
-rw-r--r--platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/item_gesture_alert.xml14
-rw-r--r--platform/android/MapboxGLAndroidSDKTestApp/src/main/res/menu/menu_gestures.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
8 files changed, 640 insertions, 140 deletions
diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/AndroidManifest.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/AndroidManifest.xml
index 65d7b34b21..442635f909 100644
--- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/AndroidManifest.xml
+++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/AndroidManifest.xml
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="com.mapbox.mapboxsdk.testapp">
+ package="com.mapbox.mapboxsdk.testapp">
- <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
+ <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<application
android:name=".MapboxApplication"
@@ -18,8 +18,9 @@
android:label="@string/app_name"
android:launchMode="singleTop">
<intent-filter>
- <action android:name="android.intent.action.MAIN"/>
- <category android:name="android.intent.category.LAUNCHER"/>
+ <action android:name="android.intent.action.MAIN" />
+
+ <category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
@@ -28,10 +29,10 @@
android:label="@string/activity_info_window">
<meta-data
android:name="@string/category"
- android:value="@string/category_infowindow"/>
+ android:value="@string/category_infowindow" />
<meta-data
android:name="android.support.PARENT_ACTIVITY"
- android:value=".activity.FeatureOverviewActivity"/>
+ android:value=".activity.FeatureOverviewActivity" />
</activity>
<activity
android:name=".activity.infowindow.InfoWindowAdapterActivity"
@@ -39,10 +40,10 @@
android:label="@string/activity_infowindow_adapter">
<meta-data
android:name="@string/category"
- android:value="@string/category_infowindow"/>
+ android:value="@string/category_infowindow" />
<meta-data
android:name="android.support.PARENT_ACTIVITY"
- android:value=".activity.FeatureOverviewActivity"/>
+ android:value=".activity.FeatureOverviewActivity" />
</activity>
<activity
android:name=".activity.infowindow.DynamicInfoWindowAdapterActivity"
@@ -50,10 +51,10 @@
android:label="@string/activity_dynamic_infowindow_adapter">
<meta-data
android:name="@string/category"
- android:value="@string/category_infowindow"/>
+ android:value="@string/category_infowindow" />
<meta-data
android:name="android.support.PARENT_ACTIVITY"
- android:value=".activity.FeatureOverviewActivity"/>
+ android:value=".activity.FeatureOverviewActivity" />
</activity>
<activity
android:name=".activity.annotation.BulkMarkerActivity"
@@ -62,10 +63,10 @@
android:label="@string/activity_add_bulk_markers">
<meta-data
android:name="@string/category"
- android:value="@string/category_annotation"/>
+ android:value="@string/category_annotation" />
<meta-data
android:name="android.support.PARENT_ACTIVITY"
- android:value=".activity.FeatureOverviewActivity"/>
+ android:value=".activity.FeatureOverviewActivity" />
</activity>
<activity
android:name=".activity.annotation.AnimatedMarkerActivity"
@@ -73,10 +74,10 @@
android:label="@string/activity_animated_marker">
<meta-data
android:name="@string/category"
- android:value="@string/category_annotation"/>
+ android:value="@string/category_annotation" />
<meta-data
android:name="android.support.PARENT_ACTIVITY"
- android:value=".activity.FeatureOverviewActivity"/>
+ android:value=".activity.FeatureOverviewActivity" />
</activity>
<activity
android:name=".activity.annotation.DynamicMarkerChangeActivity"
@@ -84,10 +85,10 @@
android:label="@string/activity_dynamic_marker">
<meta-data
android:name="@string/category"
- android:value="@string/category_annotation"/>
+ android:value="@string/category_annotation" />
<meta-data
android:name="android.support.PARENT_ACTIVITY"
- android:value=".activity.FeatureOverviewActivity"/>
+ android:value=".activity.FeatureOverviewActivity" />
</activity>
<activity
android:name=".activity.annotation.PressForMarkerActivity"
@@ -95,10 +96,10 @@
android:label="@string/activity_press_for_marker">
<meta-data
android:name="@string/category"
- android:value="@string/category_annotation"/>
+ android:value="@string/category_annotation" />
<meta-data
android:name="android.support.PARENT_ACTIVITY"
- android:value=".activity.FeatureOverviewActivity"/>
+ android:value=".activity.FeatureOverviewActivity" />
</activity>
<activity
android:name=".activity.camera.CameraAnimationTypeActivity"
@@ -106,10 +107,10 @@
android:label="@string/activity_camera_animation_types">
<meta-data
android:name="@string/category"
- android:value="@string/category_camera"/>
+ android:value="@string/category_camera" />
<meta-data
android:name="android.support.PARENT_ACTIVITY"
- android:value=".activity.FeatureOverviewActivity"/>
+ android:value=".activity.FeatureOverviewActivity" />
</activity>
<activity
android:name=".activity.camera.CameraAnimatorActivity"
@@ -117,10 +118,10 @@
android:label="@string/activity_camera_animator">
<meta-data
android:name="@string/category"
- android:value="@string/category_camera"/>
+ android:value="@string/category_camera" />
<meta-data
android:name="android.support.PARENT_ACTIVITY"
- android:value=".activity.FeatureOverviewActivity"/>
+ android:value=".activity.FeatureOverviewActivity" />
</activity>
<activity
android:name=".activity.camera.CameraPositionActivity"
@@ -128,10 +129,10 @@
android:label="@string/activity_camera_position">
<meta-data
android:name="@string/category"
- android:value="@string/category_camera"/>
+ android:value="@string/category_camera" />
<meta-data
android:name="android.support.PARENT_ACTIVITY"
- android:value=".activity.FeatureOverviewActivity"/>
+ android:value=".activity.FeatureOverviewActivity" />
</activity>
<activity
android:name=".activity.camera.LatLngBoundsActivity"
@@ -140,10 +141,10 @@
android:screenOrientation="portrait">
<meta-data
android:name="@string/category"
- android:value="@string/category_camera"/>
+ android:value="@string/category_camera" />
<meta-data
android:name="android.support.PARENT_ACTIVITY"
- android:value=".activity.FeatureOverviewActivity"/>
+ android:value=".activity.FeatureOverviewActivity" />
</activity>
<activity
android:name=".activity.fragment.MapFragmentActivity"
@@ -151,10 +152,10 @@
android:label="@string/activity_map_fragment">
<meta-data
android:name="@string/category"
- android:value="@string/category_fragment"/>
+ android:value="@string/category_fragment" />
<meta-data
android:name="android.support.PARENT_ACTIVITY"
- android:value=".activity.FeatureOverviewActivity"/>
+ android:value=".activity.FeatureOverviewActivity" />
</activity>
<activity
android:name=".activity.fragment.SupportMapFragmentActivity"
@@ -162,10 +163,10 @@
android:label="@string/activity_map_fragment_suport">
<meta-data
android:name="@string/category"
- android:value="@string/category_fragment"/>
+ android:value="@string/category_fragment" />
<meta-data
android:name="android.support.PARENT_ACTIVITY"
- android:value=".activity.FeatureOverviewActivity"/>
+ android:value=".activity.FeatureOverviewActivity" />
</activity>
<activity
android:name=".activity.fragment.MultiMapActivity"
@@ -173,10 +174,10 @@
android:label="@string/activity_multimap">
<meta-data
android:name="@string/category"
- android:value="@string/category_fragment"/>
+ android:value="@string/category_fragment" />
<meta-data
android:name="android.support.PARENT_ACTIVITY"
- android:value=".activity.FeatureOverviewActivity"/>
+ android:value=".activity.FeatureOverviewActivity" />
</activity>
<activity
android:name=".activity.camera.ManualZoomActivity"
@@ -184,10 +185,10 @@
android:label="@string/activity_camera_zoom">
<meta-data
android:name="@string/category"
- android:value="@string/category_camera"/>
+ android:value="@string/category_camera" />
<meta-data
android:name="android.support.PARENT_ACTIVITY"
- android:value=".activity.FeatureOverviewActivity"/>
+ android:value=".activity.FeatureOverviewActivity" />
</activity>
<activity
android:name=".activity.camera.MaxMinZoomActivity"
@@ -195,10 +196,10 @@
android:label="@string/activity_minmax_zoom">
<meta-data
android:name="@string/category"
- android:value="@string/category_camera"/>
+ android:value="@string/category_camera" />
<meta-data
android:name="android.support.PARENT_ACTIVITY"
- android:value=".activity.FeatureOverviewActivity"/>
+ android:value=".activity.FeatureOverviewActivity" />
</activity>
<activity
android:name=".activity.customlayer.CustomLayerActivity"
@@ -206,10 +207,10 @@
android:label="@string/activity_custom_layer">
<meta-data
android:name="@string/category"
- android:value="@string/category_custom_layer"/>
+ android:value="@string/category_custom_layer" />
<meta-data
android:name="android.support.PARENT_ACTIVITY"
- android:value=".activity.FeatureOverviewActivity"/>
+ android:value=".activity.FeatureOverviewActivity" />
</activity>
<activity
android:name=".activity.annotation.PolygonActivity"
@@ -217,10 +218,10 @@
android:label="@string/activity_polygon">
<meta-data
android:name="@string/category"
- android:value="@string/category_annotation"/>
+ android:value="@string/category_annotation" />
<meta-data
android:name="android.support.PARENT_ACTIVITY"
- android:value=".activity.FeatureOverviewActivity"/>
+ android:value=".activity.FeatureOverviewActivity" />
</activity>
<activity
android:name=".activity.annotation.PolylineActivity"
@@ -228,10 +229,10 @@
android:label="@string/activity_polyline">
<meta-data
android:name="@string/category"
- android:value="@string/category_annotation"/>
+ android:value="@string/category_annotation" />
<meta-data
android:name="android.support.PARENT_ACTIVITY"
- android:value=".activity.FeatureOverviewActivity"/>
+ android:value=".activity.FeatureOverviewActivity" />
</activity>
<activity
android:name=".activity.camera.ScrollByActivity"
@@ -240,10 +241,10 @@
android:theme="@style/NoActionBar">
<meta-data
android:name="@string/category"
- android:value="@string/category_camera"/>
+ android:value="@string/category_camera" />
<meta-data
android:name="android.support.PARENT_ACTIVITY"
- android:value=".activity.FeatureOverviewActivity"/>
+ android:value=".activity.FeatureOverviewActivity" />
</activity>
<activity
android:name=".activity.maplayout.MapPaddingActivity"
@@ -252,10 +253,10 @@
android:screenOrientation="portrait">
<meta-data
android:name="@string/category"
- android:value="@string/category_maplayout"/>
+ android:value="@string/category_maplayout" />
<meta-data
android:name="android.support.PARENT_ACTIVITY"
- android:value=".activity.FeatureOverviewActivity"/>
+ android:value=".activity.FeatureOverviewActivity" />
</activity>
<activity
android:name=".activity.maplayout.DebugModeActivity"
@@ -264,7 +265,7 @@
android:label="@string/activity_debug_mode">
<meta-data
android:name="@string/category"
- android:value="@string/category_basic"/>
+ android:value="@string/category_basic" />
</activity>
<activity
android:name=".activity.offline.OfflineActivity"
@@ -272,10 +273,10 @@
android:label="@string/activity_offline">
<meta-data
android:name="@string/category"
- android:value="@string/category_offline"/>
+ android:value="@string/category_offline" />
<meta-data
android:name="android.support.PARENT_ACTIVITY"
- android:value=".activity.FeatureOverviewActivity"/>
+ android:value=".activity.FeatureOverviewActivity" />
</activity>
<activity
android:name=".activity.offline.UpdateMetadataActivity"
@@ -283,10 +284,10 @@
android:label="@string/activity_update_metadata">
<meta-data
android:name="@string/category"
- android:value="@string/category_offline"/>
+ android:value="@string/category_offline" />
<meta-data
android:name="android.support.PARENT_ACTIVITY"
- android:value=".activity.FeatureOverviewActivity"/>
+ android:value=".activity.FeatureOverviewActivity" />
</activity>
<activity
android:name=".activity.offline.DeleteRegionActivity"
@@ -294,10 +295,10 @@
android:label="@string/activity_offline_region_delete">
<meta-data
android:name="@string/category"
- android:value="@string/category_offline"/>
+ android:value="@string/category_offline" />
<meta-data
android:name="android.support.PARENT_ACTIVITY"
- android:value=".activity.FeatureOverviewActivity"/>
+ android:value=".activity.FeatureOverviewActivity" />
</activity>
<activity
android:name=".activity.imagegenerator.SnapshotActivity"
@@ -305,10 +306,10 @@
android:label="@string/activity_snapshot">
<meta-data
android:name="@string/category"
- android:value="@string/category_imagegenerator"/>
+ android:value="@string/category_imagegenerator" />
<meta-data
android:name="android.support.PARENT_ACTIVITY"
- android:value=".activity.FeatureOverviewActivity"/>
+ android:value=".activity.FeatureOverviewActivity" />
</activity>
<activity
android:name=".activity.snapshot.MapSnapshotterActivity"
@@ -316,10 +317,10 @@
android:label="@string/activity_map_snapshotter">
<meta-data
android:name="@string/category"
- android:value="@string/category_imagegenerator"/>
+ android:value="@string/category_imagegenerator" />
<meta-data
android:name="android.support.PARENT_ACTIVITY"
- android:value=".activity.FeatureOverviewActivity"/>
+ android:value=".activity.FeatureOverviewActivity" />
</activity>
<activity
android:name=".activity.snapshot.MapSnapshotterReuseActivity"
@@ -327,10 +328,10 @@
android:label="@string/activity_map_snapshotter_reuse">
<meta-data
android:name="@string/category"
- android:value="@string/category_imagegenerator"/>
+ android:value="@string/category_imagegenerator" />
<meta-data
android:name="android.support.PARENT_ACTIVITY"
- android:value=".activity.FeatureOverviewActivity"/>
+ android:value=".activity.FeatureOverviewActivity" />
</activity>
<activity
android:name=".activity.snapshot.MapSnapshotterMarkerActivity"
@@ -338,10 +339,10 @@
android:label="@string/activity_map_snapshotter_marker">
<meta-data
android:name="@string/category"
- android:value="@string/category_imagegenerator"/>
+ android:value="@string/category_imagegenerator" />
<meta-data
android:name="android.support.PARENT_ACTIVITY"
- android:value=".activity.FeatureOverviewActivity"/>
+ android:value=".activity.FeatureOverviewActivity" />
</activity>
<activity
android:name=".activity.maplayout.DoubleMapActivity"
@@ -349,10 +350,10 @@
android:label="@string/activity_double_map">
<meta-data
android:name="@string/category"
- android:value="@string/category_maplayout"/>
+ android:value="@string/category_maplayout" />
<meta-data
android:name="android.support.PARENT_ACTIVITY"
- android:value=".activity.FeatureOverviewActivity"/>
+ android:value=".activity.FeatureOverviewActivity" />
</activity>
<activity
android:name=".activity.annotation.MarkerViewActivity"
@@ -360,10 +361,10 @@
android:label="@string/activity_view_marker">
<meta-data
android:name="@string/category"
- android:value="@string/category_annotation"/>
+ android:value="@string/category_annotation" />
<meta-data
android:name="android.support.PARENT_ACTIVITY"
- android:value=".activity.FeatureOverviewActivity"/>
+ android:value=".activity.FeatureOverviewActivity" />
</activity>
<activity
android:name=".activity.fragment.ViewPagerActivity"
@@ -371,10 +372,10 @@
android:label="@string/activity_viewpager">
<meta-data
android:name="@string/category"
- android:value="@string/category_fragment"/>
+ android:value="@string/category_fragment" />
<meta-data
android:name="android.support.PARENT_ACTIVITY"
- android:value=".activity.FeatureOverviewActivity"/>
+ android:value=".activity.FeatureOverviewActivity" />
</activity>
<activity
android:name=".activity.maplayout.SimpleMapActivity"
@@ -382,10 +383,10 @@
android:label="@string/activity_simple_map">
<meta-data
android:name="@string/category"
- android:value="@string/category_basic"/>
+ android:value="@string/category_basic" />
<meta-data
android:name="android.support.PARENT_ACTIVITY"
- android:value=".activity.FeatureOverviewActivity"/>
+ android:value=".activity.FeatureOverviewActivity" />
</activity>
<activity
android:name=".activity.maplayout.MapChangeActivity"
@@ -393,10 +394,10 @@
android:label="@string/activity_map_change">
<meta-data
android:name="@string/category"
- android:value="@string/category_maplayout"/>
+ android:value="@string/category_maplayout" />
<meta-data
android:name="android.support.PARENT_ACTIVITY"
- android:value=".activity.FeatureOverviewActivity"/>
+ android:value=".activity.FeatureOverviewActivity" />
</activity>
<activity
android:name=".activity.maplayout.VisibilityChangeActivity"
@@ -404,10 +405,10 @@
android:label="@string/activity_map_visibility">
<meta-data
android:name="@string/category"
- android:value="@string/category_maplayout"/>
+ android:value="@string/category_maplayout" />
<meta-data
android:name="android.support.PARENT_ACTIVITY"
- android:value=".activity.FeatureOverviewActivity"/>
+ android:value=".activity.FeatureOverviewActivity" />
</activity>
<activity
android:name=".activity.style.RuntimeStyleActivity"
@@ -415,10 +416,10 @@
android:label="@string/activity_runtime_style">
<meta-data
android:name="@string/category"
- android:value="@string/category_style"/>
+ android:value="@string/category_style" />
<meta-data
android:name="android.support.PARENT_ACTIVITY"
- android:value=".activity.FeatureOverviewActivity"/>
+ android:value=".activity.FeatureOverviewActivity" />
</activity>
<activity
android:name=".activity.style.DataDrivenStyleActivity"
@@ -426,10 +427,10 @@
android:label="@string/activity_data_driven_style">
<meta-data
android:name="@string/category"
- android:value="@string/category_style"/>
+ android:value="@string/category_style" />
<meta-data
android:name="android.support.PARENT_ACTIVITY"
- android:value=".activity.FeatureOverviewActivity"/>
+ android:value=".activity.FeatureOverviewActivity" />
</activity>
<activity
android:name=".activity.style.CircleLayerActivity"
@@ -437,10 +438,10 @@
android:label="@string/activity_circle_layer">
<meta-data
android:name="@string/category"
- android:value="@string/category_style"/>
+ android:value="@string/category_style" />
<meta-data
android:name="android.support.PARENT_ACTIVITY"
- android:value=".activity.FeatureOverviewActivity"/>
+ android:value=".activity.FeatureOverviewActivity" />
</activity>
<activity
android:name=".activity.style.FillExtrusionActivity"
@@ -448,10 +449,10 @@
android:label="@string/activity_fill_extrusion_layer">
<meta-data
android:name="@string/category"
- android:value="@string/category_style"/>
+ android:value="@string/category_style" />
<meta-data
android:name="android.support.PARENT_ACTIVITY"
- android:value=".activity.FeatureOverviewActivity"/>
+ android:value=".activity.FeatureOverviewActivity" />
</activity>
<activity
android:name=".activity.style.BuildingFillExtrusionActivity"
@@ -459,10 +460,10 @@
android:label="@string/activity_building_fill_extrusion_layer">
<meta-data
android:name="@string/category"
- android:value="@string/category_style"/>
+ android:value="@string/category_style" />
<meta-data
android:name="android.support.PARENT_ACTIVITY"
- android:value=".activity.FeatureOverviewActivity"/>
+ android:value=".activity.FeatureOverviewActivity" />
</activity>
<activity
android:name=".activity.style.SymbolLayerActivity"
@@ -470,10 +471,10 @@
android:label="@string/activity_symbol_layer">
<meta-data
android:name="@string/category"
- android:value="@string/category_style"/>
+ android:value="@string/category_style" />
<meta-data
android:name="android.support.PARENT_ACTIVITY"
- android:value=".activity.FeatureOverviewActivity"/>
+ android:value=".activity.FeatureOverviewActivity" />
</activity>
<activity
android:name=".activity.style.GeoJsonClusteringActivity"
@@ -481,10 +482,10 @@
android:label="@string/activity_geojson_clustering">
<meta-data
android:name="@string/category"
- android:value="@string/category_style"/>
+ android:value="@string/category_style" />
<meta-data
android:name="android.support.PARENT_ACTIVITY"
- android:value=".activity.FeatureOverviewActivity"/>
+ android:value=".activity.FeatureOverviewActivity" />
</activity>
<activity
android:name=".activity.style.RealTimeGeoJsonActivity"
@@ -492,10 +493,10 @@
android:label="@string/activity_geojson_realtime">
<meta-data
android:name="@string/category"
- android:value="@string/category_style"/>
+ android:value="@string/category_style" />
<meta-data
android:name="android.support.PARENT_ACTIVITY"
- android:value=".activity.FeatureOverviewActivity"/>
+ android:value=".activity.FeatureOverviewActivity" />
</activity>
<activity
android:name=".activity.style.StyleFileActivity"
@@ -503,10 +504,10 @@
android:label="@string/activity_style_file">
<meta-data
android:name="@string/category"
- android:value="@string/category_style"/>
+ android:value="@string/category_style" />
<meta-data
android:name="android.support.PARENT_ACTIVITY"
- android:value=".activity.FeatureOverviewActivity"/>
+ android:value=".activity.FeatureOverviewActivity" />
</activity>
<activity
android:name=".activity.style.CustomSpriteActivity"
@@ -514,10 +515,10 @@
android:label="@string/activity_add_sprite">
<meta-data
android:name="@string/category"
- android:value="@string/category_style"/>
+ android:value="@string/category_style" />
<meta-data
android:name="android.support.PARENT_ACTIVITY"
- android:value=".activity.FeatureOverviewActivity"/>
+ android:value=".activity.FeatureOverviewActivity" />
</activity>
<activity
android:name=".activity.imagegenerator.PrintActivity"
@@ -525,10 +526,10 @@
android:label="@string/activity_print">
<meta-data
android:name="@string/category"
- android:value="@string/category_imagegenerator"/>
+ android:value="@string/category_imagegenerator" />
<meta-data
android:name="android.support.PARENT_ACTIVITY"
- android:value=".activity.FeatureOverviewActivity"/>
+ android:value=".activity.FeatureOverviewActivity" />
</activity>
<activity
android:name=".activity.style.AnimatedImageSourceActivity"
@@ -536,10 +537,10 @@
android:label="@string/activity_animated_image_source">
<meta-data
android:name="@string/category"
- android:value="@string/category_style"/>
+ android:value="@string/category_style" />
<meta-data
android:name="android.support.PARENT_ACTIVITY"
- android:value=".activity.FeatureOverviewActivity"/>
+ android:value=".activity.FeatureOverviewActivity" />
</activity>
<activity
android:name=".activity.style.GridSourceActivity"
@@ -547,10 +548,10 @@
android:label="@string/activity_grid_source">
<meta-data
android:name="@string/category"
- android:value="@string/category_style"/>
+ android:value="@string/category_style" />
<meta-data
android:name="android.support.PARENT_ACTIVITY"
- android:value=".activity.FeatureOverviewActivity"/>
+ android:value=".activity.FeatureOverviewActivity" />
</activity>
<!-- Features -->
<activity
@@ -559,10 +560,10 @@
android:label="@string/activity_query_rendered_feature_properties">
<meta-data
android:name="@string/category"
- android:value="@string/category_features"/>
+ android:value="@string/category_features" />
<meta-data
android:name="android.support.PARENT_ACTIVITY"
- android:value=".activity.FeatureOverviewActivity"/>
+ android:value=".activity.FeatureOverviewActivity" />
</activity>
<activity
android:name=".activity.feature.QueryRenderedFeaturesBoxCountActivity"
@@ -570,10 +571,10 @@
android:label="@string/activity_query_rendered_features_box_count">
<meta-data
android:name="@string/category"
- android:value="@string/category_features"/>
+ android:value="@string/category_features" />
<meta-data
android:name="android.support.PARENT_ACTIVITY"
- android:value=".activity.FeatureOverviewActivity"/>
+ android:value=".activity.FeatureOverviewActivity" />
</activity>
<activity
android:name=".activity.feature.QueryRenderedFeaturesBoxSymbolCountActivity"
@@ -581,10 +582,10 @@
android:label="@string/activity_query_rendered_features_box_symbol_count">
<meta-data
android:name="@string/category"
- android:value="@string/category_features"/>
+ android:value="@string/category_features" />
<meta-data
android:name="android.support.PARENT_ACTIVITY"
- android:value=".activity.FeatureOverviewActivity"/>
+ android:value=".activity.FeatureOverviewActivity" />
</activity>
<activity
android:name=".activity.feature.QueryRenderedFeaturesBoxHighlightActivity"
@@ -592,10 +593,10 @@
android:label="@string/activity_query_rendered_features_box_highlight">
<meta-data
android:name="@string/category"
- android:value="@string/category_features"/>
+ android:value="@string/category_features" />
<meta-data
android:name="android.support.PARENT_ACTIVITY"
- android:value=".activity.FeatureOverviewActivity"/>
+ android:value=".activity.FeatureOverviewActivity" />
</activity>
<activity
android:name=".activity.feature.QuerySourceFeaturesActivity"
@@ -603,10 +604,10 @@
android:label="@string/activity_query_source_features">
<meta-data
android:name="@string/category"
- android:value="@string/category_features"/>
+ android:value="@string/category_features" />
<meta-data
android:name="android.support.PARENT_ACTIVITY"
- android:value=".activity.FeatureOverviewActivity"/>
+ android:value=".activity.FeatureOverviewActivity" />
</activity>
<activity
android:name=".activity.style.SymbolGeneratorActivity"
@@ -614,10 +615,10 @@
android:label="@string/activity_symbol_generator">
<meta-data
android:name="@string/category"
- android:value="@string/category_style"/>
+ android:value="@string/category_style" />
<meta-data
android:name="android.support.PARENT_ACTIVITY"
- android:value=".activity.FeatureOverviewActivity"/>
+ android:value=".activity.FeatureOverviewActivity" />
</activity>
<activity
android:name=".activity.style.ZoomFunctionSymbolLayerActivity"
@@ -625,10 +626,10 @@
android:label="@string/activity_add_remove_markers">
<meta-data
android:name="@string/category"
- android:value="@string/category_style"/>
+ android:value="@string/category_style" />
<meta-data
android:name="android.support.PARENT_ACTIVITY"
- android:value=".activity.FeatureOverviewActivity"/>
+ android:value=".activity.FeatureOverviewActivity" />
</activity>
<activity
android:name=".activity.maplayout.MapInDialogActivity"
@@ -636,10 +637,10 @@
android:label="@string/activity_map_in_dialog">
<meta-data
android:name="@string/category"
- android:value="@string/category_maplayout"/>
+ android:value="@string/category_maplayout" />
<meta-data
android:name="android.support.PARENT_ACTIVITY"
- android:value=".activity.FeatureOverviewActivity"/>
+ android:value=".activity.FeatureOverviewActivity" />
</activity>
<activity
android:name=".activity.annotation.MarkerViewsInRectangleActivity"
@@ -647,10 +648,10 @@
android:label="@string/activity_marker_view_rectangle">
<meta-data
android:name="@string/category"
- android:value="@string/category_annotation"/>
+ android:value="@string/category_annotation" />
<meta-data
android:name="android.support.PARENT_ACTIVITY"
- android:value=".activity.FeatureOverviewActivity"/>
+ android:value=".activity.FeatureOverviewActivity" />
</activity>
<activity
android:name=".activity.maplayout.LatLngBoundsForCameraActivity"
@@ -658,10 +659,10 @@
android:label="@string/activity_restricted_bounds">
<meta-data
android:name="@string/category"
- android:value="@string/category_maplayout"/>
+ android:value="@string/category_maplayout" />
<meta-data
android:name="android.support.PARENT_ACTIVITY"
- android:value=".activity.FeatureOverviewActivity"/>
+ android:value=".activity.FeatureOverviewActivity" />
</activity>
<!-- Storage -->
@@ -671,10 +672,10 @@
android:label="@string/activity_url_transform">
<meta-data
android:name="@string/category"
- android:value="@string/category_storage"/>
+ android:value="@string/category_storage" />
<meta-data
android:name="android.support.PARENT_ACTIVITY"
- android:value=".activity.FeatureOverviewActivity"/>
+ android:value=".activity.FeatureOverviewActivity" />
</activity>
<activity
android:name=".activity.maplayout.BottomSheetActivity"
@@ -682,7 +683,7 @@
android:label="@string/activity_bottom_sheet">
<meta-data
android:name="@string/category"
- android:value="@string/category_maplayout"/>
+ android:value="@string/category_maplayout" />
</activity>
<!-- TextureView -->
@@ -692,7 +693,7 @@
android:label="@string/activity_textureview_debug">
<meta-data
android:name="@string/category"
- android:value="@string/category_textureview"/>
+ android:value="@string/category_textureview" />
</activity>
<activity
android:name=".activity.textureview.TextureViewResizeActivity"
@@ -700,7 +701,7 @@
android:label="@string/activity_textureview_resize">
<meta-data
android:name="@string/category"
- android:value="@string/category_textureview"/>
+ android:value="@string/category_textureview" />
</activity>
<activity
android:name=".activity.textureview.TextureViewTransparentBackgroundActivity"
@@ -708,10 +709,10 @@
android:label="@string/activity_textureview_transparent">
<meta-data
android:name="@string/category"
- android:value="@string/category_textureview"/>
+ android:value="@string/category_textureview" />
<meta-data
android:name="android.support.PARENT_ACTIVITY"
- android:value=".activity.FeatureOverviewActivity"/>
+ android:value=".activity.FeatureOverviewActivity" />
</activity>
<activity
android:name=".activity.textureview.TextureViewAnimationActivity"
@@ -719,7 +720,7 @@
android:label="@string/activity_textureview_animate">
<meta-data
android:name="@string/category"
- android:value="@string/category_textureview"/>
+ android:value="@string/category_textureview" />
</activity>
<activity
android:name=".activity.maplayout.LocalGlyphActivity"
@@ -727,10 +728,10 @@
android:label="@string/activity_local_glyph">
<meta-data
android:name="@string/category"
- android:value="@string/category_maplayout"/>
+ android:value="@string/category_maplayout" />
<meta-data
android:name="android.support.PARENT_ACTIVITY"
- android:value=".activity.FeatureOverviewActivity"/>
+ android:value=".activity.FeatureOverviewActivity" />
</activity>
<activity
android:name=".activity.style.HillshadeLayerActivity"
@@ -738,10 +739,10 @@
android:label="@string/activity_hillshade">
<meta-data
android:name="@string/category"
- android:value="@string/category_style"/>
+ android:value="@string/category_style" />
<meta-data
android:name="android.support.PARENT_ACTIVITY"
- android:value=".activity.FeatureOverviewActivity"/>
+ android:value=".activity.FeatureOverviewActivity" />
</activity>
<activity
android:name=".activity.style.HeatmapLayerActivity"
@@ -749,32 +750,43 @@
android:label="@string/activity_heatmaplayer">
<meta-data
android:name="@string/category"
- android:value="@string/category_style"/>
+ android:value="@string/category_style" />
+ <meta-data
+ android:name="android.support.PARENT_ACTIVITY"
+ android:value=".activity.FeatureOverviewActivity" />
+ </activity>
+ <activity
+ android:name=".activity.camera.GestureDetectorActivity"
+ android:label="@string/activity_gesture_detector"
+ android:description="@string/description_gesture_detector">
+ <meta-data
+ android:name="@string/category"
+ android:value="@string/category_camera" />
<meta-data
android:name="android.support.PARENT_ACTIVITY"
- android:value=".activity.FeatureOverviewActivity"/>
+ android:value="com.mapbox.mapboxsdk.testapp.activity.FeatureOverviewActivity" />
</activity>
<!-- For Instrumentation tests -->
<activity
android:name=".activity.style.RuntimeStyleTestActivity"
- android:screenOrientation="portrait"/>
+ android:screenOrientation="portrait" />
<activity
android:name=".activity.style.RuntimeStyleTimingTestActivity"
- android:screenOrientation="portrait"/>
+ android:screenOrientation="portrait" />
<activity
android:name=".activity.espresso.EspressoTestActivity"
- android:screenOrientation="portrait"/>
+ android:screenOrientation="portrait" />
<activity
android:name=".activity.style.FillExtrusionStyleTestActivity"
- android:screenOrientation="portrait"/>
+ android:screenOrientation="portrait" />
<!-- Configuration Settings -->
<meta-data
android:name="com.mapbox.TestEventsServer"
- android:value="api-events-staging.tilestream.net"/>
+ android:value="api-events-staging.tilestream.net" />
<meta-data
android:name="com.mapbox.TestEventsAccessToken"
- android:value="pk.eyJ1IjoiYmxzdGFnaW5nIiwiYSI6ImNpdDF3OHpoaTAwMDcyeXA5Y3Z0Nmk2dzEifQ.0IfB7v5Qbm2MGVYt8Kb8fg"/>
+ android:value="pk.eyJ1IjoiYmxzdGFnaW5nIiwiYSI6ImNpdDF3OHpoaTAwMDcyeXA5Y3Z0Nmk2dzEifQ.0IfB7v5Qbm2MGVYt8Kb8fg" />
<!-- Comment out this setting to switch to external storage (and disable internal) in your app -->
<!-- <meta-data -->
@@ -782,4 +794,4 @@
<!-- android:value="true" /> -->
</application>
-</manifest>
+</manifest> \ No newline at end of file
diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/camera/GestureDetectorActivity.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/camera/GestureDetectorActivity.java
new file mode 100644
index 0000000000..2b79e2691d
--- /dev/null
+++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/camera/GestureDetectorActivity.java
@@ -0,0 +1,428 @@
+package com.mapbox.mapboxsdk.testapp.activity.camera;
+
+import android.graphics.Typeface;
+import android.os.Bundle;
+import android.os.Handler;
+import android.support.annotation.ColorInt;
+import android.support.annotation.IntDef;
+import android.support.annotation.Nullable;
+import android.support.v4.content.ContextCompat;
+import android.support.v7.app.AppCompatActivity;
+import android.support.v7.widget.LinearLayoutManager;
+import android.support.v7.widget.RecyclerView;
+import android.view.LayoutInflater;
+import android.view.Menu;
+import android.view.MenuItem;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.RelativeLayout;
+import android.widget.TextView;
+
+import com.mapbox.android.gestures.AndroidGesturesManager;
+import com.mapbox.android.gestures.MoveGestureDetector;
+import com.mapbox.android.gestures.RotateGestureDetector;
+import com.mapbox.android.gestures.ShoveGestureDetector;
+import com.mapbox.android.gestures.StandardScaleGestureDetector;
+import com.mapbox.mapboxsdk.annotations.Marker;
+import com.mapbox.mapboxsdk.annotations.MarkerOptions;
+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;
+import com.mapbox.mapboxsdk.testapp.utils.FontCache;
+import com.mapbox.mapboxsdk.testapp.utils.ResourceUtils;
+
+import java.lang.annotation.Retention;
+import java.util.ArrayList;
+import java.util.List;
+
+import static java.lang.annotation.RetentionPolicy.SOURCE;
+
+/**
+ * Test activity showcasing APIs around gestures implementation.
+ */
+public class GestureDetectorActivity extends AppCompatActivity {
+
+ private static final int MAX_NUMBER_OF_ALERTS = 30;
+
+ private MapView mapView;
+ private MapboxMap mapboxMap;
+ private RecyclerView recyclerView;
+ private GestureAlertsAdapter gestureAlertsAdapter;
+
+ private AndroidGesturesManager gesturesManager;
+
+ @Nullable
+ private Marker marker;
+ @Nullable
+ private LatLng focalPointLatLng;
+ private boolean animationsEnabled = true;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_gesture_detector);
+
+ mapView = (MapView) findViewById(R.id.mapView);
+ mapView.onCreate(savedInstanceState);
+ mapView.getMapAsync(new OnMapReadyCallback() {
+ @Override
+ public void onMapReady(MapboxMap mapboxMap) {
+ GestureDetectorActivity.this.mapboxMap = mapboxMap;
+ initializeMap();
+ }
+ });
+
+ recyclerView = (RecyclerView) findViewById(R.id.alerts_recycler);
+ recyclerView.setLayoutManager(new LinearLayoutManager(this));
+
+ gestureAlertsAdapter = new GestureAlertsAdapter();
+ recyclerView.setAdapter(gestureAlertsAdapter);
+ }
+
+ @Override
+ protected void onResume() {
+ super.onResume();
+ mapView.onResume();
+ }
+
+ @Override
+ protected void onPause() {
+ super.onPause();
+ gestureAlertsAdapter.cancelUpdates();
+ mapView.onPause();
+ }
+
+ @Override
+ protected void onStart() {
+ super.onStart();
+ mapView.onStart();
+ }
+
+ @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);
+ }
+
+ private void initializeMap() {
+ gesturesManager = mapboxMap.getGesturesManager();
+
+ RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) recyclerView.getLayoutParams();
+ layoutParams.height = (int) (mapView.getHeight() / 1.75);
+ layoutParams.width = (mapView.getWidth() / 3);
+ recyclerView.setLayoutParams(layoutParams);
+
+ attachListeners();
+ }
+
+ public void attachListeners() {
+ mapboxMap.addOnMoveListener(new MapboxMap.OnMoveListener() {
+ @Override
+ public void onMoveBegin(MoveGestureDetector detector) {
+ gestureAlertsAdapter.addAlert(new GestureAlert(GestureAlert.TYPE_START, "MOVE START"));
+ }
+
+ @Override
+ public void onMove(MoveGestureDetector detector) {
+ gestureAlertsAdapter.addAlert(new GestureAlert(GestureAlert.TYPE_PROGRESS, "MOVE PROGRESS"));
+ }
+
+ @Override
+ public void onMoveEnd(MoveGestureDetector detector) {
+ gestureAlertsAdapter.addAlert(new GestureAlert(GestureAlert.TYPE_END, "MOVE END"));
+ }
+ });
+
+ mapboxMap.addOnRotateListener(new MapboxMap.OnRotateListener() {
+ @Override
+ public void onRotateBegin(RotateGestureDetector detector) {
+ gestureAlertsAdapter.addAlert(new GestureAlert(GestureAlert.TYPE_START, "ROTATE START"));
+ }
+
+ @Override
+ public void onRotate(RotateGestureDetector detector) {
+ gestureAlertsAdapter.addAlert(new GestureAlert(GestureAlert.TYPE_PROGRESS, "ROTATE PROGRESS"));
+ recalculateFocalPoint();
+ }
+
+ @Override
+ public void onRotateEnd(RotateGestureDetector detector) {
+ gestureAlertsAdapter.addAlert(new GestureAlert(GestureAlert.TYPE_END, "ROTATE END"));
+ }
+ });
+
+ mapboxMap.addOnScaleListener(new MapboxMap.OnScaleListener() {
+ @Override
+ public void onScaleBegin(StandardScaleGestureDetector detector) {
+ gestureAlertsAdapter.addAlert(new GestureAlert(GestureAlert.TYPE_START, "SCALE START"));
+ if (focalPointLatLng != null) {
+ gestureAlertsAdapter.addAlert(new GestureAlert(GestureAlert.TYPE_OTHER, "INCREASING MOVE THRESHOLD"));
+ gesturesManager.getMoveGestureDetector().setMoveThreshold(
+ ResourceUtils.convertDpToPx(GestureDetectorActivity.this, 175));
+
+ gestureAlertsAdapter.addAlert(new GestureAlert(GestureAlert.TYPE_OTHER, "MANUALLY INTERRUPTING MOVE"));
+ gesturesManager.getMoveGestureDetector().interrupt();
+ }
+ recalculateFocalPoint();
+ }
+
+ @Override
+ public void onScale(StandardScaleGestureDetector detector) {
+ gestureAlertsAdapter.addAlert(new GestureAlert(GestureAlert.TYPE_PROGRESS, "SCALE PROGRESS"));
+ }
+
+ @Override
+ public void onScaleEnd(StandardScaleGestureDetector detector) {
+ gestureAlertsAdapter.addAlert(new GestureAlert(GestureAlert.TYPE_END, "SCALE END"));
+
+ if (focalPointLatLng != null) {
+ gestureAlertsAdapter.addAlert(new GestureAlert(GestureAlert.TYPE_OTHER, "REVERTING MOVE THRESHOLD"));
+ gesturesManager.getMoveGestureDetector().setMoveThreshold(
+ gesturesManager.getMoveGestureDetector().getDefaultMoveThreshold()
+ );
+ }
+ }
+ });
+
+ mapboxMap.addOnShoveListener(new MapboxMap.OnShoveListener() {
+ @Override
+ public void onShoveBegin(ShoveGestureDetector detector) {
+ gestureAlertsAdapter.addAlert(new GestureAlert(GestureAlert.TYPE_START, "SHOVE START"));
+ }
+
+ @Override
+ public void onShove(ShoveGestureDetector detector) {
+ gestureAlertsAdapter.addAlert(new GestureAlert(GestureAlert.TYPE_PROGRESS, "SHOVE PROGRESS"));
+ }
+
+ @Override
+ public void onShoveEnd(ShoveGestureDetector detector) {
+ gestureAlertsAdapter.addAlert(new GestureAlert(GestureAlert.TYPE_END, "SHOVE END"));
+ }
+ });
+ }
+
+ @Override
+ public boolean onCreateOptionsMenu(Menu menu) {
+ getMenuInflater().inflate(R.menu.menu_gestures, menu);
+ return true;
+ }
+
+ @Override
+ public boolean onOptionsItemSelected(MenuItem item) {
+ resetModes();
+ switch (item.getItemId()) {
+ case R.id.menu_gesture_none:
+ return true;
+ case R.id.menu_gesture_focus_point:
+ focalPointLatLng = new LatLng(51.50325, -0.12968);
+ marker = mapboxMap.addMarker(new MarkerOptions().position(focalPointLatLng));
+ mapboxMap.easeCamera(CameraUpdateFactory.newLatLngZoom(focalPointLatLng, 16));
+ mapboxMap.getUiSettings().setFocalPoint(mapboxMap.getProjection().toScreenLocation(focalPointLatLng));
+ return true;
+ case R.id.menu_gesture_animation:
+ animationsEnabled = !animationsEnabled;
+ mapboxMap.getUiSettings().setAllVelocityAnimationsEnabled(animationsEnabled);
+ }
+ return super.onOptionsItemSelected(item);
+ }
+
+ private void resetModes() {
+ focalPointLatLng = null;
+ mapboxMap.getUiSettings().setFocalPoint(null);
+
+ gesturesManager.getMoveGestureDetector().setMoveThreshold(
+ gesturesManager.getMoveGestureDetector().getDefaultMoveThreshold()
+ );
+
+ if (marker != null) {
+ mapboxMap.removeMarker(marker);
+ marker = null;
+ }
+ }
+
+ private void recalculateFocalPoint() {
+ if (focalPointLatLng != null) {
+ mapboxMap.getUiSettings().setFocalPoint(
+ mapboxMap.getProjection().toScreenLocation(focalPointLatLng)
+ );
+ }
+ }
+
+ private static class GestureAlertsAdapter extends RecyclerView.Adapter<GestureAlertsAdapter.ViewHolder> {
+
+ private boolean isUpdating;
+ private final Handler updateHandler = new Handler();
+ private final List<GestureAlert> alerts = new ArrayList<>();
+
+ public static class ViewHolder extends RecyclerView.ViewHolder {
+
+ TextView alertMessageTv;
+
+ @ColorInt
+ public int textColor;
+
+ ViewHolder(View view) {
+ super(view);
+ Typeface typeface = FontCache.get("Roboto-Regular.ttf", view.getContext());
+ alertMessageTv = (TextView) view.findViewById(R.id.alert_message);
+ alertMessageTv.setTypeface(typeface);
+ }
+ }
+
+
+ @Override
+ public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
+ View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_gesture_alert, parent, false);
+ return new ViewHolder(view);
+ }
+
+ @Override
+ public void onBindViewHolder(ViewHolder holder, int position) {
+ GestureAlert alert = alerts.get(position);
+ holder.alertMessageTv.setText(alert.getMessage());
+ holder.alertMessageTv.setTextColor(
+ ContextCompat.getColor(holder.alertMessageTv.getContext(), alert.getColor()));
+ }
+
+ @Override
+ public int getItemCount() {
+ return alerts.size();
+ }
+
+ void addAlert(GestureAlert alert) {
+ for (GestureAlert gestureAlert : alerts) {
+ if (gestureAlert.getAlertType() != GestureAlert.TYPE_PROGRESS) {
+ break;
+ }
+
+ if (alert.getAlertType() == GestureAlert.TYPE_PROGRESS && gestureAlert.equals(alert)) {
+ return;
+ }
+ }
+
+ if (getItemCount() >= MAX_NUMBER_OF_ALERTS) {
+ alerts.remove(getItemCount() - 1);
+ }
+
+ alerts.add(0, alert);
+ if (!isUpdating) {
+ isUpdating = true;
+ updateHandler.postDelayed(updateRunnable, 250);
+ }
+ }
+
+ private Runnable updateRunnable = new Runnable() {
+ @Override
+ public void run() {
+ notifyDataSetChanged();
+ isUpdating = false;
+ }
+ };
+
+ void cancelUpdates() {
+ updateHandler.removeCallbacksAndMessages(null);
+ }
+ }
+
+ private static class GestureAlert {
+ @Retention(SOURCE)
+ @IntDef( {TYPE_NONE, TYPE_START, TYPE_PROGRESS, TYPE_END, TYPE_OTHER})
+ @interface Type {
+ }
+
+ static final int TYPE_NONE = 0;
+ static final int TYPE_START = 1;
+ static final int TYPE_END = 2;
+ static final int TYPE_PROGRESS = 3;
+ static final int TYPE_OTHER = 4;
+
+ @Type
+ private int alertType;
+
+ private String message;
+
+ @ColorInt
+ private int color;
+
+ GestureAlert(@Type int alertType, String message) {
+ this.alertType = alertType;
+ this.message = message;
+
+ switch (alertType) {
+ case TYPE_NONE:
+ color = android.R.color.black;
+ break;
+ case TYPE_END:
+ color = android.R.color.holo_red_dark;
+ break;
+ case TYPE_OTHER:
+ color = android.R.color.holo_purple;
+ break;
+ case TYPE_PROGRESS:
+ color = android.R.color.holo_orange_dark;
+ break;
+ case TYPE_START:
+ color = android.R.color.holo_green_dark;
+ break;
+ }
+ }
+
+ int getAlertType() {
+ return alertType;
+ }
+
+ String getMessage() {
+ return message;
+ }
+
+ int getColor() {
+ return color;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+
+ GestureAlert that = (GestureAlert) o;
+
+ if (alertType != that.alertType) {
+ return false;
+ }
+ return message != null ? message.equals(that.message) : that.message == null;
+ }
+
+ @Override
+ public int hashCode() {
+ int result = alertType;
+ result = 31 * result + (message != null ? message.hashCode() : 0);
+ return result;
+ }
+ }
+}
diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/utils/ResourceUtils.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/utils/ResourceUtils.java
index b61f9c4579..6b522ac210 100644
--- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/utils/ResourceUtils.java
+++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/utils/ResourceUtils.java
@@ -2,6 +2,7 @@ package com.mapbox.mapboxsdk.testapp.utils;
import android.content.Context;
import android.support.annotation.RawRes;
+import android.util.TypedValue;
import java.io.BufferedReader;
import java.io.IOException;
@@ -29,5 +30,10 @@ public class ResourceUtils {
}
return json;
}
+
+ public static float convertDpToPx(Context context, float dp) {
+ return TypedValue.applyDimension(
+ TypedValue.COMPLEX_UNIT_DIP, dp, context.getResources().getDisplayMetrics());
+ }
}
diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_gesture_detector.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_gesture_detector.xml
new file mode 100644
index 0000000000..26c61e1639
--- /dev/null
+++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_gesture_detector.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ tools:context="com.mapbox.mapboxsdk.testapp.activity.camera.GestureDetectorActivity">
+
+ <com.mapbox.mapboxsdk.maps.MapView
+ android:id="@id/mapView"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ app:mapbox_cameraTargetLat="51.50325"
+ app:mapbox_cameraTargetLng="-0.11968"
+ app:mapbox_cameraZoom="15" />
+
+ <android.support.v7.widget.RecyclerView
+ android:id="@+id/alerts_recycler"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignParentLeft="true"
+ android:layout_alignParentStart="true"
+ android:layout_alignParentTop="true"
+ android:background="#97cdcfd3" />
+
+</RelativeLayout>
diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/item_gesture_alert.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/item_gesture_alert.xml
new file mode 100644
index 0000000000..5fc17d049f
--- /dev/null
+++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/item_gesture_alert.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content">
+
+ <TextView
+ android:id="@+id/alert_message"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:paddingBottom="2dp"
+ android:paddingTop="2dp"
+ android:textSize="9sp" />
+
+</FrameLayout> \ No newline at end of file
diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/menu/menu_gestures.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/menu/menu_gestures.xml
new file mode 100644
index 0000000000..3f96188da4
--- /dev/null
+++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/menu/menu_gestures.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<menu xmlns:android="http://schemas.android.com/apk/res/android">
+ <item
+ android:id="@+id/menu_gesture_none"
+ android:title="None" />
+ <item
+ android:id="@+id/menu_gesture_focus_point"
+ android:title="Focus on a point" />
+ <item
+ android:id="@+id/menu_gesture_animation"
+ android:title="Toggle velocity animations" />
+</menu> \ No newline at end of file
diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/values/descriptions.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/values/descriptions.xml
index 77ce50ecd0..5238176ce8 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_local_glyph">Suzhou using Droid Sans for Chinese glyphs</string>
<string name="description_hillshade">Example raster-dem source and hillshade layer</string>
<string name="description_heatmaplayer">Use HeatmapLayer to visualise earthquakes</string>
+ <string name="description_gesture_detector">Manipulate gestures detector\'s settings</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 a3885dbf38..89ec586950 100644
--- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/values/titles.xml
+++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/values/titles.xml
@@ -67,4 +67,5 @@
<string name="activity_local_glyph">Local CJK glyph generation</string>
<string name="activity_hillshade">Hillshade</string>
<string name="activity_heatmaplayer">Heatmap layer</string>
+ <string name="activity_gesture_detector">Gestures detector</string>
</resources> \ No newline at end of file