diff options
author | Cameron Mace <cameron@mapbox.com> | 2017-01-23 13:27:02 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-23 13:27:02 -0500 |
commit | 9b726441911224e27c0fd001f43dbeeee42e3079 (patch) | |
tree | 28916f3e6e408c6808268f4766edd1879cdc6cdf /platform | |
parent | 7cf317c08ce89d10a8ac01cd21caf035bfc9dc5e (diff) | |
download | qtlocation-mapboxgl-9b726441911224e27c0fd001f43dbeeee42e3079.tar.gz |
Test app refactor (#7598)
Diffstat (limited to 'platform')
107 files changed, 666 insertions, 3268 deletions
diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/AndroidManifest.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/AndroidManifest.xml index 684633bad1..228ad32b67 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/AndroidManifest.xml +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/AndroidManifest.xml @@ -1,28 +1,29 @@ <?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.INTERNET" /> - <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> - <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> - <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> - <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> + <uses-permission android:name="android.permission.INTERNET"/> + <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/> + <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/> + <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/> + <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> <application android:name=".MapboxApplication" android:allowBackup="true" android:fullBackupContent="true" android:icon="@drawable/icon" - android:roundIcon="@drawable/ic_launcher_round" android:label="@string/app_name" + android:roundIcon="@drawable/ic_launcher_round" android:supportsRtl="true" android:theme="@style/AppTheme"> <activity android:name=".activity.FeatureOverviewActivity" + android:launchMode="singleTop" android:label="@string/app_name"> <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 @@ -31,7 +32,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"/> </activity> <activity android:name=".activity.infowindow.InfoWindowAdapterActivity" @@ -39,7 +43,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"/> </activity> <activity android:name=".activity.infowindow.DynamicInfoWindowAdapterActivity" @@ -47,7 +54,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"/> </activity> <activity android:name=".activity.annotation.BulkMarkerActivity" @@ -56,7 +66,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"/> </activity> <activity android:name=".activity.annotation.AnimatedMarkerActivity" @@ -64,7 +77,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"/> </activity> <activity android:name=".activity.annotation.DynamicMarkerChangeActivity" @@ -72,7 +88,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"/> </activity> <activity android:name=".activity.annotation.PressForMarkerActivity" @@ -80,7 +99,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"/> </activity> <activity android:name=".activity.camera.CameraAnimationTypeActivity" @@ -88,7 +110,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"/> </activity> <activity android:name=".activity.camera.CameraPositionActivity" @@ -96,7 +121,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"/> </activity> <activity android:name=".activity.camera.LatLngBoundsActivity" @@ -105,7 +133,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"/> </activity> <activity android:name=".activity.fragment.MapFragmentActivity" @@ -113,7 +144,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"/> </activity> <activity android:name=".activity.fragment.SupportMapFragmentActivity" @@ -121,7 +155,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"/> </activity> <activity android:name=".activity.fragment.MultiMapActivity" @@ -129,7 +166,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"/> </activity> <activity android:name=".activity.camera.ManualZoomActivity" @@ -137,7 +177,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"/> </activity> <activity android:name=".activity.camera.MaxMinZoomActivity" @@ -145,7 +188,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"/> </activity> <activity android:name=".activity.customlayer.CustomLayerActivity" @@ -153,15 +199,22 @@ 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"/> </activity> <activity android:name=".activity.userlocation.MyLocationTrackingModeActivity" android:description="@string/description_user_location_tracking" - android:label="@string/activity_user_tracking_mode"> + android:label="@string/activity_user_tracking_mode" + android:theme="@style/NoActionBar"> <meta-data android:name="@string/category" - android:value="@string/category_userlocation" /> + android:value="@string/category_userlocation"/> + <meta-data + android:name="android.support.PARENT_ACTIVITY" + android:value=".activity.FeatureOverviewActivity"/> </activity> <activity android:name=".activity.userlocation.MyLocationDrawableActivity" @@ -169,7 +222,10 @@ android:label="@string/activity_user_tracking_customization"> <meta-data android:name="@string/category" - android:value="@string/category_userlocation" /> + android:value="@string/category_userlocation"/> + <meta-data + android:name="android.support.PARENT_ACTIVITY" + android:value=".activity.FeatureOverviewActivity"/> </activity> <activity android:name=".activity.userlocation.MyLocationTintActivity" @@ -177,7 +233,10 @@ android:label="@string/activity_user_dot_color"> <meta-data android:name="@string/category" - android:value="@string/category_userlocation" /> + android:value="@string/category_userlocation"/> + <meta-data + android:name="android.support.PARENT_ACTIVITY" + android:value=".activity.FeatureOverviewActivity"/> </activity> <activity android:name=".activity.userlocation.MyLocationToggleActivity" @@ -185,7 +244,10 @@ android:label="@string/activity_user_location_toggle"> <meta-data android:name="@string/category" - android:value="@string/category_userlocation" /> + android:value="@string/category_userlocation"/> + <meta-data + android:name="android.support.PARENT_ACTIVITY" + android:value=".activity.FeatureOverviewActivity"/> </activity> <activity android:name=".activity.annotation.PolygonActivity" @@ -193,7 +255,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"/> </activity> <activity android:name=".activity.annotation.PolylineActivity" @@ -201,31 +266,22 @@ android:label="@string/activity_polyline"> <meta-data android:name="@string/category" - android:value="@string/category_annotation" /> - </activity> - <activity - android:name=".activity.directions.DirectionsActivity" - android:description="@string/description_directions" - android:label="@string/activity_directions"> + android:value="@string/category_annotation"/> <meta-data - android:name="@string/category" - android:value="@string/category_directions" /> - </activity> - <activity - android:name=".activity.geocoding.GeocoderActivity" - android:description="@string/description_geocoder" - android:label="@string/activity_geocoder"> - <meta-data - android:name="@string/category" - android:value="@string/category_geocoding" /> + android:name="android.support.PARENT_ACTIVITY" + android:value=".activity.FeatureOverviewActivity"/> </activity> <activity android:name=".activity.camera.ScrollByActivity" android:description="@string/description_scroll_by" - android:label="@string/activity_scroll_by"> + android:label="@string/activity_scroll_by" + 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"/> </activity> <activity android:name=".activity.maplayout.MapPaddingActivity" @@ -234,7 +290,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"/> </activity> <activity android:name=".activity.maplayout.DebugModeActivity" @@ -242,7 +301,10 @@ android:label="@string/activity_debug_mode"> <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"/> </activity> <activity android:name=".activity.offline.OfflineActivity" @@ -250,7 +312,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"/> </activity> <activity android:name=".activity.offline.UpdateMetadataActivity" @@ -258,7 +323,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"/> </activity> <activity android:name=".activity.imagegenerator.SnapshotActivity" @@ -266,7 +334,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"/> </activity> <activity android:name=".activity.maplayout.DoubleMapActivity" @@ -274,7 +345,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"/> </activity> <activity android:name=".activity.annotation.MarkerViewActivity" @@ -282,23 +356,10 @@ android:label="@string/activity_view_marker"> <meta-data android:name="@string/category" - android:value="@string/category_annotation" /> - </activity> - <activity - android:name=".activity.annotation.MarkerViewScaleActivity" - android:description="@string/description_view_marker_scale" - android:label="@string/activity_view_marker_scale"> - <meta-data - android:name="@string/category" - android:value="@string/category_annotation" /> - </activity> - <activity - android:name=".activity.navigation.LocationPickerActivity" - android:description="@string/description_location_picker" - android:label="@string/activity_location_picker"> + android:value="@string/category_annotation"/> <meta-data - android:name="@string/category" - android:value="@string/category_navigation" /> + android:name="android.support.PARENT_ACTIVITY" + android:value=".activity.FeatureOverviewActivity"/> </activity> <activity android:name=".activity.fragment.ViewPagerActivity" @@ -306,7 +367,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"/> </activity> <activity android:name=".activity.maplayout.NavigationDrawerActivity" @@ -315,7 +379,10 @@ android:theme="@style/AppTheme.ActionBar.Transparent"> <meta-data android:name="@string/category" - android:value="@string/category_fragment" /> + android:value="@string/category_maplayout"/> + <meta-data + android:name="android.support.PARENT_ACTIVITY" + android:value=".activity.FeatureOverviewActivity"/> </activity> <activity android:name=".activity.maplayout.SimpleMapActivity" @@ -323,7 +390,10 @@ android:label="@string/activity_simple_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"/> </activity> <activity android:name=".activity.style.RuntimeStyleActivity" @@ -331,7 +401,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"/> </activity> <activity android:name=".activity.style.CircleLayerActivity" @@ -340,6 +413,20 @@ <meta-data android:name="@string/category" android:value="@string/category_style"/> + <meta-data + android:name="android.support.PARENT_ACTIVITY" + android:value=".activity.FeatureOverviewActivity"/> + </activity> + <activity + android:name=".activity.style.SymbolLayerActivity" + android:description="@string/description_symbol_layer" + android:label="@string/activity_symbol_layer"> + <meta-data + android:name="@string/category" + android:value="@string/category_style"/> + <meta-data + android:name="android.support.PARENT_ACTIVITY" + android:value=".activity.FeatureOverviewActivity"/> </activity> <activity android:name=".activity.style.GeoJsonClusteringActivity" @@ -347,14 +434,21 @@ 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"/> </activity> - <activity android:name=".activity.style.RealTimeGeoJsonActivity" + <activity + android:name=".activity.style.RealTimeGeoJsonActivity" android:description="@string/description_geojson_realtime" 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"/> </activity> <activity android:name=".activity.style.StyleFileActivity" @@ -362,7 +456,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"/> </activity> <activity android:name=".activity.style.CustomSpriteActivity" @@ -370,7 +467,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"/> </activity> <activity android:name=".activity.imagegenerator.PrintActivity" @@ -378,7 +478,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"/> </activity> <!-- Features --> @@ -388,7 +491,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"/> </activity> <activity android:name=".activity.feature.QueryRenderedFeaturesBoxCountActivity" @@ -396,7 +502,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"/> </activity> <activity android:name=".activity.feature.QueryRenderedFeaturesBoxSymbolCountActivity" @@ -404,7 +513,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"/> </activity> <activity android:name=".activity.feature.QueryRenderedFeaturesBoxHighlightActivity" @@ -412,15 +524,10 @@ android:label="@string/activity_query_rendered_features_box_highlight"> <meta-data android:name="@string/category" - android:value="@string/category_features" /> - </activity> - <activity - android:name=".activity.navigation.CarDrivingActivity" - android:description="@string/description_car_driving" - android:label="@string/activity_car_driving"> + android:value="@string/category_features"/> <meta-data - android:name="@string/category" - android:value="@string/category_navigation" /> + android:name="android.support.PARENT_ACTIVITY" + android:value=".activity.FeatureOverviewActivity"/> </activity> <activity android:name=".activity.annotation.AddRemoveMarkerActivity" @@ -428,7 +535,10 @@ android:label="@string/activity_add_remove_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"/> </activity> <activity android:name=".activity.maplayout.MapInDialogActivity" @@ -436,7 +546,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"/> </activity> <activity android:name=".activity.annotation.MarkerViewsInRectangleActivity" @@ -444,28 +557,31 @@ 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"/> </activity> <!-- For Instrumentation tests --> - <activity android:name=".activity.style.RuntimeStyleTestActivity" /> - <activity android:name=".activity.style.RuntimeStyleTimingTestActivity" /> - <activity android:name=".activity.espresso.EspressoTestActivity" /> + <activity android:name=".activity.style.RuntimeStyleTestActivity"/> + <activity android:name=".activity.style.RuntimeStyleTimingTestActivity"/> + <activity android:name=".activity.espresso.EspressoTestActivity"/> <!-- Configuration Settings --> <meta-data android:name="com.mapbox.TestEventsServer" - android:value="https://cloudfront-staging.tilestream.net" /> + android:value="https://cloudfront-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 --> <!-- android:name="com.mapbox.SetStorageExternal" --> <!-- android:value="true" /> --> - <service android:name="com.mapbox.mapboxsdk.telemetry.TelemetryService" /> + <service android:name="com.mapbox.mapboxsdk.telemetry.TelemetryService"/> </application> </manifest>
\ No newline at end of file diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/FeatureOverviewActivity.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/FeatureOverviewActivity.java index 9ba51e2694..3f95f70aef 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/FeatureOverviewActivity.java +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/FeatureOverviewActivity.java @@ -14,14 +14,9 @@ import android.support.annotation.StringRes; import android.support.design.widget.Snackbar; import android.support.v4.app.ActivityCompat; import android.support.v4.content.ContextCompat; -import android.support.v7.app.ActionBar; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; -import android.support.v7.widget.Toolbar; - -import timber.log.Timber; - import android.view.View; import com.mapbox.mapboxsdk.testapp.R; @@ -35,6 +30,8 @@ import java.util.Collections; import java.util.Comparator; import java.util.List; +import timber.log.Timber; + public class FeatureOverviewActivity extends AppCompatActivity { private static final String KEY_STATE_FEATURES = "featureList"; @@ -46,16 +43,7 @@ public class FeatureOverviewActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - setContentView(R.layout.activity_main); - - Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); - toolbar.setTitle(getString(R.string.app_name)); - setSupportActionBar(toolbar); - - ActionBar actionBar = getSupportActionBar(); - if (actionBar != null) { - actionBar.setElevation(getResources().getDimension(R.dimen.toolbar_shadow)); - } + setContentView(R.layout.activity_feature_overview); recyclerView = (RecyclerView) findViewById(R.id.recyclerView); recyclerView.setLayoutManager(new LinearLayoutManager(this)); @@ -218,8 +206,6 @@ public class FeatureOverviewActivity extends AppCompatActivity { List<String> requiresPermissionActvities = new ArrayList<String>() { { add(resources.getString(R.string.activity_double_map)); - add(getString(R.string.activity_location_picker)); - add(getString(R.string.activity_car_driving)); } }; diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/annotation/AddRemoveMarkerActivity.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/annotation/AddRemoveMarkerActivity.java index 6c56aa4a7a..5e4b4bf4d7 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/annotation/AddRemoveMarkerActivity.java +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/annotation/AddRemoveMarkerActivity.java @@ -1,13 +1,7 @@ package com.mapbox.mapboxsdk.testapp.activity.annotation; import android.os.Bundle; -import android.support.v7.app.ActionBar; import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.Toolbar; - -import timber.log.Timber; - -import android.view.MenuItem; import com.mapbox.mapboxsdk.annotations.Icon; import com.mapbox.mapboxsdk.annotations.IconFactory; @@ -21,6 +15,8 @@ import com.mapbox.mapboxsdk.maps.MapboxMap; import com.mapbox.mapboxsdk.maps.OnMapReadyCallback; import com.mapbox.mapboxsdk.testapp.R; +import timber.log.Timber; + public class AddRemoveMarkerActivity extends AppCompatActivity { public static final double THRESHOLD = 5.0; @@ -40,15 +36,6 @@ public class AddRemoveMarkerActivity extends AppCompatActivity { super.onCreate(savedInstanceState); setContentView(R.layout.activity_add_remove_marker); - Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); - setSupportActionBar(toolbar); - - ActionBar actionBar = getSupportActionBar(); - if (actionBar != null) { - actionBar.setDisplayHomeAsUpEnabled(true); - actionBar.setDisplayShowHomeEnabled(true); - } - final Icon icon1 = IconFactory.getInstance(this).fromResource(R.drawable.ic_arsenal); final Icon icon2 = IconFactory.getInstance(this).fromResource(R.drawable.ic_chelsea); @@ -170,14 +157,4 @@ public class AddRemoveMarkerActivity extends AppCompatActivity { super.onDestroy(); mapView.onDestroy(); } - - @Override - public boolean onOptionsItemSelected(MenuItem item) { - switch (item.getItemId()) { - case android.R.id.home: - onBackPressed(); - return true; - } - return super.onOptionsItemSelected(item); - } }
\ No newline at end of file diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/annotation/AnimatedMarkerActivity.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/annotation/AnimatedMarkerActivity.java index 50e6c44b6e..ad1306e4cd 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/annotation/AnimatedMarkerActivity.java +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/annotation/AnimatedMarkerActivity.java @@ -8,10 +8,7 @@ import android.animation.ValueAnimator; import android.os.Bundle; import android.support.annotation.DrawableRes; import android.support.annotation.NonNull; -import android.support.v7.app.ActionBar; import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.Toolbar; -import android.view.MenuItem; import android.view.animation.AccelerateDecelerateInterpolator; import com.mapbox.mapboxsdk.annotations.Icon; @@ -42,20 +39,13 @@ public class AnimatedMarkerActivity extends AppCompatActivity { private Marker passengerMarker = null; private MarkerView carMarker = null; + private Runnable animationRunnable; + @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_animated_marker); - Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); - setSupportActionBar(toolbar); - - ActionBar actionBar = getSupportActionBar(); - if (actionBar != null) { - actionBar.setDisplayHomeAsUpEnabled(true); - actionBar.setDisplayShowHomeEnabled(true); - } - mapView = (MapView) findViewById(R.id.mapView); mapView.onCreate(savedInstanceState); mapView.getMapAsync(new OnMapReadyCallback() { @@ -64,7 +54,8 @@ public class AnimatedMarkerActivity extends AppCompatActivity { public void onMapReady(@NonNull final MapboxMap mapboxMap) { AnimatedMarkerActivity.this.mapboxMap = mapboxMap; setupMap(); - mapView.post(new Runnable() { + + animationRunnable = new Runnable() { @Override public void run() { for (int i = 0; i < 10; i++) { @@ -73,7 +64,8 @@ public class AnimatedMarkerActivity extends AppCompatActivity { addPassenger(); addMainCar(); } - }); + }; + mapView.post(animationRunnable); } }); } @@ -193,17 +185,6 @@ public class AnimatedMarkerActivity extends AppCompatActivity { } @Override - public boolean onOptionsItemSelected(MenuItem item) { - switch (item.getItemId()) { - case android.R.id.home: - onBackPressed(); - return true; - default: - return super.onOptionsItemSelected(item); - } - } - - @Override protected void onStart() { super.onStart(); mapView.onStart(); @@ -225,6 +206,7 @@ public class AnimatedMarkerActivity extends AppCompatActivity { protected void onStop() { super.onStop(); mapView.onStop(); + mapView.removeCallbacks(animationRunnable); } @Override diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/annotation/BulkMarkerActivity.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/annotation/BulkMarkerActivity.java index 0d97289e56..bd5d836ca9 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/annotation/BulkMarkerActivity.java +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/annotation/BulkMarkerActivity.java @@ -10,12 +10,9 @@ import android.os.Bundle; import android.support.annotation.NonNull; import android.support.v4.content.ContextCompat; import android.support.v4.content.res.ResourcesCompat; -import android.support.v7.app.ActionBar; +import android.support.v4.view.MenuItemCompat; import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.Toolbar; - -import timber.log.Timber; - +import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.widget.AdapterView; @@ -44,6 +41,8 @@ import java.util.ArrayList; import java.util.List; import java.util.Random; +import timber.log.Timber; + public class BulkMarkerActivity extends AppCompatActivity implements AdapterView.OnItemSelectedListener { private MapboxMap mapboxMap; @@ -56,31 +55,12 @@ public class BulkMarkerActivity extends AppCompatActivity implements AdapterView super.onCreate(savedInstanceState); setContentView(R.layout.activity_marker_bulk); - Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); - setSupportActionBar(toolbar); - - final ActionBar actionBar = getSupportActionBar(); - if (actionBar != null) { - actionBar.setDisplayShowTitleEnabled(false); - actionBar.setDisplayHomeAsUpEnabled(true); - actionBar.setDisplayShowHomeEnabled(true); - } - mapView = (MapView) findViewById(R.id.mapView); mapView.onCreate(savedInstanceState); mapView.getMapAsync(new OnMapReadyCallback() { @Override public void onMapReady(@NonNull MapboxMap mapboxMap) { BulkMarkerActivity.this.mapboxMap = mapboxMap; - - if (actionBar != null) { - ArrayAdapter<CharSequence> spinnerAdapter = ArrayAdapter.createFromResource( - actionBar.getThemedContext(), R.array.bulk_marker_list, android.R.layout.simple_spinner_item); - spinnerAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); - Spinner spinner = (Spinner) findViewById(R.id.spinner); - spinner.setAdapter(spinnerAdapter); - spinner.setOnItemSelectedListener(BulkMarkerActivity.this); - } } }); @@ -91,6 +71,19 @@ public class BulkMarkerActivity extends AppCompatActivity implements AdapterView } @Override + public boolean onCreateOptionsMenu(Menu menu) { + ArrayAdapter<CharSequence> spinnerAdapter = ArrayAdapter.createFromResource( + this, R.array.bulk_marker_list, android.R.layout.simple_spinner_item); + spinnerAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); + getMenuInflater().inflate(R.menu.menu_bulk_marker, menu); + MenuItem item = menu.findItem(R.id.spinner); + Spinner spinner = (Spinner) MenuItemCompat.getActionView(item); + spinner.setAdapter(spinnerAdapter); + spinner.setOnItemSelectedListener(BulkMarkerActivity.this); + return true; + } + + @Override public void onItemSelected(AdapterView<?> parent, View view, int position, long id) { int amount = Integer.valueOf(getResources().getStringArray(R.array.bulk_marker_list)[position]); if (locations == null) { @@ -209,17 +202,6 @@ public class BulkMarkerActivity extends AppCompatActivity implements AdapterView mapView.onLowMemory(); } - @Override - public boolean onOptionsItemSelected(MenuItem item) { - switch (item.getItemId()) { - case android.R.id.home: - onBackPressed(); - return true; - default: - return super.onOptionsItemSelected(item); - } - } - private class FabClickListener implements View.OnClickListener { @Override public void onClick(final View view) { diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/annotation/DynamicMarkerChangeActivity.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/annotation/DynamicMarkerChangeActivity.java index 8446329e43..a6820312d8 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/annotation/DynamicMarkerChangeActivity.java +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/annotation/DynamicMarkerChangeActivity.java @@ -4,10 +4,7 @@ import android.os.Bundle; import android.support.annotation.NonNull; import android.support.design.widget.FloatingActionButton; import android.support.v4.content.ContextCompat; -import android.support.v7.app.ActionBar; import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.Toolbar; -import android.view.MenuItem; import android.view.View; import com.mapbox.mapboxsdk.annotations.IconFactory; @@ -34,15 +31,6 @@ public class DynamicMarkerChangeActivity extends AppCompatActivity { super.onCreate(savedInstanceState); setContentView(R.layout.activity_dynamic_marker); - Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); - setSupportActionBar(toolbar); - - ActionBar actionBar = getSupportActionBar(); - if (actionBar != null) { - actionBar.setDisplayHomeAsUpEnabled(true); - actionBar.setDisplayShowHomeEnabled(true); - } - iconFactory = IconFactory.getInstance(this); mapView = (MapView) findViewById(R.id.mapView); @@ -129,15 +117,4 @@ public class DynamicMarkerChangeActivity extends AppCompatActivity { super.onLowMemory(); mapView.onLowMemory(); } - - @Override - public boolean onOptionsItemSelected(MenuItem item) { - switch (item.getItemId()) { - case android.R.id.home: - onBackPressed(); - return true; - default: - return super.onOptionsItemSelected(item); - } - } } diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/annotation/MarkerViewActivity.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/annotation/MarkerViewActivity.java index f1dc7f8c0d..7975c127f0 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/annotation/MarkerViewActivity.java +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/annotation/MarkerViewActivity.java @@ -9,11 +9,8 @@ import android.os.Bundle; import android.os.Handler; import android.support.annotation.NonNull; import android.support.annotation.Nullable; -import android.support.v7.app.ActionBar; import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.Toolbar; import android.view.LayoutInflater; -import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; @@ -71,15 +68,6 @@ public class MarkerViewActivity extends AppCompatActivity { super.onCreate(savedInstanceState); setContentView(R.layout.activity_marker_view); - Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); - setSupportActionBar(toolbar); - - final ActionBar actionBar = getSupportActionBar(); - if (actionBar != null) { - actionBar.setDisplayHomeAsUpEnabled(true); - actionBar.setDisplayShowHomeEnabled(true); - } - final TextView viewCountView = (TextView) findViewById(R.id.countView); mapView = (MapView) findViewById(R.id.mapView); mapView.onCreate(savedInstanceState); @@ -458,17 +446,6 @@ public class MarkerViewActivity extends AppCompatActivity { mapView.onLowMemory(); } - @Override - public boolean onOptionsItemSelected(MenuItem item) { - switch (item.getItemId()) { - case android.R.id.home: - onBackPressed(); - return true; - default: - return super.onOptionsItemSelected(item); - } - } - private static class CarLocation { static LatLng[] CAR_0_LNGS = new LatLng[] { diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/annotation/MarkerViewScaleActivity.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/annotation/MarkerViewScaleActivity.java deleted file mode 100644 index 53e352c2e6..0000000000 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/annotation/MarkerViewScaleActivity.java +++ /dev/null @@ -1,179 +0,0 @@ -package com.mapbox.mapboxsdk.testapp.activity.annotation; - -import android.os.Bundle; -import android.support.v7.app.ActionBar; -import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.Toolbar; -import android.view.MenuItem; -import android.view.View; -import android.widget.SeekBar; -import android.widget.TextView; -import android.widget.Toast; - -import com.mapbox.mapboxsdk.annotations.Icon; -import com.mapbox.mapboxsdk.annotations.IconFactory; -import com.mapbox.mapboxsdk.annotations.MarkerView; -import com.mapbox.mapboxsdk.annotations.MarkerViewManager; -import com.mapbox.mapboxsdk.annotations.MarkerViewOptions; -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 java.util.Locale; - -public class MarkerViewScaleActivity extends AppCompatActivity implements OnMapReadyCallback { - - private MapboxMap mapboxMap; - private MapView mapView; - - private MarkerView markerView; - private MarkerViewManager markerViewManager; - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_marker_view_scale); - - Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); - setSupportActionBar(toolbar); - - final ActionBar actionBar = getSupportActionBar(); - if (actionBar != null) { - actionBar.setDisplayHomeAsUpEnabled(true); - actionBar.setDisplayShowHomeEnabled(true); - } - - mapView = (MapView) findViewById(R.id.mapView); - mapView.onCreate(savedInstanceState); - mapView.getMapAsync(this); - } - - @Override - public void onMapReady(MapboxMap map) { - mapboxMap = map; - markerViewManager = map.getMarkerViewManager(); - - final SeekBar xBar = (SeekBar) findViewById(R.id.seekbar_factor); - final TextView textView = (TextView) findViewById(R.id.textview_factor); - - // We need to listen to a render event to be sure - // the View of the Marker has been added to the map - mapView.addOnMapChangedListener(new MapView.OnMapChangedListener() { - @Override - public void onMapChanged(@MapView.MapChange int change) { - if (isMarkerRendered()) { - Toast.makeText(MarkerViewScaleActivity.this, "MarkerView is ready", Toast.LENGTH_SHORT).show(); - View view = markerViewManager.getView(markerView); - xBar.setOnSeekBarChangeListener(new FactorChangeListener(view, textView)); - xBar.setClickable(true); - mapView.removeOnMapChangedListener(this); - } - } - - private boolean isMarkerRendered() { - return markerView != null && markerViewManager.getView(markerView) != null; - } - }); - - Icon icon = IconFactory.getInstance(MarkerViewScaleActivity.this) - .fromResource(R.drawable.ic_circle); - - markerView = mapboxMap.addMarker(new MarkerViewOptions() - .position(new LatLng(38.907192, -77.036871)) - .icon(icon) - .flat(true)); - } - - - @Override - public boolean onOptionsItemSelected(MenuItem item) { - switch (item.getItemId()) { - case android.R.id.home: - onBackPressed(); - return true; - default: - return super.onOptionsItemSelected(item); - } - } - - @Override - public void onResume() { - super.onResume(); - mapView.onResume(); - } - - @Override - public void onStart() { - super.onResume(); - mapView.onStart(); - } - - @Override - public void onStop() { - super.onStop(); - mapView.onStop(); - } - - @Override - public void onPause() { - super.onPause(); - mapView.onPause(); - } - - @Override - protected void onSaveInstanceState(Bundle outState) { - super.onSaveInstanceState(outState); - mapView.onSaveInstanceState(outState); - } - - @Override - protected void onDestroy() { - super.onDestroy(); - mapView.onDestroy(); - } - - @Override - public void onLowMemory() { - super.onLowMemory(); - mapView.onLowMemory(); - } - - private static class FactorChangeListener implements SeekBar.OnSeekBarChangeListener { - - private TextView textView; - private View view; - - FactorChangeListener(View view, TextView textView) { - this.view = view; - this.textView = textView; - } - - @Override - public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) { - float newScale = getScale(progress); - textView.setText(String.format(Locale.US, "Scale: %.1f", newScale)); - if (view != null) { - view.setScaleX(newScale); - view.setScaleY(newScale); - } - } - - @Override - public void onStartTrackingTouch(SeekBar seekBar) { - // Not used - } - - @Override - public void onStopTrackingTouch(SeekBar seekBar) { - // Not used - } - - private float getScale(int progress) { - float scale = 1.0f * progress / 25; - return scale < 1.0 ? 1.0f : scale; - } - } - -}
\ No newline at end of file diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/annotation/MarkerViewsInRectangleActivity.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/annotation/MarkerViewsInRectangleActivity.java index 99a0465092..9d00e82128 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/annotation/MarkerViewsInRectangleActivity.java +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/annotation/MarkerViewsInRectangleActivity.java @@ -2,10 +2,7 @@ package com.mapbox.mapboxsdk.testapp.activity.annotation; import android.graphics.RectF; import android.os.Bundle; -import android.support.v7.app.ActionBar; import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.Toolbar; -import android.view.MenuItem; import android.view.View; import android.widget.Toast; @@ -33,7 +30,6 @@ public class MarkerViewsInRectangleActivity extends AppCompatActivity implements protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_marker_view_in_rect); - setupActionBar(); selectionBox = findViewById(R.id.selection_box); @@ -108,26 +104,4 @@ public class MarkerViewsInRectangleActivity extends AppCompatActivity implements super.onLowMemory(); mapView.onLowMemory(); } - - @Override - public boolean onOptionsItemSelected(MenuItem item) { - switch (item.getItemId()) { - case android.R.id.home: - onBackPressed(); - return true; - default: - return super.onOptionsItemSelected(item); - } - } - - private void setupActionBar() { - Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); - setSupportActionBar(toolbar); - - final ActionBar actionBar = getSupportActionBar(); - if (actionBar != null) { - actionBar.setDisplayHomeAsUpEnabled(true); - actionBar.setDisplayShowHomeEnabled(true); - } - } } diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/annotation/PolygonActivity.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/annotation/PolygonActivity.java index 16efa9f190..c37d9bb92e 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/annotation/PolygonActivity.java +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/annotation/PolygonActivity.java @@ -5,7 +5,6 @@ import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.view.Menu; import android.view.MenuItem; -import android.view.ViewGroup; import com.mapbox.mapboxsdk.annotations.Polygon; import com.mapbox.mapboxsdk.annotations.PolygonOptions; @@ -17,7 +16,6 @@ import com.mapbox.mapboxsdk.maps.MapboxMap; import com.mapbox.mapboxsdk.maps.MapboxMapOptions; import com.mapbox.mapboxsdk.maps.OnMapReadyCallback; import com.mapbox.mapboxsdk.testapp.R; -import com.mapbox.mapboxsdk.testapp.utils.ToolbarComposer; import java.util.ArrayList; import java.util.List; @@ -50,8 +48,6 @@ public class PolygonActivity extends AppCompatActivity implements OnMapReadyCall @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - setContentView(R.layout.activity_polygon); - ToolbarComposer.initDefaultUpToolbar(this, R.id.toolbar); // configure inital map state MapboxMapOptions options = new MapboxMapOptions() @@ -72,11 +68,7 @@ public class PolygonActivity extends AppCompatActivity implements OnMapReadyCall mapView.onCreate(savedInstanceState); mapView.getMapAsync(this); - // add to layout - ViewGroup container = (ViewGroup) findViewById(R.id.container); - if (container != null) { - container.addView(mapView); - } + setContentView(mapView); } @Override @@ -132,25 +124,18 @@ public class PolygonActivity extends AppCompatActivity implements OnMapReadyCall @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { - case android.R.id.home: - onBackPressed(); - return true; - case R.id.action_id_alpha: fullAlpha = !fullAlpha; polygon.setAlpha(fullAlpha ? FULL_ALPHA : PARTIAL_ALPHA); return true; - case R.id.action_id_visible: visible = !visible; polygon.setAlpha(visible ? (fullAlpha ? FULL_ALPHA : PARTIAL_ALPHA) : NO_ALPHA); return true; - case R.id.action_id_points: allPoints = !allPoints; polygon.setPoints(allPoints ? STAR_SHAPE_POINTS : BROKEN_SHAPE_POINTS); return true; - case R.id.action_id_color: color = !color; polygon.setFillColor(color ? BLUE_COLOR : RED_COLOR); diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/annotation/PolylineActivity.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/annotation/PolylineActivity.java index 44f11ca674..76e38018ca 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/annotation/PolylineActivity.java +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/annotation/PolylineActivity.java @@ -3,12 +3,11 @@ package com.mapbox.mapboxsdk.testapp.activity.annotation; import android.graphics.Color; import android.os.Bundle; import android.support.annotation.NonNull; -import android.support.v7.app.ActionBar; import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.Toolbar; import android.view.Menu; import android.view.MenuItem; import android.view.View; +import android.widget.Toast; import com.mapbox.mapboxsdk.annotations.Polyline; import com.mapbox.mapboxsdk.annotations.PolylineOptions; @@ -52,15 +51,6 @@ public class PolylineActivity extends AppCompatActivity { super.onCreate(savedInstanceState); setContentView(R.layout.activity_polyline); - Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); - setSupportActionBar(toolbar); - - ActionBar actionBar = getSupportActionBar(); - if (actionBar != null) { - actionBar.setDisplayHomeAsUpEnabled(true); - actionBar.setDisplayShowHomeEnabled(true); - } - if (savedInstanceState != null) { polylineOptions = savedInstanceState.getParcelableArrayList(STATE_POLYLINE_OPTIONS); } else { @@ -182,11 +172,16 @@ public class PolylineActivity extends AppCompatActivity { @Override public boolean onOptionsItemSelected(MenuItem item) { + if (polylines.size() <= 0) { + Toast.makeText(PolylineActivity.this, "No polylines on map", Toast.LENGTH_LONG).show(); + return super.onOptionsItemSelected(item); + } switch (item.getItemId()) { case R.id.action_id_remove: // test to remove all annotations polylineOptions.clear(); mapboxMap.clear(); + polylines.clear(); return true; case R.id.action_id_alpha: @@ -216,11 +211,6 @@ public class PolylineActivity extends AppCompatActivity { p.setAlpha(visible ? (fullAlpha ? FULL_ALPHA : PARTIAL_ALPHA) : NO_ALPHA); } return true; - - case android.R.id.home: - onBackPressed(); - return true; - default: return super.onOptionsItemSelected(item); } diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/annotation/PressForMarkerActivity.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/annotation/PressForMarkerActivity.java index 4b23060eec..f79e4c6704 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/annotation/PressForMarkerActivity.java +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/annotation/PressForMarkerActivity.java @@ -4,9 +4,7 @@ import android.graphics.PointF; import android.os.Bundle; import android.support.annotation.NonNull; import android.support.annotation.Nullable; -import android.support.v7.app.ActionBar; import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.Toolbar; import android.view.Menu; import android.view.MenuItem; @@ -35,15 +33,6 @@ public class PressForMarkerActivity extends AppCompatActivity { super.onCreate(savedInstanceState); setContentView(R.layout.activity_press_for_marker); - Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); - setSupportActionBar(toolbar); - - ActionBar actionBar = getSupportActionBar(); - if (actionBar != null) { - actionBar.setDisplayHomeAsUpEnabled(true); - actionBar.setDisplayShowHomeEnabled(true); - } - mapView = (MapView) findViewById(R.id.mapView); mapView.onCreate(savedInstanceState); mapView.getMapAsync(new OnMapReadyCallback() { @@ -139,9 +128,6 @@ public class PressForMarkerActivity extends AppCompatActivity { @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { - case android.R.id.home: - onBackPressed(); - return true; case R.id.menuItemReset: resetMap(); return true; diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/camera/CameraAnimationTypeActivity.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/camera/CameraAnimationTypeActivity.java index 3d771613d4..74779c5515 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/camera/CameraAnimationTypeActivity.java +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/camera/CameraAnimationTypeActivity.java @@ -1,10 +1,7 @@ package com.mapbox.mapboxsdk.testapp.activity.camera; import android.os.Bundle; -import android.support.v7.app.ActionBar; import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.Toolbar; -import android.view.MenuItem; import android.view.View; import android.widget.Toast; @@ -32,15 +29,6 @@ public class CameraAnimationTypeActivity extends AppCompatActivity implements On super.onCreate(savedInstanceState); setContentView(R.layout.activity_camera_animation_types); - Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); - setSupportActionBar(toolbar); - - ActionBar actionBar = getSupportActionBar(); - if (actionBar != null) { - actionBar.setDisplayHomeAsUpEnabled(true); - actionBar.setDisplayShowHomeEnabled(true); - } - mapView = (MapView) findViewById(R.id.mapView); if (mapView != null) { mapView.onCreate(savedInstanceState); @@ -199,15 +187,4 @@ public class CameraAnimationTypeActivity extends AppCompatActivity implements On super.onLowMemory(); mapView.onLowMemory(); } - - @Override - public boolean onOptionsItemSelected(MenuItem item) { - switch (item.getItemId()) { - case android.R.id.home: - onBackPressed(); - return true; - default: - return super.onOptionsItemSelected(item); - } - } } diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/camera/CameraPositionActivity.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/camera/CameraPositionActivity.java index 193b59a9db..4405c4c3c6 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/camera/CameraPositionActivity.java +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/camera/CameraPositionActivity.java @@ -7,15 +7,9 @@ import android.support.annotation.IdRes; import android.support.annotation.NonNull; import android.support.design.widget.FloatingActionButton; import android.support.v4.content.ContextCompat; -import android.support.v7.app.ActionBar; import android.support.v7.app.AlertDialog; import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.Toolbar; - -import timber.log.Timber; - import android.view.LayoutInflater; -import android.view.MenuItem; import android.view.View; import android.widget.SeekBar; import android.widget.TextView; @@ -28,6 +22,8 @@ import com.mapbox.mapboxsdk.maps.MapboxMap; import com.mapbox.mapboxsdk.maps.OnMapReadyCallback; import com.mapbox.mapboxsdk.testapp.R; +import timber.log.Timber; + public class CameraPositionActivity extends AppCompatActivity implements OnMapReadyCallback { private MapView mapView; @@ -38,15 +34,6 @@ public class CameraPositionActivity extends AppCompatActivity implements OnMapRe super.onCreate(savedInstanceState); setContentView(R.layout.activity_camera_position); - Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); - setSupportActionBar(toolbar); - - ActionBar actionBar = getSupportActionBar(); - if (actionBar != null) { - actionBar.setDisplayHomeAsUpEnabled(true); - actionBar.setDisplayShowHomeEnabled(true); - } - mapView = (MapView) findViewById(R.id.mapView); mapView.onCreate(savedInstanceState); mapView.getMapAsync(this); @@ -154,17 +141,6 @@ public class CameraPositionActivity extends AppCompatActivity implements OnMapRe mapView.onSaveInstanceState(outState); } - @Override - public boolean onOptionsItemSelected(MenuItem item) { - switch (item.getItemId()) { - case android.R.id.home: - onBackPressed(); - return true; - default: - return super.onOptionsItemSelected(item); - } - } - private View onInflateDialogContent(View view) { linkTextView(view, R.id.value_lat, R.id.seekbar_lat, new LatLngChangeListener(), 180 + 38); linkTextView(view, R.id.value_lon, R.id.seekbar_lon, new LatLngChangeListener(), 180 - 77); diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/camera/LatLngBoundsActivity.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/camera/LatLngBoundsActivity.java index 3dd6a6344d..d6db2aeeb0 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/camera/LatLngBoundsActivity.java +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/camera/LatLngBoundsActivity.java @@ -1,13 +1,7 @@ package com.mapbox.mapboxsdk.testapp.activity.camera; import android.os.Bundle; -import android.support.v7.app.ActionBar; import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.Toolbar; - -import timber.log.Timber; - -import android.view.MenuItem; import com.mapbox.mapboxsdk.annotations.MarkerOptions; import com.mapbox.mapboxsdk.camera.CameraUpdateFactory; @@ -23,6 +17,8 @@ import com.mapbox.mapboxsdk.testapp.R; import java.util.ArrayList; import java.util.List; +import timber.log.Timber; + public class LatLngBoundsActivity extends AppCompatActivity implements OnMapReadyCallback { private static final LatLng LOS_ANGELES = new LatLng(34.053940, -118.242622); @@ -36,15 +32,6 @@ public class LatLngBoundsActivity extends AppCompatActivity implements OnMapRead super.onCreate(savedInstanceState); setContentView(R.layout.activity_visible_bounds); - Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); - setSupportActionBar(toolbar); - - ActionBar actionBar = getSupportActionBar(); - if (actionBar != null) { - actionBar.setDisplayHomeAsUpEnabled(true); - actionBar.setDisplayShowHomeEnabled(true); - } - mapView = (MapView) findViewById(R.id.mapView); mapView.setStyleUrl(Style.DARK); mapView.onCreate(savedInstanceState); @@ -130,15 +117,4 @@ public class LatLngBoundsActivity extends AppCompatActivity implements OnMapRead super.onLowMemory(); mapView.onLowMemory(); } - - @Override - public boolean onOptionsItemSelected(MenuItem item) { - switch (item.getItemId()) { - case android.R.id.home: - onBackPressed(); - return true; - default: - return super.onOptionsItemSelected(item); - } - } } diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/camera/ManualZoomActivity.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/camera/ManualZoomActivity.java index 4bc30157f8..696629d011 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/camera/ManualZoomActivity.java +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/camera/ManualZoomActivity.java @@ -3,9 +3,7 @@ package com.mapbox.mapboxsdk.testapp.activity.camera; import android.graphics.Point; import android.os.Bundle; import android.support.annotation.NonNull; -import android.support.v7.app.ActionBar; import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.Toolbar; import android.view.Menu; import android.view.MenuItem; import android.view.View; @@ -28,15 +26,6 @@ public class ManualZoomActivity extends AppCompatActivity { super.onCreate(savedInstanceState); setContentView(R.layout.activity_manual_zoom); - Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); - setSupportActionBar(toolbar); - - ActionBar actionBar = getSupportActionBar(); - if (actionBar != null) { - actionBar.setDisplayHomeAsUpEnabled(true); - actionBar.setDisplayShowHomeEnabled(true); - } - mapView = (MapView) findViewById(R.id.mapView); mapView.setStyleUrl(Style.SATELLITE); mapView.onCreate(savedInstanceState); @@ -61,10 +50,6 @@ public class ManualZoomActivity extends AppCompatActivity { public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { - case android.R.id.home: - onBackPressed(); - return true; - case R.id.action_zoom_in: mapboxMap.animateCamera(CameraUpdateFactory.zoomIn()); return true; diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/camera/MaxMinZoomActivity.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/camera/MaxMinZoomActivity.java index 71e8cc0a08..c2478fad66 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/camera/MaxMinZoomActivity.java +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/camera/MaxMinZoomActivity.java @@ -1,10 +1,7 @@ package com.mapbox.mapboxsdk.testapp.activity.camera; import android.os.Bundle; -import android.support.v7.app.ActionBar; import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.Toolbar; -import android.view.MenuItem; import com.mapbox.mapboxsdk.maps.MapView; import com.mapbox.mapboxsdk.maps.MapboxMap; @@ -22,15 +19,6 @@ public class MaxMinZoomActivity extends AppCompatActivity implements OnMapReadyC super.onCreate(savedInstanceState); setContentView(R.layout.activity_maxmin_zoom); - Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); - setSupportActionBar(toolbar); - - ActionBar actionBar = getSupportActionBar(); - if (actionBar != null) { - actionBar.setDisplayHomeAsUpEnabled(true); - actionBar.setDisplayShowHomeEnabled(true); - } - mapView = (MapView) findViewById(R.id.mapView); mapView.onCreate(savedInstanceState); mapView.getMapAsync(this); @@ -44,16 +32,6 @@ public class MaxMinZoomActivity extends AppCompatActivity implements OnMapReadyC } @Override - public boolean onOptionsItemSelected(MenuItem item) { - switch (item.getItemId()) { - case android.R.id.home: - onBackPressed(); - return true; - } - return false; - } - - @Override protected void onStart() { super.onStart(); mapView.onStart(); @@ -94,5 +72,4 @@ public class MaxMinZoomActivity extends AppCompatActivity implements OnMapReadyC super.onLowMemory(); mapView.onLowMemory(); } - }
\ No newline at end of file diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/customlayer/CustomLayerActivity.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/customlayer/CustomLayerActivity.java index 8e4b58366f..3fbb25805b 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/customlayer/CustomLayerActivity.java +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/customlayer/CustomLayerActivity.java @@ -3,12 +3,7 @@ package com.mapbox.mapboxsdk.testapp.activity.customlayer; import android.os.Bundle; import android.support.design.widget.FloatingActionButton; import android.support.v4.content.ContextCompat; -import android.support.v7.app.ActionBar; import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.Toolbar; - -import timber.log.Timber; - import android.view.Menu; import android.view.MenuItem; import android.view.View; @@ -23,6 +18,8 @@ import com.mapbox.mapboxsdk.style.layers.NoSuchLayerException; import com.mapbox.mapboxsdk.testapp.R; import com.mapbox.mapboxsdk.testapp.model.customlayer.ExampleCustomLayer; +import timber.log.Timber; + public class CustomLayerActivity extends AppCompatActivity { private MapboxMap mapboxMap; @@ -36,8 +33,6 @@ public class CustomLayerActivity extends AppCompatActivity { super.onCreate(savedInstanceState); setContentView(R.layout.activity_custom_layer); - setupActionBar(); - mapView = (MapView) findViewById(R.id.mapView); mapView.onCreate(savedInstanceState); mapView.getMapAsync(new OnMapReadyCallback() { @@ -138,9 +133,6 @@ public class CustomLayerActivity extends AppCompatActivity { @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { - case android.R.id.home: - onBackPressed(); - return true; case R.id.action_update_layer: updateLayer(); return true; @@ -157,15 +149,4 @@ public class CustomLayerActivity extends AppCompatActivity { return super.onOptionsItemSelected(item); } } - - private void setupActionBar() { - Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); - setSupportActionBar(toolbar); - - final ActionBar actionBar = getSupportActionBar(); - if (actionBar != null) { - actionBar.setDisplayHomeAsUpEnabled(true); - actionBar.setDisplayShowHomeEnabled(true); - } - } } diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/directions/DirectionsActivity.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/directions/DirectionsActivity.java deleted file mode 100644 index 13e384a8b5..0000000000 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/directions/DirectionsActivity.java +++ /dev/null @@ -1,213 +0,0 @@ -package com.mapbox.mapboxsdk.testapp.activity.directions; - -import android.graphics.Color; -import android.os.Bundle; -import android.support.annotation.NonNull; -import android.support.v7.app.ActionBar; -import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.Toolbar; - -import timber.log.Timber; - -import android.view.MenuItem; - -import com.mapbox.mapboxsdk.annotations.MarkerOptions; -import com.mapbox.mapboxsdk.annotations.PolylineOptions; -import com.mapbox.mapboxsdk.camera.CameraPosition; -import com.mapbox.mapboxsdk.camera.CameraUpdateFactory; -import com.mapbox.mapboxsdk.geometry.LatLng; -import com.mapbox.mapboxsdk.maps.MapboxMap; -import com.mapbox.mapboxsdk.maps.OnMapReadyCallback; -import com.mapbox.mapboxsdk.testapp.R; -import com.mapbox.mapboxsdk.maps.MapView; -import com.mapbox.services.Constants; -import com.mapbox.services.api.ServicesException; -import com.mapbox.services.commons.geojson.LineString; -import com.mapbox.services.commons.models.Position; -import com.mapbox.services.api.directions.v5.DirectionsCriteria; -import com.mapbox.services.api.directions.v5.MapboxDirections; -import com.mapbox.services.api.directions.v5.models.DirectionsResponse; -import com.mapbox.services.api.directions.v5.models.DirectionsRoute; - -import java.util.ArrayList; -import java.util.List; - -import retrofit2.Call; -import retrofit2.Callback; -import retrofit2.Response; - -public class DirectionsActivity extends AppCompatActivity { - - private MapView mapView; - private MapboxMap mapboxMap; - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_directions); - - Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); - setSupportActionBar(toolbar); - - ActionBar actionBar = getSupportActionBar(); - if (actionBar != null) { - actionBar.setDisplayHomeAsUpEnabled(true); - actionBar.setDisplayShowHomeEnabled(true); - } - - mapView = (MapView) findViewById(R.id.mapView); - mapView.onCreate(savedInstanceState); - mapView.getMapAsync(new OnMapReadyCallback() { - @Override - public void onMapReady(@NonNull MapboxMap mapboxMap) { - DirectionsActivity.this.mapboxMap = mapboxMap; - loadRoute(); - } - }); - } - - private void loadRoute() { - // Dupont Circle (Washington, DC) - Position origin = Position.fromCoordinates(-77.04341, 38.90962); - - // The White House (Washington, DC) - Position destination = Position.fromCoordinates(-77.0365, 38.8977); - - // Set map at centroid - LatLng centroid = new LatLng( - (origin.getLatitude() + destination.getLatitude()) / 2, - (origin.getLongitude() + destination.getLongitude()) / 2); - - mapboxMap.moveCamera(CameraUpdateFactory.newCameraPosition(new CameraPosition.Builder() - .target(centroid) - .zoom(14) - .build())); - - // Add origin and destination to the map - mapboxMap.addMarker(new MarkerOptions() - .position(new LatLng(origin.getLatitude(), origin.getLongitude())) - .title("Origin") - .snippet("Dupont Circle")); - mapboxMap.addMarker(new MarkerOptions() - .position(new LatLng(destination.getLatitude(), destination.getLongitude())) - .title("Destination") - .snippet("The White House")); - - // Get route from API - getRoute(origin, destination); - } - - private void getRoute(Position origin, Position destination) { - try { - MapboxDirections md = new MapboxDirections.Builder() - .setAccessToken(getString(R.string.mapbox_access_token)) - .setOrigin(origin) - .setOverview(DirectionsCriteria.OVERVIEW_FULL) - .setDestination(destination) - .setProfile(DirectionsCriteria.PROFILE_WALKING) - .build(); - - md.enqueueCall(new Callback<DirectionsResponse>() { - - @Override - public void onFailure(Call<DirectionsResponse> call, Throwable throwable) { - Timber.e("Error: " + throwable.getMessage()); - } - - @Override - public void onResponse(Call<DirectionsResponse> call, Response<DirectionsResponse> response) { - // You can get generic HTTP info about the response - Timber.d("Response code: " + response.code()); - - // Print some info about the route - DirectionsRoute currentRoute = response.body().getRoutes().get(0); - Timber.d("Distance: " + currentRoute.getDistance()); - - // Draw the route on the map - drawRoute(currentRoute); - } - - }); - } catch (ServicesException servicesException) { - Timber.e("Error displaying route: " + servicesException.toString()); - servicesException.printStackTrace(); - } - } - - private void drawRoute(DirectionsRoute route) { - - PolylineOptions builder = new PolylineOptions(); - builder.color(Color.parseColor("#3887be")); - builder.alpha(0.5f); - builder.width(5); - builder.width(5); - - LineString lineString = LineString.fromPolyline(route.getGeometry(), Constants.OSRM_PRECISION_V5); - List<Position> coordinates = lineString.getCoordinates(); - List<LatLng> points = new ArrayList<>(); - for (int i = 0; i < coordinates.size(); i++) { - points.add(new LatLng( - coordinates.get(i).getLatitude(), - coordinates.get(i).getLongitude())); - } - - builder.addAll(points); - - // Draw Points on MapView - mapboxMap.addPolyline(builder); - } - - @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 - protected void onSaveInstanceState(Bundle outState) { - super.onSaveInstanceState(outState); - mapView.onSaveInstanceState(outState); - } - - @Override - protected void onDestroy() { - super.onDestroy(); - mapView.onDestroy(); - } - - @Override - public void onLowMemory() { - super.onLowMemory(); - mapView.onLowMemory(); - } - - @Override - public boolean onOptionsItemSelected(MenuItem item) { - switch (item.getItemId()) { - case android.R.id.home: - onBackPressed(); - return true; - default: - return super.onOptionsItemSelected(item); - } - } - -} diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/feature/QueryRenderedFeaturesBoxCountActivity.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/feature/QueryRenderedFeaturesBoxCountActivity.java index 00cc8dfac7..5b66237d0f 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/feature/QueryRenderedFeaturesBoxCountActivity.java +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/feature/QueryRenderedFeaturesBoxCountActivity.java @@ -2,10 +2,7 @@ package com.mapbox.mapboxsdk.testapp.activity.feature; import android.graphics.RectF; import android.os.Bundle; -import android.support.v7.app.ActionBar; import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.Toolbar; -import android.view.MenuItem; import android.view.View; import android.widget.Toast; @@ -33,7 +30,6 @@ public class QueryRenderedFeaturesBoxCountActivity extends AppCompatActivity { protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_query_features_box); - setupActionBar(); final View selectionBox = findViewById(R.id.selection_box); @@ -135,27 +131,4 @@ public class QueryRenderedFeaturesBoxCountActivity extends AppCompatActivity { super.onLowMemory(); mapView.onLowMemory(); } - - @Override - public boolean onOptionsItemSelected(MenuItem item) { - switch (item.getItemId()) { - case android.R.id.home: - onBackPressed(); - return true; - default: - return super.onOptionsItemSelected(item); - } - } - - private void setupActionBar() { - Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); - setSupportActionBar(toolbar); - - final ActionBar actionBar = getSupportActionBar(); - if (actionBar != null) { - actionBar.setDisplayHomeAsUpEnabled(true); - actionBar.setDisplayShowHomeEnabled(true); - } - } - } diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/feature/QueryRenderedFeaturesBoxHighlightActivity.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/feature/QueryRenderedFeaturesBoxHighlightActivity.java index 8c4a499f9b..9e7d5e0e03 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/feature/QueryRenderedFeaturesBoxHighlightActivity.java +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/feature/QueryRenderedFeaturesBoxHighlightActivity.java @@ -3,10 +3,7 @@ package com.mapbox.mapboxsdk.testapp.activity.feature; import android.graphics.Color; import android.graphics.RectF; import android.os.Bundle; -import android.support.v7.app.ActionBar; import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.Toolbar; -import android.view.MenuItem; import android.view.View; import android.widget.Toast; @@ -37,7 +34,6 @@ public class QueryRenderedFeaturesBoxHighlightActivity extends AppCompatActivity protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_query_features_box); - setupActionBar(); final View selectionBox = findViewById(R.id.selection_box); @@ -84,7 +80,6 @@ public class QueryRenderedFeaturesBoxHighlightActivity extends AppCompatActivity }); } }); - } public MapboxMap getMapboxMap() { @@ -132,27 +127,4 @@ public class QueryRenderedFeaturesBoxHighlightActivity extends AppCompatActivity super.onLowMemory(); mapView.onLowMemory(); } - - @Override - public boolean onOptionsItemSelected(MenuItem item) { - switch (item.getItemId()) { - case android.R.id.home: - onBackPressed(); - return true; - default: - return super.onOptionsItemSelected(item); - } - } - - private void setupActionBar() { - Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); - setSupportActionBar(toolbar); - - final ActionBar actionBar = getSupportActionBar(); - if (actionBar != null) { - actionBar.setDisplayHomeAsUpEnabled(true); - actionBar.setDisplayShowHomeEnabled(true); - } - } - } diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/feature/QueryRenderedFeaturesBoxSymbolCountActivity.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/feature/QueryRenderedFeaturesBoxSymbolCountActivity.java index 4b7bbb9614..2b3655f01e 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/feature/QueryRenderedFeaturesBoxSymbolCountActivity.java +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/feature/QueryRenderedFeaturesBoxSymbolCountActivity.java @@ -4,10 +4,7 @@ import android.graphics.BitmapFactory; import android.graphics.RectF; import android.os.Bundle; import android.support.annotation.RawRes; -import android.support.v7.app.ActionBar; import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.Toolbar; -import android.view.MenuItem; import android.view.View; import android.widget.Toast; @@ -46,7 +43,6 @@ public class QueryRenderedFeaturesBoxSymbolCountActivity extends AppCompatActivi protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_query_features_box); - setupActionBar(); final View selectionBox = findViewById(R.id.selection_box); @@ -160,27 +156,4 @@ public class QueryRenderedFeaturesBoxSymbolCountActivity extends AppCompatActivi super.onLowMemory(); mapView.onLowMemory(); } - - @Override - public boolean onOptionsItemSelected(MenuItem item) { - switch (item.getItemId()) { - case android.R.id.home: - onBackPressed(); - return true; - default: - return super.onOptionsItemSelected(item); - } - } - - private void setupActionBar() { - Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); - setSupportActionBar(toolbar); - - final ActionBar actionBar = getSupportActionBar(); - if (actionBar != null) { - actionBar.setDisplayHomeAsUpEnabled(true); - actionBar.setDisplayShowHomeEnabled(true); - } - } - } diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/feature/QueryRenderedFeaturesPropertiesActivity.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/feature/QueryRenderedFeaturesPropertiesActivity.java index 17dfbc18b4..24c30c76b5 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/feature/QueryRenderedFeaturesPropertiesActivity.java +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/feature/QueryRenderedFeaturesPropertiesActivity.java @@ -6,13 +6,7 @@ import android.os.Bundle; import android.os.Parcel; import android.os.Parcelable; import android.support.annotation.NonNull; -import android.support.v7.app.ActionBar; import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.Toolbar; - -import timber.log.Timber; - -import android.view.MenuItem; import android.view.View; import android.widget.LinearLayout; import android.widget.TextView; @@ -30,6 +24,8 @@ import com.mapbox.services.commons.geojson.Feature; import java.util.List; import java.util.Map; +import timber.log.Timber; + /** * Demo's query rendered features */ @@ -43,7 +39,6 @@ public class QueryRenderedFeaturesPropertiesActivity extends AppCompatActivity { protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_query_features_point); - setupActionBar(); final float density = getResources().getDisplayMetrics().density; @@ -186,28 +181,6 @@ public class QueryRenderedFeaturesPropertiesActivity extends AppCompatActivity { mapView.onLowMemory(); } - @Override - public boolean onOptionsItemSelected(MenuItem item) { - switch (item.getItemId()) { - case android.R.id.home: - onBackPressed(); - return true; - default: - return super.onOptionsItemSelected(item); - } - } - - private void setupActionBar() { - Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); - setSupportActionBar(toolbar); - - final ActionBar actionBar = getSupportActionBar(); - if (actionBar != null) { - actionBar.setDisplayHomeAsUpEnabled(true); - actionBar.setDisplayShowHomeEnabled(true); - } - } - private static class CustomMarker extends Marker { private final List<Feature> features; @@ -245,8 +218,8 @@ public class QueryRenderedFeaturesPropertiesActivity extends AppCompatActivity { return new CustomMarker(this, features); } - public static final Parcelable.Creator<CustomMarkerOptions> CREATOR - = new Parcelable.Creator<CustomMarkerOptions>() { + public static final Parcelable.Creator<CustomMarkerOptions> CREATOR = + new Parcelable.Creator<CustomMarkerOptions>() { public CustomMarkerOptions createFromParcel(Parcel in) { return new CustomMarkerOptions(in); } diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/fragment/MapFragmentActivity.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/fragment/MapFragmentActivity.java index 1c259b1304..f57f56d96c 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/fragment/MapFragmentActivity.java +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/fragment/MapFragmentActivity.java @@ -2,10 +2,7 @@ package com.mapbox.mapboxsdk.testapp.activity.fragment; import android.app.FragmentTransaction; import android.os.Bundle; -import android.support.v7.app.ActionBar; import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.Toolbar; -import android.view.MenuItem; import com.mapbox.mapboxsdk.camera.CameraPosition; import com.mapbox.mapboxsdk.camera.CameraUpdateFactory; @@ -26,15 +23,6 @@ public class MapFragmentActivity extends AppCompatActivity implements OnMapReady super.onCreate(savedInstanceState); setContentView(R.layout.activity_map_fragment); - Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); - setSupportActionBar(toolbar); - - ActionBar actionBar = getSupportActionBar(); - if (actionBar != null) { - actionBar.setDisplayHomeAsUpEnabled(true); - actionBar.setDisplayShowHomeEnabled(true); - } - MapFragment mapFragment; if (savedInstanceState == null) { final FragmentTransaction transaction = getFragmentManager().beginTransaction(); @@ -75,15 +63,4 @@ public class MapFragmentActivity extends AppCompatActivity implements OnMapReady mapboxMap.animateCamera( CameraUpdateFactory.newCameraPosition(new CameraPosition.Builder().tilt(45.0).build()), 10000); } - - @Override - public boolean onOptionsItemSelected(MenuItem item) { - switch (item.getItemId()) { - case android.R.id.home: - onBackPressed(); - return true; - default: - return super.onOptionsItemSelected(item); - } - } } diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/fragment/SupportMapFragmentActivity.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/fragment/SupportMapFragmentActivity.java index 7dcca89a04..b6db63d38c 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/fragment/SupportMapFragmentActivity.java +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/fragment/SupportMapFragmentActivity.java @@ -2,10 +2,7 @@ package com.mapbox.mapboxsdk.testapp.activity.fragment; import android.os.Bundle; import android.support.v4.app.FragmentTransaction; -import android.support.v7.app.ActionBar; import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.Toolbar; -import android.view.MenuItem; import com.mapbox.mapboxsdk.camera.CameraPosition; import com.mapbox.mapboxsdk.camera.CameraUpdateFactory; @@ -26,15 +23,6 @@ public class SupportMapFragmentActivity extends AppCompatActivity implements OnM super.onCreate(savedInstanceState); setContentView(R.layout.activity_map_fragment); - Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); - setSupportActionBar(toolbar); - - ActionBar actionBar = getSupportActionBar(); - if (actionBar != null) { - actionBar.setDisplayHomeAsUpEnabled(true); - actionBar.setDisplayShowHomeEnabled(true); - } - SupportMapFragment mapFragment; if (savedInstanceState == null) { final FragmentTransaction transaction = getSupportFragmentManager().beginTransaction(); @@ -73,15 +61,4 @@ public class SupportMapFragmentActivity extends AppCompatActivity implements OnM mapboxMap.animateCamera( CameraUpdateFactory.newCameraPosition(new CameraPosition.Builder().tilt(45.0).build()), 10000); } - - @Override - public boolean onOptionsItemSelected(MenuItem item) { - switch (item.getItemId()) { - case android.R.id.home: - onBackPressed(); - return true; - default: - return super.onOptionsItemSelected(item); - } - } } diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/fragment/ViewPagerActivity.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/fragment/ViewPagerActivity.java index e6953bd3d2..7d2ebefea1 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/fragment/ViewPagerActivity.java +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/fragment/ViewPagerActivity.java @@ -5,10 +5,7 @@ import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentPagerAdapter; import android.support.v4.view.ViewPager; -import android.support.v7.app.ActionBar; import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.Toolbar; -import android.view.MenuItem; import com.mapbox.mapboxsdk.camera.CameraPosition; import com.mapbox.mapboxsdk.constants.Style; @@ -24,15 +21,6 @@ public class ViewPagerActivity extends AppCompatActivity { super.onCreate(savedInstanceState); setContentView(R.layout.activity_viewpager); - final Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); - setSupportActionBar(toolbar); - - ActionBar actionBar = getSupportActionBar(); - if (actionBar != null) { - actionBar.setDisplayHomeAsUpEnabled(true); - actionBar.setDisplayShowHomeEnabled(true); - } - ViewPager viewPager = (ViewPager) findViewById(R.id.viewpager); if (viewPager != null) { MapFragmentAdapter adapter = new MapFragmentAdapter(getSupportFragmentManager()); @@ -78,22 +66,10 @@ public class ViewPagerActivity extends AppCompatActivity { return fragment; } - @Override public CharSequence getPageTitle(int position) { return "Page " + position; } } - - @Override - public boolean onOptionsItemSelected(MenuItem item) { - switch (item.getItemId()) { - case android.R.id.home: - onBackPressed(); - return true; - default: - return super.onOptionsItemSelected(item); - } - } } diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/geocoding/GeocoderActivity.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/geocoding/GeocoderActivity.java deleted file mode 100644 index 39d52f7876..0000000000 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/geocoding/GeocoderActivity.java +++ /dev/null @@ -1,205 +0,0 @@ -package com.mapbox.mapboxsdk.testapp.activity.geocoding; - -import android.graphics.PointF; -import android.os.Bundle; -import android.support.annotation.NonNull; -import android.support.v7.app.ActionBar; -import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.Toolbar; - -import timber.log.Timber; - -import android.view.Gravity; -import android.view.MenuItem; -import android.view.ViewGroup; -import android.widget.FrameLayout; -import android.widget.ImageView; -import android.widget.TextView; - -import com.mapbox.mapboxsdk.annotations.MarkerOptions; -import com.mapbox.mapboxsdk.constants.Style; -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.maps.Projection; -import com.mapbox.mapboxsdk.testapp.R; -import com.mapbox.services.api.ServicesException; -import com.mapbox.services.commons.models.Position; -import com.mapbox.services.api.geocoding.v5.GeocodingCriteria; -import com.mapbox.services.api.geocoding.v5.MapboxGeocoding; -import com.mapbox.services.api.geocoding.v5.models.CarmenFeature; -import com.mapbox.services.api.geocoding.v5.models.GeocodingResponse; - -import java.util.List; - -import retrofit2.Call; -import retrofit2.Callback; -import retrofit2.Response; - -public class GeocoderActivity extends AppCompatActivity implements OnMapReadyCallback { - - private MapboxMap mapboxMap; - private MapView mapView; - private ImageView dropPinView; - private TextView textView; - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_geocoder); - - Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); - setSupportActionBar(toolbar); - - ActionBar actionBar = getSupportActionBar(); - if (actionBar != null) { - actionBar.setDisplayHomeAsUpEnabled(true); - actionBar.setDisplayShowHomeEnabled(true); - } - - textView = (TextView) findViewById(R.id.message); - setMessage(getString(R.string.geocoder_instructions)); - - mapView = (MapView) findViewById(R.id.mapView); - mapView.setStyleUrl(Style.MAPBOX_STREETS); - mapView.onCreate(savedInstanceState); - - dropPinView = new ImageView(this); - dropPinView.setImageResource(R.drawable.ic_droppin_24dp); - FrameLayout.LayoutParams params = new FrameLayout.LayoutParams( - ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT, Gravity.CENTER); - dropPinView.setLayoutParams(params); - mapView.addView(dropPinView); - mapView.getMapAsync(this); - } - - @Override - public void onMapReady(MapboxMap map) { - mapboxMap = map; - final Projection projection = mapboxMap.getProjection(); - final int width = mapView.getMeasuredWidth(); - final int height = mapView.getMeasuredHeight(); - - // Click listener - mapboxMap.setOnMapClickListener(new MapboxMap.OnMapClickListener() { - @Override - public void onMapClick(@NonNull LatLng point) { - PointF centerPoint = new PointF(width / 2, (height + dropPinView.getHeight()) / 2); - LatLng centerLatLng = new LatLng(projection.fromScreenLocation(centerPoint)); - - setMessage("Geocoding..."); - - mapboxMap.removeAnnotations(); - mapboxMap.addMarker(new MarkerOptions().position(centerLatLng)); - - geocode(centerLatLng); - } - }); - } - - @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 - protected void onDestroy() { - super.onDestroy(); - mapView.onDestroy(); - } - - @Override - protected void onSaveInstanceState(Bundle outState) { - super.onSaveInstanceState(outState); - mapView.onSaveInstanceState(outState); - } - - /* - * Forward geocoding - */ - - private void geocode(final LatLng point) { - - try { - MapboxGeocoding client = new MapboxGeocoding.Builder() - .setAccessToken(getString(R.string.mapbox_access_token)) - .setCoordinates(Position.fromCoordinates(point.getLongitude(), point.getLatitude())) - .setGeocodingType(GeocodingCriteria.TYPE_POI) - .build(); - - client.enqueueCall(new Callback<GeocodingResponse>() { - @Override - public void onResponse(Call<GeocodingResponse> call, Response<GeocodingResponse> response) { - - List<CarmenFeature> results = response.body().getFeatures(); - if (results.size() > 0) { - String placeName = results.get(0).getPlaceName(); - setSuccess(placeName); - } else { - setMessage("No results."); - } - - } - - @Override - public void onFailure(Call<GeocodingResponse> call, Throwable throwable) { - setError(throwable.getMessage()); - } - }); - } catch (ServicesException servicesException) { - Timber.e("Error geocoding: " + servicesException.toString()); - servicesException.printStackTrace(); - setError(servicesException.getMessage()); - } - } - - /* - * Update text view - */ - - private void setMessage(String message) { - Timber.d("Message: " + message); - textView.setText(message); - } - - private void setSuccess(String placeName) { - Timber.d("Place name: " + placeName); - textView.setText(placeName); - } - - private void setError(String message) { - Timber.e("Error: " + message); - textView.setText("Error: " + message); - } - - @Override - public boolean onOptionsItemSelected(MenuItem item) { - switch (item.getItemId()) { - case android.R.id.home: - onBackPressed(); - return true; - default: - return super.onOptionsItemSelected(item); - } - } -} diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/imagegenerator/PrintActivity.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/imagegenerator/PrintActivity.java index 7f3c16d7b8..0b24e23808 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/imagegenerator/PrintActivity.java +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/imagegenerator/PrintActivity.java @@ -4,10 +4,7 @@ import android.graphics.Bitmap; import android.os.Bundle; import android.support.annotation.NonNull; import android.support.v4.print.PrintHelper; -import android.support.v7.app.ActionBar; import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.Toolbar; -import android.view.MenuItem; import android.view.View; import com.mapbox.mapboxsdk.maps.MapView; @@ -25,15 +22,6 @@ public class PrintActivity extends AppCompatActivity implements MapboxMap.Snapsh super.onCreate(savedInstanceState); setContentView(R.layout.activity_print); - Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); - setSupportActionBar(toolbar); - - final ActionBar actionBar = getSupportActionBar(); - if (actionBar != null) { - actionBar.setDisplayHomeAsUpEnabled(true); - actionBar.setDisplayShowHomeEnabled(true); - } - mapView = (MapView) findViewById(R.id.mapView); mapView.onCreate(savedInstanceState); mapView.getMapAsync(new OnMapReadyCallback() { @@ -104,16 +92,4 @@ public class PrintActivity extends AppCompatActivity implements MapboxMap.Snapsh super.onLowMemory(); mapView.onLowMemory(); } - - @Override - public boolean onOptionsItemSelected(MenuItem item) { - switch (item.getItemId()) { - case android.R.id.home: - onBackPressed(); - return true; - default: - return super.onOptionsItemSelected(item); - } - } - } diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/imagegenerator/SnapshotActivity.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/imagegenerator/SnapshotActivity.java index 3912dfa918..c1fa768f83 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/imagegenerator/SnapshotActivity.java +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/imagegenerator/SnapshotActivity.java @@ -4,10 +4,7 @@ import android.graphics.Bitmap; import android.os.Bundle; import android.support.design.widget.FloatingActionButton; import android.support.v4.content.ContextCompat; -import android.support.v7.app.ActionBar; import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.Toolbar; -import android.view.MenuItem; import android.view.View; import android.widget.ImageView; import android.widget.Toast; @@ -28,15 +25,6 @@ public class SnapshotActivity extends AppCompatActivity implements OnMapReadyCal super.onCreate(savedInstanceState); setContentView(R.layout.activity_snapshot); - Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); - setSupportActionBar(toolbar); - - ActionBar actionBar = getSupportActionBar(); - if (actionBar != null) { - actionBar.setDisplayHomeAsUpEnabled(true); - actionBar.setDisplayShowHomeEnabled(true); - } - mapView = (MapView) findViewById(R.id.mapView); mapView.onCreate(savedInstanceState); mapView.getMapAsync(this); @@ -112,15 +100,4 @@ public class SnapshotActivity extends AppCompatActivity implements OnMapReadyCal super.onDestroy(); mapView.onDestroy(); } - - @Override - public boolean onOptionsItemSelected(MenuItem item) { - switch (item.getItemId()) { - case android.R.id.home: - onBackPressed(); - return true; - default: - return super.onOptionsItemSelected(item); - } - } } diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/infowindow/DynamicInfoWindowAdapterActivity.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/infowindow/DynamicInfoWindowAdapterActivity.java index c70e263be5..15749cbd19 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/infowindow/DynamicInfoWindowAdapterActivity.java +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/infowindow/DynamicInfoWindowAdapterActivity.java @@ -7,10 +7,7 @@ import android.os.Bundle; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.support.v4.content.ContextCompat; -import android.support.v7.app.ActionBar; import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.Toolbar; -import android.view.MenuItem; import android.view.View; import android.widget.TextView; @@ -41,8 +38,6 @@ public class DynamicInfoWindowAdapterActivity extends AppCompatActivity implemen super.onCreate(savedInstanceState); setContentView(R.layout.activity_infowindow_adapter); - setupActionBar(); - mapView = (MapView) findViewById(R.id.mapView); mapView.onCreate(savedInstanceState); mapView.getMapAsync(this); @@ -162,26 +157,4 @@ public class DynamicInfoWindowAdapterActivity extends AppCompatActivity implemen super.onLowMemory(); mapView.onLowMemory(); } - - @Override - public boolean onOptionsItemSelected(MenuItem item) { - switch (item.getItemId()) { - case android.R.id.home: - onBackPressed(); - return true; - default: - return super.onOptionsItemSelected(item); - } - } - - private void setupActionBar() { - Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); - setSupportActionBar(toolbar); - - ActionBar actionBar = getSupportActionBar(); - if (actionBar != null) { - actionBar.setDisplayHomeAsUpEnabled(true); - actionBar.setDisplayShowHomeEnabled(true); - } - } } diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/infowindow/InfoWindowActivity.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/infowindow/InfoWindowActivity.java index 0c2af9b7e3..45ccfcec72 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/infowindow/InfoWindowActivity.java +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/infowindow/InfoWindowActivity.java @@ -2,20 +2,18 @@ package com.mapbox.mapboxsdk.testapp.activity.infowindow; import android.os.Bundle; import android.support.annotation.NonNull; -import android.support.v7.app.ActionBar; import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.Toolbar; import android.view.Menu; import android.view.MenuItem; import android.widget.Toast; -import com.mapbox.mapboxsdk.maps.MapboxMap; import com.mapbox.mapboxsdk.annotations.Marker; import com.mapbox.mapboxsdk.annotations.MarkerOptions; 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.maps.MapView; import java.text.DecimalFormat; @@ -32,15 +30,6 @@ public class InfoWindowActivity extends AppCompatActivity super.onCreate(savedInstanceState); setContentView(R.layout.activity_infowindow); - Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); - setSupportActionBar(toolbar); - - ActionBar actionBar = getSupportActionBar(); - if (actionBar != null) { - actionBar.setDisplayHomeAsUpEnabled(true); - actionBar.setDisplayShowHomeEnabled(true); - } - mapView = (MapView) findViewById(R.id.mapView); mapView.onCreate(savedInstanceState); mapView.getMapAsync(this); @@ -188,9 +177,6 @@ public class InfoWindowActivity extends AppCompatActivity toggleDeselectMarkersOnTap(!item.isChecked()); item.setChecked(!item.isChecked()); return true; - case android.R.id.home: - onBackPressed(); - return true; default: return super.onOptionsItemSelected(item); } diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/infowindow/InfoWindowAdapterActivity.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/infowindow/InfoWindowAdapterActivity.java index 08f64abcba..f6a07c1310 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/infowindow/InfoWindowAdapterActivity.java +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/infowindow/InfoWindowAdapterActivity.java @@ -6,10 +6,7 @@ import android.graphics.drawable.Drawable; import android.os.Bundle; import android.support.annotation.NonNull; import android.support.v4.content.ContextCompat; -import android.support.v7.app.ActionBar; import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.Toolbar; -import android.view.MenuItem; import android.view.View; import android.widget.TextView; @@ -36,15 +33,6 @@ public class InfoWindowAdapterActivity extends AppCompatActivity { super.onCreate(savedInstanceState); setContentView(R.layout.activity_infowindow_adapter); - Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); - setSupportActionBar(toolbar); - - ActionBar actionBar = getSupportActionBar(); - if (actionBar != null) { - actionBar.setDisplayHomeAsUpEnabled(true); - actionBar.setDisplayShowHomeEnabled(true); - } - iconFactory = IconFactory.getInstance(this); iconDrawable = ContextCompat.getDrawable(this, R.drawable.ic_location_city_24dp); @@ -144,15 +132,4 @@ public class InfoWindowAdapterActivity extends AppCompatActivity { super.onLowMemory(); mapView.onLowMemory(); } - - @Override - public boolean onOptionsItemSelected(MenuItem item) { - switch (item.getItemId()) { - case android.R.id.home: - onBackPressed(); - return true; - default: - return super.onOptionsItemSelected(item); - } - } } diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/DebugModeActivity.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/DebugModeActivity.java index 5c9d927e9b..21147e80d9 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/DebugModeActivity.java +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/DebugModeActivity.java @@ -3,13 +3,7 @@ package com.mapbox.mapboxsdk.testapp.activity.maplayout; import android.os.Bundle; import android.support.annotation.NonNull; import android.support.design.widget.FloatingActionButton; -import android.support.v7.app.ActionBar; import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.Toolbar; - -import timber.log.Timber; - -import android.view.MenuItem; import android.view.View; import com.mapbox.mapboxsdk.constants.Style; @@ -18,6 +12,8 @@ import com.mapbox.mapboxsdk.maps.MapboxMap; import com.mapbox.mapboxsdk.maps.OnMapReadyCallback; import com.mapbox.mapboxsdk.testapp.R; +import timber.log.Timber; + public class DebugModeActivity extends AppCompatActivity { private MapView mapView; @@ -39,15 +35,6 @@ public class DebugModeActivity extends AppCompatActivity { super.onCreate(savedInstanceState); setContentView(R.layout.activity_debug_mode); - final Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); - setSupportActionBar(toolbar); - - ActionBar actionBar = getSupportActionBar(); - if (actionBar != null) { - actionBar.setDisplayHomeAsUpEnabled(true); - actionBar.setDisplayShowHomeEnabled(true); - } - mapView = (MapView) findViewById(R.id.mapView); mapView.setTag(true); mapView.setStyleUrl(STYLES[currentStyleIndex]); @@ -127,16 +114,4 @@ public class DebugModeActivity extends AppCompatActivity { super.onLowMemory(); mapView.onLowMemory(); } - - @Override - public boolean onOptionsItemSelected(MenuItem item) { - switch (item.getItemId()) { - case android.R.id.home: - onBackPressed(); - return true; - - default: - return super.onOptionsItemSelected(item); - } - } } diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/DoubleMapActivity.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/DoubleMapActivity.java index 6c43e28237..fef2ebaff7 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/DoubleMapActivity.java +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/DoubleMapActivity.java @@ -6,11 +6,8 @@ import android.os.Bundle; import android.support.annotation.NonNull; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentTransaction; -import android.support.v7.app.ActionBar; import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.Toolbar; import android.view.LayoutInflater; -import android.view.MenuItem; import android.view.SurfaceView; import android.view.View; import android.view.ViewGroup; @@ -38,15 +35,6 @@ public class DoubleMapActivity extends AppCompatActivity { super.onCreate(savedInstanceState); setContentView(R.layout.activity_map_fragment); - Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); - setSupportActionBar(toolbar); - - ActionBar actionBar = getSupportActionBar(); - if (actionBar != null) { - actionBar.setDisplayHomeAsUpEnabled(true); - actionBar.setDisplayShowHomeEnabled(true); - } - if (savedInstanceState == null) { FragmentTransaction transaction = getSupportFragmentManager().beginTransaction(); transaction.add(R.id.fragment_container, new DoubleMapFragment(), TAG_FRAGMENT); @@ -189,15 +177,4 @@ public class DoubleMapActivity extends AppCompatActivity { mapViewMini.onSaveInstanceState(outState); } } - - @Override - public boolean onOptionsItemSelected(MenuItem item) { - switch (item.getItemId()) { - case android.R.id.home: - onBackPressed(); - return true; - default: - return super.onOptionsItemSelected(item); - } - } }
\ No newline at end of file diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/MapInDialogActivity.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/MapInDialogActivity.java index ed3f315e06..d54a7fe509 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/MapInDialogActivity.java +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/MapInDialogActivity.java @@ -4,11 +4,8 @@ import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v4.app.DialogFragment; import android.support.v4.app.FragmentManager; -import android.support.v7.app.ActionBar; import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.Toolbar; import android.view.LayoutInflater; -import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; import android.widget.Button; @@ -23,15 +20,6 @@ public class MapInDialogActivity extends AppCompatActivity { super.onCreate(savedInstanceState); setContentView(R.layout.activity_map_in_dialog); - Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); - setSupportActionBar(toolbar); - - ActionBar actionBar = getSupportActionBar(); - if (actionBar != null) { - actionBar.setDisplayHomeAsUpEnabled(true); - actionBar.setDisplayShowHomeEnabled(true); - } - Button button = (Button) findViewById(R.id.button_open_dialog); button.setOnClickListener(new View.OnClickListener() { @Override @@ -43,17 +31,6 @@ public class MapInDialogActivity extends AppCompatActivity { }); } - @Override - public boolean onOptionsItemSelected(MenuItem item) { - switch (item.getItemId()) { - case android.R.id.home: - onBackPressed(); - return true; - default: - return super.onOptionsItemSelected(item); - } - } - public static class MapDialogFragment extends DialogFragment { private MapView mapView; diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/MapPaddingActivity.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/MapPaddingActivity.java index 90b91057ed..61d9a5c190 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/MapPaddingActivity.java +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/MapPaddingActivity.java @@ -2,17 +2,15 @@ package com.mapbox.mapboxsdk.testapp.activity.maplayout; import android.os.Bundle; import android.support.annotation.NonNull; -import android.support.v7.app.ActionBar; import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.Toolbar; import android.view.Menu; import android.view.MenuItem; import com.mapbox.mapboxsdk.annotations.MarkerOptions; import com.mapbox.mapboxsdk.camera.CameraPosition; +import com.mapbox.mapboxsdk.camera.CameraUpdateFactory; import com.mapbox.mapboxsdk.constants.MyLocationTracking; import com.mapbox.mapboxsdk.geometry.LatLng; -import com.mapbox.mapboxsdk.camera.CameraUpdateFactory; import com.mapbox.mapboxsdk.maps.MapView; import com.mapbox.mapboxsdk.maps.MapboxMap; import com.mapbox.mapboxsdk.maps.OnMapReadyCallback; @@ -29,15 +27,6 @@ public class MapPaddingActivity extends AppCompatActivity { super.onCreate(savedInstanceState); setContentView(R.layout.activity_map_padding); - final Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); - setSupportActionBar(toolbar); - - ActionBar actionBar = getSupportActionBar(); - if (actionBar != null) { - actionBar.setDisplayHomeAsUpEnabled(true); - actionBar.setDisplayShowHomeEnabled(true); - } - mapView = (MapView) findViewById(R.id.mapView); mapView.setTag(true); mapView.onCreate(savedInstanceState); @@ -50,7 +39,8 @@ public class MapPaddingActivity extends AppCompatActivity { int paddingLeft = (int) getResources().getDimension(R.dimen.map_padding_left); int paddingBottom = (int) getResources().getDimension(R.dimen.map_padding_bottom); int paddingRight = (int) getResources().getDimension(R.dimen.map_padding_right); - mapboxMap.setPadding(paddingLeft, toolbar.getHeight(), paddingRight, paddingBottom); + int paddingTop = (int) getResources().getDimension(R.dimen.map_padding_top); + mapboxMap.setPadding(paddingLeft, paddingTop, paddingRight, paddingBottom); moveToBangalore(); } @@ -138,10 +128,6 @@ public class MapPaddingActivity extends AppCompatActivity { @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { - case android.R.id.home: - onBackPressed(); - return true; - case R.id.action_user_tracking: if (mapboxMap != null) { toggleGps(true); diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/SimpleMapActivity.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/SimpleMapActivity.java index 7e04b95e20..1411cc176e 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/SimpleMapActivity.java +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/SimpleMapActivity.java @@ -1,10 +1,7 @@ package com.mapbox.mapboxsdk.testapp.activity.maplayout; import android.os.Bundle; -import android.support.v7.app.ActionBar; import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.Toolbar; -import android.view.MenuItem; import com.mapbox.mapboxsdk.maps.MapView; import com.mapbox.mapboxsdk.testapp.R; @@ -18,15 +15,6 @@ public class SimpleMapActivity extends AppCompatActivity { super.onCreate(savedInstanceState); setContentView(R.layout.activity_map_simple); - Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); - setSupportActionBar(toolbar); - - final ActionBar actionBar = getSupportActionBar(); - if (actionBar != null) { - actionBar.setDisplayHomeAsUpEnabled(true); - actionBar.setDisplayShowHomeEnabled(true); - } - mapView = (MapView) findViewById(R.id.mapView); mapView.onCreate(savedInstanceState); } @@ -72,15 +60,4 @@ public class SimpleMapActivity extends AppCompatActivity { super.onSaveInstanceState(outState); mapView.onSaveInstanceState(outState); } - - @Override - public boolean onOptionsItemSelected(MenuItem item) { - switch (item.getItemId()) { - case android.R.id.home: - onBackPressed(); - return true; - default: - return super.onOptionsItemSelected(item); - } - } } diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/navigation/CarDrivingActivity.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/navigation/CarDrivingActivity.java deleted file mode 100644 index 4bb6bc5f39..0000000000 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/navigation/CarDrivingActivity.java +++ /dev/null @@ -1,201 +0,0 @@ -package com.mapbox.mapboxsdk.testapp.activity.navigation; - -import android.Manifest; -import android.content.pm.PackageManager; -import android.graphics.Color; -import android.graphics.drawable.Drawable; -import android.location.Location; -import android.os.Bundle; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; -import android.support.annotation.UiThread; -import android.support.v4.app.ActivityCompat; -import android.support.v4.content.ContextCompat; -import android.support.v4.content.res.ResourcesCompat; -import android.support.v7.app.ActionBar; -import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.Toolbar; -import android.view.MenuItem; - - -import com.mapbox.mapboxsdk.camera.CameraPosition; -import com.mapbox.mapboxsdk.camera.CameraUpdateFactory; -import com.mapbox.mapboxsdk.constants.MyBearingTracking; -import com.mapbox.mapboxsdk.constants.MyLocationTracking; -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.maps.TrackingSettings; -import com.mapbox.mapboxsdk.maps.widgets.MyLocationViewSettings; -import com.mapbox.mapboxsdk.testapp.R; - -public class CarDrivingActivity extends AppCompatActivity implements MapboxMap.OnMyLocationChangeListener { - - private static final int PERMISSIONS_LOCATION = 0; - - private MapView mapView; - private MapboxMap mapboxMap; - private Location location; - - @Override - protected void onCreate(final Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_car_driving); - - Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); - setSupportActionBar(toolbar); - - final ActionBar actionBar = getSupportActionBar(); - if (actionBar != null) { - actionBar.setDisplayHomeAsUpEnabled(true); - actionBar.setDisplayShowHomeEnabled(true); - } - - mapView = (MapView) findViewById(R.id.mapView); - mapView.onCreate(savedInstanceState); - mapView.getMapAsync(new OnMapReadyCallback() { - @Override - public void onMapReady(@NonNull MapboxMap mapboxMap) { - CarDrivingActivity.this.mapboxMap = mapboxMap; - - // view settings - MyLocationViewSettings settings = mapboxMap.getMyLocationViewSettings(); - settings.setPadding(0, getWindow().getDecorView().getMeasuredHeight() / 3, 0, 0); - - // get car - Drawable car = ResourcesCompat.getDrawable(getResources(), R.drawable.ic_taxi_top_small, getTheme()); - settings.setForegroundTintColor(Color.TRANSPARENT); - settings.setForegroundDrawable(car, car); - - // remove accuracy circle - settings.setAccuracyAlpha(0); - - // disable dismissal when a gesture occurs - TrackingSettings trackingSettings = mapboxMap.getTrackingSettings(); - trackingSettings.setDismissLocationTrackingOnGesture(false); - trackingSettings.setDismissBearingTrackingOnGesture(false); - - mapboxMap.setOnMyLocationChangeListener(CarDrivingActivity.this); - - if (savedInstanceState == null) { - toggleGps(true); - } - } - }); - } - - @UiThread - public void toggleGps(boolean enableGps) { - if (enableGps) { - if ((ContextCompat.checkSelfPermission(this, - Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) - || (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) - != PackageManager.PERMISSION_GRANTED)) { - ActivityCompat.requestPermissions(this, new String[] { - Manifest.permission.ACCESS_COARSE_LOCATION, - Manifest.permission.ACCESS_FINE_LOCATION}, PERMISSIONS_LOCATION); - } else { - enableLocation(true); - } - } else { - enableLocation(false); - } - } - - private void enableLocation(boolean enabled) { - if (enabled) { - mapboxMap.setMyLocationEnabled(true); - Location location = mapboxMap.getMyLocation(); - if (location != null) { - setInitialPosition(new LatLng(location)); - } - } else { - mapboxMap.setMyLocationEnabled(false); - } - } - - @Override - public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) { - if (requestCode == PERMISSIONS_LOCATION) { - if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) { - enableLocation(true); - } - } - } - - private void setInitialPosition(LatLng latLng) { - mapboxMap.moveCamera(CameraUpdateFactory.newCameraPosition( - new CameraPosition.Builder().target(latLng).zoom(15).tilt(20f).build())); - mapboxMap.setMyLocationEnabled(true); - - TrackingSettings trackingSettings = mapboxMap.getTrackingSettings(); - trackingSettings.setMyLocationTrackingMode(MyLocationTracking.TRACKING_FOLLOW); - trackingSettings.setMyBearingTrackingMode(MyBearingTracking.GPS); - } - - @Override - public void onMyLocationChange(@Nullable Location location) { - if (location != null) { - if (this.location == null) { - // initial location to reposition map - setInitialPosition(new LatLng(location)); - } - this.location = location; - } - } - - @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 - protected void onSaveInstanceState(Bundle outState) { - super.onSaveInstanceState(outState); - mapView.onSaveInstanceState(outState); - } - - @Override - protected void onDestroy() { - super.onDestroy(); - mapView.onDestroy(); - } - - @Override - public void onLowMemory() { - super.onLowMemory(); - mapView.onLowMemory(); - } - - @Override - public boolean onOptionsItemSelected(MenuItem item) { - switch (item.getItemId()) { - case android.R.id.home: - onBackPressed(); - return true; - default: - return super.onOptionsItemSelected(item); - } - } - -} diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/navigation/LocationPickerActivity.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/navigation/LocationPickerActivity.java deleted file mode 100644 index 8fb53645a1..0000000000 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/navigation/LocationPickerActivity.java +++ /dev/null @@ -1,477 +0,0 @@ -package com.mapbox.mapboxsdk.testapp.activity.navigation; - -import android.Manifest; -import android.app.ProgressDialog; -import android.content.Context; -import android.content.pm.PackageManager; -import android.graphics.PointF; -import android.location.Location; -import android.os.Build; -import android.os.Bundle; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; -import android.support.v4.app.ActivityCompat; -import android.support.v7.app.ActionBar; -import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.Toolbar; - -import timber.log.Timber; - -import android.view.Gravity; -import android.view.LayoutInflater; -import android.view.MenuItem; -import android.view.View; -import android.view.ViewGroup; -import android.view.animation.Animation; -import android.view.animation.AnimationUtils; -import android.widget.Button; -import android.widget.FrameLayout; -import android.widget.ImageButton; -import android.widget.ImageView; -import android.widget.Toast; - -import com.mapbox.mapboxsdk.annotations.IconFactory; -import com.mapbox.mapboxsdk.annotations.Marker; -import com.mapbox.mapboxsdk.annotations.MarkerView; -import com.mapbox.mapboxsdk.annotations.MarkerViewOptions; -import com.mapbox.mapboxsdk.camera.CameraPosition; -import com.mapbox.mapboxsdk.geometry.LatLng; -import com.mapbox.mapboxsdk.location.LocationListener; -import com.mapbox.mapboxsdk.location.LocationServices; -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.model.annotations.PulseMarkerView; -import com.mapbox.mapboxsdk.testapp.model.annotations.PulseMarkerViewOptions; -import com.mapbox.services.api.ServicesException; -import com.mapbox.services.commons.models.Position; -import com.mapbox.services.api.geocoding.v5.GeocodingCriteria; -import com.mapbox.services.api.geocoding.v5.MapboxGeocoding; -import com.mapbox.services.api.geocoding.v5.models.CarmenFeature; -import com.mapbox.services.api.geocoding.v5.models.GeocodingResponse; - -import java.util.List; - -import retrofit2.Call; -import retrofit2.Callback; -import retrofit2.Response; - -/** - * Sample Activity to show a typical location picker use case - */ -public class LocationPickerActivity extends AppCompatActivity { - private static final int REQUEST_PERMISSIONS = 101; - - private MapView mapView; - private MapboxMap mapboxMap; - - private ImageView dropPinView; - private Marker addressPin; - private ImageButton clearDisplayViewButton; - private MarkerView userMarker; - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_location_picker); - - setupActionBar(); - - //Initialize map as normal - mapView = (MapView) findViewById(R.id.mapView); - mapView.onCreate(savedInstanceState); - - //Create ui elements - createDropPin(); - createSelectLocationButton(); - createClearSelectionButton(); - - mapView.getMapAsync(new OnMapReadyCallback() { - @Override - public void onMapReady(MapboxMap map) { - //Store for later - mapboxMap = map; - - //Add user marker - mapboxMap.getMarkerViewManager().addMarkerViewAdapter( - new PulseMarkerViewAdapter(LocationPickerActivity.this)); - userMarker = createCustomUserMarker(new LatLng(0, 0)); - - //Fix the focal point to the center of the map - PointF focalPoint = new PointF( - (mapView.getX() + mapView.getWidth() / 2), (mapView.getY() + mapView.getHeight() / 2)); - mapboxMap.getUiSettings().setFocalPoint(focalPoint); - - //Track camera updates to animate the user location views - trackUserLocationView(userMarker); - } - }); - } - - private void zoomInOn(Location location) { - //Move the camera to the user - if (location != null) { - mapboxMap.setCameraPosition(new CameraPosition.Builder() - .target(new LatLng(location)) - .zoom(16) - .bearing(0) - .tilt(0) - .build()); - } - } - - - /** - * Tracks the camera to animate the marker when overlapping with the picker. - * Makes sure the marker actually points to the user's position by tracking it. - */ - private void trackUserLocationView(final MarkerView markerView) { - final float circleDiameterSize = getResources().getDimension(R.dimen.circle_size); - - //Track camera changes to check for overlap - mapboxMap.setOnCameraChangeListener(new MapboxMap.OnCameraChangeListener() { - - private Animation pulseAnimation; - - @Override - public void onCameraChange(CameraPosition position) { - if (markerView == null) { - return; - } - - //Make drop pin visible, if it wasn't already - showDropPin(); - - //Get the distance from the tip of the location picker to the MarkerView - double distance = getLocationPickerLocation().distanceTo(markerView.getPosition()); - - //If closeby, animate, otherwise, stop animation - View view = mapboxMap.getMarkerViewManager().getView(markerView); - if (view != null) { - View backgroundView = view.findViewById(R.id.background_imageview); - if (pulseAnimation == null && distance < 0.5f * circleDiameterSize) { - pulseAnimation = AnimationUtils.loadAnimation(LocationPickerActivity.this, R.anim.pulse); - pulseAnimation.setRepeatCount(Animation.INFINITE); - pulseAnimation.setRepeatMode(Animation.RESTART); - backgroundView.startAnimation(pulseAnimation); - } else if (pulseAnimation != null && distance >= 0.5f * circleDiameterSize) { - backgroundView.clearAnimation(); - pulseAnimation = null; - } - } - } - }); - - //Track location updates to move the user marker - LocationServices.getLocationServices(getApplicationContext()).addLocationListener(new LocationListener() { - @Override - public void onLocationChanged(Location location) { - if (location != null && markerView != null) { - markerView.setPosition(new LatLng(location)); - } - } - }); - } - - private MarkerView createCustomUserMarker(LatLng markerPosition) { - return mapboxMap.addMarker(new PulseMarkerViewOptions() - .icon(IconFactory.getInstance(getApplicationContext()).fromResource(R.drawable.ic_my_location_24dp)) - .position(markerPosition) - ); - } - - private void createClearSelectionButton() { - clearDisplayViewButton = (ImageButton) findViewById(R.id.clearDisplayViewButton); - clearDisplayViewButton.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View view) { - removeAddressPin(); - hide(clearDisplayViewButton); - showDropPin(); - } - }); - } - - private void createSelectLocationButton() { - Button selectLocationButton = (Button) findViewById(R.id.selectLocationButton); - //noinspection ConstantConditions - selectLocationButton.setOnClickListener( - new View.OnClickListener() { - @Override - public void onClick(View view) { - Timber.i("Location Selected!"); - if (mapboxMap != null) { - //Control button's state - clearDisplayViewButton.setVisibility(View.VISIBLE); - dropPinView.setVisibility(View.INVISIBLE); - - //Get position for the drop pin - LatLng position = getLocationPickerLocation(); - - //Show the address pin (result) - showAddressPin(position); - - //Get the address for that location and update the marker - geocode(position, new GeocodeCallbacks() { - @Override - public void onResult(String result) { - updateAddressPin(result); - } - - @Override - public void onFailure(Throwable failure) { - showFeedbackMessage("Could not retrieve address: " + failure.getMessage()); - } - }); - } - } - } - ); - } - - private void createDropPin() { - float density = getResources().getDisplayMetrics().density; - - dropPinView = new ImageView(this); - dropPinView.setImageResource(R.drawable.ic_droppin_24dp); - FrameLayout.LayoutParams params = new FrameLayout.LayoutParams( - ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT, Gravity.CENTER); - params.bottomMargin = (int) (12 * density); - dropPinView.setLayoutParams(params); - - mapView.addView(dropPinView); - } - - private void showDropPin() { - if (dropPinView != null && dropPinView.getVisibility() != View.VISIBLE) { - dropPinView.setVisibility(View.VISIBLE); - } - } - - private void hide(View view) { - if (view != null) { - view.setVisibility(View.INVISIBLE); - } - } - - private void setupActionBar() { - Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); - setSupportActionBar(toolbar); - - ActionBar actionBar = getSupportActionBar(); - if (actionBar != null) { - actionBar.setDisplayHomeAsUpEnabled(true); - actionBar.setDisplayShowHomeEnabled(true); - } - } - - /** - * Get address for the given location - */ - private void geocode(LatLng point, final GeocodeCallbacks callbacks) { - try { - //Create Geocoding client - MapboxGeocoding client = new MapboxGeocoding.Builder() - .setAccessToken(getString(R.string.mapbox_access_token)) - .setCoordinates(Position.fromCoordinates(point.getLongitude(), point.getLatitude())) - .setGeocodingType(GeocodingCriteria.TYPE_ADDRESS) - .build(); - - //Place the request - client.enqueueCall(new Callback<GeocodingResponse>() { - @Override - public void onResponse(Call<GeocodingResponse> call, Response<GeocodingResponse> response) { - - List<CarmenFeature> results = response.body().getFeatures(); - String address = null; - if (results.size() > 0) { - CarmenFeature feature = results.get(0); - address = feature.getAddress() + " " + feature.getText(); - Timber.i("address " + address); - } else { - showFeedbackMessage("No results for search."); - } - - callbacks.onResult(address); - } - - @Override - public void onFailure(Call<GeocodingResponse> call, Throwable throwable) { - Timber.e("Geocoding Failure: " + throwable.getMessage()); - callbacks.onFailure(throwable); - } - }); - } catch (ServicesException servicesException) { - Timber.e("Error geocoding: " + servicesException.toString()); - callbacks.onFailure(servicesException); - } - } - - private LatLng getLocationPickerLocation() { - return mapboxMap.getProjection().fromScreenLocation( - new PointF(dropPinView.getLeft() + (dropPinView.getWidth() / 2), dropPinView.getBottom()) - ); - } - - private Marker showAddressPin(LatLng position) { - if (addressPin != null) { - //Remove previous pin - removeAddressPin(); - } - - //Create new one - addressPin = mapboxMap.addMarker(new MarkerViewOptions().title("Loading address...").position(position)); - mapboxMap.selectMarker(addressPin); - return addressPin; - } - - private void removeAddressPin() { - if (mapboxMap != null && addressPin != null) { - mapboxMap.removeMarker(addressPin); - } - } - - private void updateAddressPin(@Nullable String address) { - if (addressPin != null) { - addressPin.setTitle(address == null ? "No address found" : address); - } - } - - private void showFeedbackMessage(String message) { - Toast.makeText(getApplicationContext(), message, Toast.LENGTH_SHORT).show(); - } - - private boolean arePermissionsGranted() { - if (Build.VERSION.SDK_INT >= 23 - && checkSelfPermission(Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED - && checkSelfPermission(Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED) { - Timber.i("Requesting permissions"); - ActivityCompat.requestPermissions(this, new String[] { - Manifest.permission.ACCESS_FINE_LOCATION}, REQUEST_PERMISSIONS); - return false; - } - Timber.i("Permissions already granted"); - return true; - } - - @Override - protected void onStart() { - super.onStart(); - mapView.onStart(); - - //Check permissions - if (arePermissionsGranted()) { - mapView.getMapAsync(new OnMapReadyCallback() { - - @Override - public void onMapReady(final MapboxMap mapboxMap) { - //Get the user's location - final LocationServices locationServices = LocationServices.getLocationServices(getApplicationContext()); - - Location location = locationServices.getLastLocation(); - if (location != null) { - zoomInOn(location); - userMarker.setPosition(new LatLng(location)); - } else { - final ProgressDialog loadingDialog = ProgressDialog.show( - LocationPickerActivity.this, "Loading", "Getting user location", false); - locationServices.addLocationListener(new LocationListener() { - @Override - public void onLocationChanged(@Nullable Location location) { - //Move the camera to the user - if (location != null) { - zoomInOn(location); - userMarker.setPosition(new LatLng(location)); - locationServices.removeLocationListener(this); - loadingDialog.hide(); - } - } - }); - } - - locationServices.toggleGPS(true); - } - }); - } - } - - @Override - protected void onPause() { - super.onPause(); - mapView.onPause(); - } - - @Override - protected void onStop() { - super.onStop(); - mapView.onStop(); - } - - @Override - protected void onSaveInstanceState(Bundle outState) { - super.onSaveInstanceState(outState); - mapView.onSaveInstanceState(outState); - } - - @Override - protected void onDestroy() { - super.onDestroy(); - mapView.onDestroy(); - } - - @Override - public void onLowMemory() { - super.onLowMemory(); - mapView.onLowMemory(); - } - - @Override - public boolean onOptionsItemSelected(MenuItem item) { - switch (item.getItemId()) { - case android.R.id.home: - onBackPressed(); - return true; - default: - return super.onOptionsItemSelected(item); - } - } - - /** - * Custom MarkerViewAdapter for the pulsing marker - */ - private static class PulseMarkerViewAdapter extends MapboxMap.MarkerViewAdapter<PulseMarkerView> { - - private LayoutInflater inflater; - - public PulseMarkerViewAdapter(@NonNull Context context) { - super(context); - this.inflater = LayoutInflater.from(context); - } - - @Nullable - @Override - public View getView(@NonNull PulseMarkerView marker, @Nullable View convertView, @NonNull ViewGroup parent) { - ViewHolder viewHolder; - if (convertView == null) { - viewHolder = new ViewHolder(); - convertView = inflater.inflate(R.layout.view_pulse_marker, parent, false); - viewHolder.foregroundImageView = (ImageView) convertView.findViewById(R.id.foreground_imageView); - viewHolder.backgroundImageView = (ImageView) convertView.findViewById(R.id.background_imageview); - convertView.setTag(viewHolder); - } - return convertView; - } - - private static class ViewHolder { - ImageView foregroundImageView; - ImageView backgroundImageView; - } - } - - private interface GeocodeCallbacks { - void onResult(String result); - - void onFailure(Throwable failure); - } -} diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/offline/OfflineActivity.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/offline/OfflineActivity.java index e2eda0e6b1..65c84e516f 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/offline/OfflineActivity.java +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/offline/OfflineActivity.java @@ -2,11 +2,8 @@ package com.mapbox.mapboxsdk.testapp.activity.offline; import android.os.Bundle; import android.support.annotation.NonNull; -import android.support.v7.app.ActionBar; import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.Toolbar; import android.text.TextUtils; -import android.view.MenuItem; import android.view.View; import android.widget.Button; import android.widget.ProgressBar; @@ -68,15 +65,6 @@ public class OfflineActivity extends AppCompatActivity super.onCreate(savedInstanceState); setContentView(R.layout.activity_offline); - Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); - setSupportActionBar(toolbar); - - ActionBar actionBar = getSupportActionBar(); - if (actionBar != null) { - actionBar.setDisplayHomeAsUpEnabled(true); - actionBar.setDisplayShowHomeEnabled(true); - } - // You can use Mapbox.setConnected(Boolean) to manually set the connectivity // state of your app. This will override any checks performed via the ConnectivityManager. //Mapbox.getInstance().setConnected(false); @@ -171,17 +159,6 @@ public class OfflineActivity extends AppCompatActivity mapView.onLowMemory(); } - @Override - public boolean onOptionsItemSelected(MenuItem item) { - switch (item.getItemId()) { - case android.R.id.home: - onBackPressed(); - return true; - default: - return super.onOptionsItemSelected(item); - } - } - /* * Buttons logic */ diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/offline/UpdateMetadataActivity.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/offline/UpdateMetadataActivity.java index a83cabba12..285e896766 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/offline/UpdateMetadataActivity.java +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/offline/UpdateMetadataActivity.java @@ -3,13 +3,10 @@ package com.mapbox.mapboxsdk.testapp.activity.offline; import android.content.Context; import android.content.DialogInterface; import android.os.Bundle; -import android.support.v7.app.ActionBar; import android.support.v7.app.AlertDialog; import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.Toolbar; import android.text.InputType; import android.view.LayoutInflater; -import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; import android.widget.AdapterView; @@ -40,15 +37,6 @@ public class UpdateMetadataActivity extends AppCompatActivity implements Adapter super.onCreate(savedInstanceState); setContentView(R.layout.activity_metadata_update); - Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); - setSupportActionBar(toolbar); - - ActionBar actionBar = getSupportActionBar(); - if (actionBar != null) { - actionBar.setDisplayHomeAsUpEnabled(true); - actionBar.setDisplayShowHomeEnabled(true); - } - ListView listView = (ListView) findViewById(R.id.listView); listView.setAdapter(adapter = new OfflineRegionMetadataAdapter(this)); listView.setEmptyView(findViewById(android.R.id.empty)); @@ -125,17 +113,6 @@ public class UpdateMetadataActivity extends AppCompatActivity implements Adapter }); } - @Override - public boolean onOptionsItemSelected(MenuItem item) { - switch (item.getItemId()) { - case android.R.id.home: - onBackPressed(); - return true; - default: - return super.onOptionsItemSelected(item); - } - } - private static class OfflineRegionMetadataAdapter extends BaseAdapter { private Context context; diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/CircleLayerActivity.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/CircleLayerActivity.java index 0b102057b7..3b3b6a06ce 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/CircleLayerActivity.java +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/CircleLayerActivity.java @@ -5,13 +5,7 @@ import android.os.Bundle; import android.support.annotation.NonNull; import android.support.design.widget.FloatingActionButton; import android.support.v4.content.ContextCompat; -import android.support.v7.app.ActionBar; import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.Toolbar; - -import timber.log.Timber; - -import android.view.MenuItem; import android.view.View; import com.mapbox.mapboxsdk.camera.CameraPosition; @@ -28,6 +22,8 @@ import com.mapbox.mapboxsdk.testapp.R; import java.net.MalformedURLException; import java.net.URL; +import timber.log.Timber; + import static com.mapbox.mapboxsdk.style.layers.Filter.in; import static com.mapbox.mapboxsdk.style.layers.PropertyFactory.circleColor; import static com.mapbox.mapboxsdk.style.layers.PropertyFactory.circleRadius; @@ -50,15 +46,6 @@ public class CircleLayerActivity extends AppCompatActivity { super.onCreate(savedInstanceState); setContentView(R.layout.activity_circle_layer); - Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); - setSupportActionBar(toolbar); - - ActionBar actionBar = getSupportActionBar(); - if (actionBar != null) { - actionBar.setDisplayHomeAsUpEnabled(true); - actionBar.setDisplayShowHomeEnabled(true); - } - mapView = (MapView) findViewById(R.id.mapView); mapView.onCreate(savedInstanceState); mapView.getMapAsync(new OnMapReadyCallback() { @@ -156,15 +143,4 @@ public class CircleLayerActivity extends AppCompatActivity { super.onDestroy(); mapView.onDestroy(); } - - @Override - public boolean onOptionsItemSelected(MenuItem item) { - switch (item.getItemId()) { - case android.R.id.home: - onBackPressed(); - return true; - default: - return super.onOptionsItemSelected(item); - } - } -} +}
\ No newline at end of file diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/CustomSpriteActivity.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/CustomSpriteActivity.java index d68872a5ba..1e9afe4cf0 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/CustomSpriteActivity.java +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/CustomSpriteActivity.java @@ -5,13 +5,7 @@ import android.os.Bundle; import android.support.annotation.NonNull; import android.support.design.widget.FloatingActionButton; import android.support.v4.content.ContextCompat; -import android.support.v7.app.ActionBar; import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.Toolbar; - -import timber.log.Timber; - -import android.view.MenuItem; import android.view.View; import com.mapbox.mapboxsdk.camera.CameraUpdateFactory; @@ -28,6 +22,8 @@ import com.mapbox.services.commons.geojson.FeatureCollection; import com.mapbox.services.commons.geojson.Point; import com.mapbox.services.commons.models.Position; +import timber.log.Timber; + import static com.mapbox.mapboxsdk.style.layers.PropertyFactory.iconImage; /** @@ -47,15 +43,6 @@ public class CustomSpriteActivity extends AppCompatActivity { super.onCreate(savedInstanceState); setContentView(R.layout.activity_add_sprite); - Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); - setSupportActionBar(toolbar); - - ActionBar actionBar = getSupportActionBar(); - if (actionBar != null) { - actionBar.setDisplayHomeAsUpEnabled(true); - actionBar.setDisplayShowHomeEnabled(true); - } - mapView = (MapView) findViewById(R.id.mapView); mapView.onCreate(savedInstanceState); mapView.getMapAsync(new OnMapReadyCallback() { @@ -152,15 +139,4 @@ public class CustomSpriteActivity extends AppCompatActivity { super.onDestroy(); mapView.onDestroy(); } - - @Override - public boolean onOptionsItemSelected(MenuItem item) { - switch (item.getItemId()) { - case android.R.id.home: - onBackPressed(); - return true; - default: - return super.onOptionsItemSelected(item); - } - } }
\ No newline at end of file diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/GeoJsonClusteringActivity.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/GeoJsonClusteringActivity.java index 33fc7f60a6..6cc7a69d3f 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/GeoJsonClusteringActivity.java +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/GeoJsonClusteringActivity.java @@ -3,12 +3,7 @@ package com.mapbox.mapboxsdk.testapp.activity.style; import android.graphics.Color; import android.os.Bundle; import android.support.v4.content.res.ResourcesCompat; -import android.support.v7.app.ActionBar; import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.Toolbar; - -import timber.log.Timber; - import android.view.MenuItem; import com.mapbox.mapboxsdk.camera.CameraUpdateFactory; @@ -25,6 +20,8 @@ import com.mapbox.mapboxsdk.testapp.R; import java.net.MalformedURLException; import java.net.URL; +import timber.log.Timber; + import static com.mapbox.mapboxsdk.style.layers.Filter.all; import static com.mapbox.mapboxsdk.style.layers.Filter.gte; import static com.mapbox.mapboxsdk.style.layers.Filter.lt; @@ -48,8 +45,6 @@ public class GeoJsonClusteringActivity extends AppCompatActivity { super.onCreate(savedInstanceState); setContentView(R.layout.activity_geojson_clustering); - setupActionBar(); - //Initialize map as normal mapView = (MapView) findViewById(R.id.mapView); //noinspection ConstantConditions @@ -138,9 +133,9 @@ public class GeoJsonClusteringActivity extends AppCompatActivity { //Add unclustered layer int[][] layers = new int[][] { - new int[] {150, ResourcesCompat.getColor(getResources(), R.color.red_accent, getTheme())}, - new int[] {20, ResourcesCompat.getColor(getResources(), R.color.green_accent, getTheme())}, - new int[] {0, ResourcesCompat.getColor(getResources(), R.color.blue_accent, getTheme())} + new int[] {150, ResourcesCompat.getColor(getResources(), R.color.redAccent, getTheme())}, + new int[] {20, ResourcesCompat.getColor(getResources(), R.color.greenAccent, getTheme())}, + new int[] {0, ResourcesCompat.getColor(getResources(), R.color.blueAccent, getTheme())} }; SymbolLayer unclustered = new SymbolLayer("unclustered-points", "earthquakes"); @@ -175,15 +170,4 @@ public class GeoJsonClusteringActivity extends AppCompatActivity { //Zoom out to start mapboxMap.animateCamera(CameraUpdateFactory.zoomTo(1)); } - - private void setupActionBar() { - Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); - setSupportActionBar(toolbar); - - ActionBar actionBar = getSupportActionBar(); - if (actionBar != null) { - actionBar.setDisplayHomeAsUpEnabled(true); - actionBar.setDisplayShowHomeEnabled(true); - } - } } diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/RealTimeGeoJsonActivity.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/RealTimeGeoJsonActivity.java index fad4f9714d..aea5f7c25d 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/RealTimeGeoJsonActivity.java +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/RealTimeGeoJsonActivity.java @@ -3,13 +3,7 @@ package com.mapbox.mapboxsdk.testapp.activity.style; import android.os.Bundle; import android.os.Handler; import android.support.annotation.NonNull; -import android.support.v7.app.ActionBar; import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.Toolbar; - -import timber.log.Timber; - -import android.view.MenuItem; import com.mapbox.mapboxsdk.maps.MapView; import com.mapbox.mapboxsdk.maps.MapboxMap; @@ -21,6 +15,8 @@ import com.mapbox.mapboxsdk.testapp.R; import java.net.MalformedURLException; import java.net.URL; +import timber.log.Timber; + import static com.mapbox.mapboxsdk.style.layers.PropertyFactory.iconImage; /** @@ -46,15 +42,6 @@ public class RealTimeGeoJsonActivity extends AppCompatActivity implements OnMapR super.onCreate(savedInstanceState); setContentView(R.layout.activity_default); - Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); - setSupportActionBar(toolbar); - - ActionBar actionBar = getSupportActionBar(); - if (actionBar != null) { - actionBar.setDisplayHomeAsUpEnabled(true); - actionBar.setDisplayShowHomeEnabled(true); - } - mapView = (MapView) findViewById(R.id.mapView); mapView.onCreate(savedInstanceState); mapView.getMapAsync(this); @@ -119,17 +106,6 @@ public class RealTimeGeoJsonActivity extends AppCompatActivity implements OnMapR mapView.onSaveInstanceState(outState); } - @Override - public boolean onOptionsItemSelected(MenuItem item) { - switch (item.getItemId()) { - case android.R.id.home: - onBackPressed(); - return true; - default: - return super.onOptionsItemSelected(item); - } - } - private static class RefreshGeoJsonRunnable implements Runnable { private MapboxMap mapboxMap; diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/RuntimeStyleActivity.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/RuntimeStyleActivity.java index 983f82c53a..b84c78a578 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/RuntimeStyleActivity.java +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/RuntimeStyleActivity.java @@ -4,9 +4,7 @@ import android.graphics.Color; import android.os.Bundle; import android.os.Handler; import android.support.annotation.RawRes; -import android.support.v7.app.ActionBar; import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.Toolbar; import android.view.Menu; import android.view.MenuItem; import android.widget.Toast; @@ -83,8 +81,6 @@ public class RuntimeStyleActivity extends AppCompatActivity { super.onCreate(savedInstanceState); setContentView(R.layout.activity_runtime_style); - setupActionBar(); - //Initialize map as normal mapView = (MapView) findViewById(R.id.mapView); mapView.onCreate(savedInstanceState); @@ -153,9 +149,6 @@ public class RuntimeStyleActivity extends AppCompatActivity { @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { - case android.R.id.home: - onBackPressed(); - return true; case R.id.action_water_color: setWaterColor(); return true; @@ -459,17 +452,6 @@ public class RuntimeStyleActivity extends AppCompatActivity { return writer.toString(); } - private void setupActionBar() { - Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); - setSupportActionBar(toolbar); - - ActionBar actionBar = getSupportActionBar(); - if (actionBar != null) { - actionBar.setDisplayHomeAsUpEnabled(true); - actionBar.setDisplayShowHomeEnabled(true); - } - } - private void addCustomTileSource() { //Add a source Source source = new VectorSource("custom-tile-source", new TileSet("2.1.0", "https://vector.mapzen.com/osm/all/{z}/{x}/{y}.mvt?api_key=vector-tiles-LM25tq4")); diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/StyleFileActivity.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/StyleFileActivity.java index 73e6bc985a..da9fe87f32 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/StyleFileActivity.java +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/StyleFileActivity.java @@ -6,10 +6,7 @@ import android.support.annotation.NonNull; import android.support.annotation.RawRes; import android.support.design.widget.FloatingActionButton; import android.support.v4.content.ContextCompat; -import android.support.v7.app.ActionBar; import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.Toolbar; -import android.view.MenuItem; import android.view.View; import android.widget.Toast; @@ -44,15 +41,6 @@ public class StyleFileActivity extends AppCompatActivity { super.onCreate(savedInstanceState); setContentView(R.layout.activity_style_file); - Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); - setSupportActionBar(toolbar); - - ActionBar actionBar = getSupportActionBar(); - if (actionBar != null) { - actionBar.setDisplayHomeAsUpEnabled(true); - actionBar.setDisplayShowHomeEnabled(true); - } - mapView = (MapView) findViewById(R.id.mapView); mapView.onCreate(savedInstanceState); mapView.getMapAsync(new OnMapReadyCallback() { @@ -168,15 +156,4 @@ public class StyleFileActivity extends AppCompatActivity { super.onDestroy(); mapView.onDestroy(); } - - @Override - public boolean onOptionsItemSelected(MenuItem item) { - switch (item.getItemId()) { - case android.R.id.home: - onBackPressed(); - return true; - default: - return super.onOptionsItemSelected(item); - } - } }
\ No newline at end of file diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/SymbolLayerActivity.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/SymbolLayerActivity.java index be71e58eba..33758d3f15 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/SymbolLayerActivity.java +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/SymbolLayerActivity.java @@ -5,9 +5,7 @@ import android.graphics.Color; import android.graphics.PointF; import android.os.Bundle; import android.support.annotation.NonNull; -import android.support.v7.app.ActionBar; import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.Toolbar; import android.view.Menu; import android.view.MenuItem; @@ -51,15 +49,6 @@ public class SymbolLayerActivity extends AppCompatActivity implements MapboxMap. super.onCreate(savedInstanceState); setContentView(R.layout.activity_symbollayer); - Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); - setSupportActionBar(toolbar); - - ActionBar actionBar = getSupportActionBar(); - if (actionBar != null) { - actionBar.setDisplayHomeAsUpEnabled(true); - actionBar.setDisplayShowHomeEnabled(true); - } - mapView = (MapView) findViewById(R.id.mapView); mapView.onCreate(savedInstanceState); mapView.getMapAsync(new OnMapReadyCallback() { @@ -195,9 +184,6 @@ public class SymbolLayerActivity extends AppCompatActivity implements MapboxMap. @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { - case android.R.id.home: - onBackPressed(); - return true; case R.id.action_toggle_text_size: toggleTextSize(); return true; @@ -211,5 +197,4 @@ public class SymbolLayerActivity extends AppCompatActivity implements MapboxMap. return super.onOptionsItemSelected(item); } } - }
\ No newline at end of file diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/userlocation/MyLocationDrawableActivity.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/userlocation/MyLocationDrawableActivity.java index e20455b1ce..3984e765e1 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/userlocation/MyLocationDrawableActivity.java +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/userlocation/MyLocationDrawableActivity.java @@ -9,10 +9,7 @@ import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.support.v4.app.ActivityCompat; import android.support.v4.content.ContextCompat; -import android.support.v7.app.ActionBar; import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.Toolbar; -import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; @@ -38,14 +35,6 @@ public class MyLocationDrawableActivity extends AppCompatActivity implements Loc protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_my_location_customization); - Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); - setSupportActionBar(toolbar); - - final ActionBar actionBar = getSupportActionBar(); - if (actionBar != null) { - actionBar.setDisplayHomeAsUpEnabled(true); - actionBar.setDisplayShowHomeEnabled(true); - } findViewById(R.id.progress).setVisibility(View.GONE); @@ -167,16 +156,4 @@ public class MyLocationDrawableActivity extends AppCompatActivity implements Loc super.onLowMemory(); mapView.onLowMemory(); } - - @Override - public boolean onOptionsItemSelected(MenuItem item) { - switch (item.getItemId()) { - case android.R.id.home: - onBackPressed(); - return true; - default: - return super.onOptionsItemSelected(item); - } - } - } diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/userlocation/MyLocationTintActivity.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/userlocation/MyLocationTintActivity.java index 2da3bedcbf..f5dfc90247 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/userlocation/MyLocationTintActivity.java +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/userlocation/MyLocationTintActivity.java @@ -12,10 +12,7 @@ import android.support.annotation.Nullable; import android.support.annotation.UiThread; import android.support.v4.app.ActivityCompat; import android.support.v4.content.ContextCompat; -import android.support.v7.app.ActionBar; import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.Toolbar; -import android.view.MenuItem; import android.view.View; import com.mapbox.mapboxsdk.camera.CameraUpdateFactory; @@ -43,15 +40,6 @@ public class MyLocationTintActivity extends AppCompatActivity implements Locatio super.onCreate(savedInstanceState); setContentView(R.layout.activity_my_location_dot_color); - Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); - setSupportActionBar(toolbar); - - ActionBar actionBar = getSupportActionBar(); - if (actionBar != null) { - actionBar.setDisplayHomeAsUpEnabled(true); - actionBar.setDisplayShowHomeEnabled(true); - } - mapView = (MapView) findViewById(R.id.mapView); mapView.onCreate(savedInstanceState); mapView.getMapAsync(new OnMapReadyCallback() { @@ -94,9 +82,9 @@ public class MyLocationTintActivity extends AppCompatActivity implements Locatio @Override public void onClick(View view) { myLocationViewSettings.setAccuracyTintColor( - ContextCompat.getColor(MyLocationTintActivity.this, R.color.mapbox_green)); + ContextCompat.getColor(MyLocationTintActivity.this, R.color.mapboxGreen)); myLocationViewSettings.setForegroundTintColor( - ContextCompat.getColor(MyLocationTintActivity.this, R.color.mapbox_green)); + ContextCompat.getColor(MyLocationTintActivity.this, R.color.mapboxGreen)); myLocationViewSettings.setBackgroundTintColor(Color.WHITE); } }); @@ -184,17 +172,6 @@ public class MyLocationTintActivity extends AppCompatActivity implements Locatio mapView.onSaveInstanceState(outState); } - @Override - public boolean onOptionsItemSelected(MenuItem item) { - switch (item.getItemId()) { - case android.R.id.home: - onBackPressed(); - return true; - default: - return super.onOptionsItemSelected(item); - } - } - @UiThread public void toggleGps(boolean enableGps) { if (enableGps) { diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/userlocation/MyLocationToggleActivity.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/userlocation/MyLocationToggleActivity.java index e522840038..e6991c201f 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/userlocation/MyLocationToggleActivity.java +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/userlocation/MyLocationToggleActivity.java @@ -5,19 +5,16 @@ import android.content.pm.PackageManager; import android.location.Location; import android.os.Bundle; import android.support.annotation.NonNull; -import android.support.annotation.Nullable; import android.support.annotation.UiThread; import android.support.design.widget.FloatingActionButton; import android.support.v4.app.ActivityCompat; -import android.support.v4.content.ContextCompat; -import android.support.v7.app.ActionBar; import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.Toolbar; -import android.view.MenuItem; import android.view.View; -import com.mapbox.mapboxsdk.camera.CameraPosition; +import com.mapbox.mapboxsdk.camera.CameraUpdateFactory; import com.mapbox.mapboxsdk.geometry.LatLng; +import com.mapbox.mapboxsdk.location.LocationListener; +import com.mapbox.mapboxsdk.location.LocationServices; import com.mapbox.mapboxsdk.maps.MapView; import com.mapbox.mapboxsdk.maps.MapboxMap; import com.mapbox.mapboxsdk.maps.OnMapReadyCallback; @@ -29,6 +26,9 @@ public class MyLocationToggleActivity extends AppCompatActivity { private MapboxMap mapboxMap; private FloatingActionButton locationToggleFab; + private LocationServices locationServices; + private LocationListener locationListener; + private static final int PERMISSIONS_LOCATION = 0; @Override @@ -36,15 +36,7 @@ public class MyLocationToggleActivity extends AppCompatActivity { super.onCreate(savedInstanceState); setContentView(R.layout.activity_my_location_toggle); - Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); - setSupportActionBar(toolbar); - - final ActionBar actionBar = getSupportActionBar(); - if (actionBar != null) { - actionBar.setDisplayShowTitleEnabled(true); - actionBar.setDisplayHomeAsUpEnabled(true); - actionBar.setDisplayShowHomeEnabled(true); - } + locationServices = LocationServices.getLocationServices(MyLocationToggleActivity.this); mapView = (MapView) findViewById(R.id.mapView); mapView.onCreate(savedInstanceState); @@ -100,6 +92,11 @@ public class MyLocationToggleActivity extends AppCompatActivity { protected void onDestroy() { super.onDestroy(); mapView.onDestroy(); + // Ensure no memory leak occurs if we register the location listener but the call hasn't + // been made yet. + if (locationListener != null) { + locationServices.removeLocationListener(locationListener); + } } @Override @@ -108,27 +105,11 @@ public class MyLocationToggleActivity extends AppCompatActivity { mapView.onLowMemory(); } - - @Override - public boolean onOptionsItemSelected(MenuItem item) { - switch (item.getItemId()) { - case android.R.id.home: - onBackPressed(); - return true; - default: - return false; - } - } - @UiThread public void toggleGps(boolean enableGps) { if (enableGps) { - if ((ContextCompat.checkSelfPermission(this, - Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) - || (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) - != PackageManager.PERMISSION_GRANTED)) { - ActivityCompat.requestPermissions(this, new String[] { - Manifest.permission.ACCESS_COARSE_LOCATION, + if (!LocationServices.getLocationServices(MyLocationToggleActivity.this).areLocationPermissionsGranted()) { + ActivityCompat.requestPermissions(this, new String[] {Manifest.permission.ACCESS_COARSE_LOCATION, Manifest.permission.ACCESS_FINE_LOCATION}, PERMISSIONS_LOCATION); } else { enableLocation(true); @@ -140,25 +121,32 @@ public class MyLocationToggleActivity extends AppCompatActivity { private void enableLocation(boolean enabled) { if (enabled) { - mapboxMap.setOnMyLocationChangeListener(new MapboxMap.OnMyLocationChangeListener() { - @Override - public void onMyLocationChange(@Nullable Location location) { - if (location != null) { - mapboxMap.setCameraPosition(new CameraPosition.Builder() - .target(new LatLng(location)) - .zoom(16) - .bearing(0) - .tilt(0) - .build()); - mapboxMap.setOnMyLocationChangeListener(null); - } + // To move the camera instantly, we attempt to get the last known location and either + // ease or animate the camera to that position depending on the zoom level. + Location lastLocation = LocationServices.getLocationServices(this).getLastLocation(); + + if (lastLocation != null) { + if (mapboxMap.getCameraPosition().zoom > 15.99) { + mapboxMap.easeCamera(CameraUpdateFactory.newLatLng(new LatLng(lastLocation)), 1000); + } else { + mapboxMap.animateCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(lastLocation), 16), 1000); } - }); + } else { + locationListener = new LocationListener() { + @Override + public void onLocationChanged(Location location) { + if (location != null) { + mapboxMap.moveCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(location), 16)); + locationServices.removeLocationListener(this); + } + } + }; + locationServices.addLocationListener(locationListener); + } locationToggleFab.setImageResource(R.drawable.ic_location_disabled_24dp); } else { locationToggleFab.setImageResource(R.drawable.ic_my_location_24dp); } - mapboxMap.setMyLocationEnabled(enabled); } diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/drawable/line_divider.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/drawable/line_divider.xml index 2dc6b4a008..28258bdddc 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/drawable/line_divider.xml +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/drawable/line_divider.xml @@ -1,11 +1,12 @@ <?xml version="1.0" encoding="utf-8"?> -<shape xmlns:android="http://schemas.android.com/apk/res/android" +<shape + xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <size android:width="1dp" - android:height="1dp" /> + android:height="1dp"/> - <solid android:color="@android:color/darker_gray" /> + <solid android:color="@android:color/darker_gray"/> </shape>
\ No newline at end of file diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_add_remove_marker.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_add_remove_marker.xml index 596f52aab1..c52512195c 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_add_remove_marker.xml +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_add_remove_marker.xml @@ -1,19 +1,13 @@ <?xml version="1.0" encoding="utf-8"?> -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" +<LinearLayout + xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> - <android.support.v7.widget.Toolbar - android:id="@+id/toolbar" - android:layout_width="match_parent" - android:layout_height="?attr/actionBarSize" - android:background="@color/primary" - android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" /> - <com.mapbox.mapboxsdk.maps.MapView android:id="@+id/mapView" android:layout_width="match_parent" - android:layout_height="match_parent" /> + android:layout_height="match_parent"/> </LinearLayout>
\ No newline at end of file diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_add_sprite.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_add_sprite.xml index e0e2cbfdab..380c1ab8de 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_add_sprite.xml +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_add_sprite.xml @@ -1,26 +1,19 @@ <?xml version="1.0" encoding="utf-8"?> -<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" +<RelativeLayout + xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> - <android.support.v7.widget.Toolbar - android:id="@+id/toolbar" - android:layout_width="match_parent" - android:layout_height="?attr/actionBarSize" - android:background="@color/primary" - android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" /> - <com.mapbox.mapboxsdk.maps.MapView android:id="@id/mapView" - android:layout_below="@id/toolbar" android:layout_width="match_parent" + android:layout_height="match_parent" app:mapbox_cameraTargetLat="52.519003" app:mapbox_cameraTargetLng="13.400972" - app:mapbox_styleUrl="@string/mapbox_style_mapbox_streets" app:mapbox_cameraZoom="16" - android:layout_height="match_parent"/> + app:mapbox_styleUrl="@string/mapbox_style_mapbox_streets"/> <android.support.design.widget.FloatingActionButton android:id="@id/fab" @@ -31,6 +24,6 @@ android:layout_alignParentRight="true" android:layout_margin="@dimen/fab_margin" android:src="@drawable/ic_add_24dp" - app:backgroundTint="@android:color/white" /> + app:backgroundTint="@android:color/white"/> </RelativeLayout> diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_animated_marker.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_animated_marker.xml index 6534c23c72..0566757d58 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_animated_marker.xml +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_animated_marker.xml @@ -1,25 +1,18 @@ <?xml version="1.0" encoding="utf-8"?> -<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" +<LinearLayout + xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> - <android.support.v7.widget.Toolbar - android:id="@+id/toolbar" - android:layout_width="match_parent" - android:layout_height="?attr/actionBarSize" - android:background="@color/primary" - android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" /> - <com.mapbox.mapboxsdk.maps.MapView android:id="@id/mapView" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_below="@id/toolbar" app:mapbox_cameraTargetLat="51.502615" app:mapbox_cameraTargetLng="4.972326" - app:mapbox_styleUrl="@string/mapbox_style_light" - app:mapbox_cameraZoom="6" /> + app:mapbox_cameraZoom="6" + app:mapbox_styleUrl="@string/mapbox_style_light"/> -</RelativeLayout> +</LinearLayout> diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_camera_animation_types.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_camera_animation_types.xml index 8a139083f8..b70bb6d7b2 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_camera_animation_types.xml +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_camera_animation_types.xml @@ -1,25 +1,18 @@ <?xml version="1.0" encoding="utf-8"?> -<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" +<RelativeLayout + xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> - <android.support.v7.widget.Toolbar - android:id="@+id/toolbar" - android:layout_width="match_parent" - android:layout_height="?attr/actionBarSize" - android:background="@color/primary" - android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" /> - <com.mapbox.mapboxsdk.maps.MapView android:id="@id/mapView" android:layout_width="match_parent" android:layout_height="match_parent" - android:layout_below="@+id/toolbar" app:mapbox_cameraTargetLat="51.50325" app:mapbox_cameraTargetLng="-0.11968" - app:mapbox_cameraZoom="15" /> + app:mapbox_cameraZoom="15"/> <LinearLayout android:layout_width="match_parent" @@ -33,21 +26,21 @@ android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" - android:text="@string/button_camera_move" /> + android:text="@string/button_camera_move"/> <Button android:id="@+id/cameraEaseButton" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" - android:text="@string/button_camera_ease" /> + android:text="@string/button_camera_ease"/> <Button android:id="@+id/cameraAnimateButton" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" - android:text="@string/button_camera_animate" /> + android:text="@string/button_camera_animate"/> </LinearLayout> </RelativeLayout> diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_camera_position.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_camera_position.xml index a1d7a8351d..258680c78b 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_camera_position.xml +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_camera_position.xml @@ -1,36 +1,24 @@ <?xml version="1.0" encoding="utf-8"?> -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" +<android.support.design.widget.CoordinatorLayout + xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" + android:id="@+id/coordinator_layout" android:layout_width="match_parent" - android:layout_height="match_parent" - android:orientation="vertical"> + android:layout_height="match_parent"> - <android.support.v7.widget.Toolbar - android:id="@+id/toolbar" + <com.mapbox.mapboxsdk.maps.MapView + android:id="@id/mapView" android:layout_width="match_parent" - android:layout_height="?attr/actionBarSize" - android:background="@color/primary" - android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" /> + android:layout_height="match_parent" + app:mapbox_styleUrl="@string/mapbox_style_mapbox_streets"/> - <android.support.design.widget.CoordinatorLayout - android:id="@+id/coordinator_layout" - android:layout_width="match_parent" - android:layout_height="match_parent"> - - <com.mapbox.mapboxsdk.maps.MapView - android:id="@id/mapView" - android:layout_width="match_parent" - android:layout_height="match_parent" - app:mapbox_styleUrl="@string/mapbox_style_mapbox_streets" /> - - <android.support.design.widget.FloatingActionButton - android:id="@+id/fab" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_gravity="end|bottom" - android:layout_margin="@dimen/fab_margin" - android:src="@drawable/ic_input_24dp" - app:backgroundTint="@android:color/white" /> + <android.support.design.widget.FloatingActionButton + android:id="@+id/fab" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="end|bottom" + android:layout_margin="@dimen/fab_margin" + android:src="@drawable/ic_input_24dp" + app:backgroundTint="@android:color/white"/> - </android.support.design.widget.CoordinatorLayout> -</LinearLayout> +</android.support.design.widget.CoordinatorLayout> diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_camera_test.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_camera_test.xml index 4f86120097..05affaf081 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_camera_test.xml +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_camera_test.xml @@ -1,22 +1,16 @@ <?xml version="1.0" encoding="utf-8"?> -<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" +<RelativeLayout + xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent"> - <android.support.v7.widget.Toolbar - android:id="@+id/toolbar" - android:layout_width="match_parent" - android:layout_height="?attr/actionBarSize" - android:background="@color/primary" - android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" /> - <!-- TODO remove zoom #6747--> <com.mapbox.mapboxsdk.maps.MapView android:id="@id/mapView" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_below="@id/toolbar" - app:mapbox_cameraZoom="1" /> + app:mapbox_cameraZoom="1"/> </RelativeLayout> diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_car_driving.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_car_driving.xml deleted file mode 100644 index f52d5e70c2..0000000000 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_car_driving.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:app="http://schemas.android.com/apk/res-auto" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:orientation="vertical"> - - <android.support.v7.widget.Toolbar - android:id="@+id/toolbar" - android:layout_width="match_parent" - android:layout_height="?attr/actionBarSize" - android:background="@color/primary" - android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"/> - - <com.mapbox.mapboxsdk.maps.MapView - android:id="@+id/mapView" - android:layout_width="match_parent" - android:layout_height="match_parent" - app:mapbox_myLocationTintColor="@color/primary" - app:mapbox_myLocationAccuracyTintColor="@color/primary" - app:mapbox_styleUrl="@string/mapbox_style_mapbox_streets" - app:mapbox_cameraZoom="15" /> - -</LinearLayout> diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_circlelayer.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_circlelayer.xml index e0e2cbfdab..faac95d83b 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_circlelayer.xml +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_circlelayer.xml @@ -1,26 +1,19 @@ <?xml version="1.0" encoding="utf-8"?> -<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" +<RelativeLayout + xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" - android:layout_height="match_parent" - android:orientation="vertical"> - - <android.support.v7.widget.Toolbar - android:id="@+id/toolbar" - android:layout_width="match_parent" - android:layout_height="?attr/actionBarSize" - android:background="@color/primary" - android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" /> + android:layout_height="match_parent"> <com.mapbox.mapboxsdk.maps.MapView android:id="@id/mapView" - android:layout_below="@id/toolbar" android:layout_width="match_parent" + android:layout_height="match_parent" + android:layout_below="@id/toolbar" app:mapbox_cameraTargetLat="52.519003" app:mapbox_cameraTargetLng="13.400972" - app:mapbox_styleUrl="@string/mapbox_style_mapbox_streets" app:mapbox_cameraZoom="16" - android:layout_height="match_parent"/> + app:mapbox_styleUrl="@string/mapbox_style_mapbox_streets"/> <android.support.design.widget.FloatingActionButton android:id="@id/fab" @@ -31,6 +24,6 @@ android:layout_alignParentRight="true" android:layout_margin="@dimen/fab_margin" android:src="@drawable/ic_add_24dp" - app:backgroundTint="@android:color/white" /> + app:backgroundTint="@android:color/white"/> </RelativeLayout> diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_custom_layer.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_custom_layer.xml index 247d10bf86..15e6649251 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_custom_layer.xml +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_custom_layer.xml @@ -1,45 +1,25 @@ <?xml version="1.0" encoding="utf-8"?> -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" +<android.support.design.widget.CoordinatorLayout + xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" + android:id="@+id/coordinator_layout" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> - <android.support.v7.widget.Toolbar - android:id="@+id/toolbar" + <com.mapbox.mapboxsdk.maps.MapView + android:id="@id/mapView" android:layout_width="match_parent" - android:layout_height="?attr/actionBarSize" - android:background="@color/primary" - android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"> + android:layout_height="match_parent"/> - </android.support.v7.widget.Toolbar> + <android.support.design.widget.FloatingActionButton + android:id="@+id/fab" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="end|bottom" + android:layout_margin="@dimen/fab_margin" + android:src="@drawable/ic_layers_24dp" + app:backgroundTint="@android:color/white"/> - <FrameLayout - android:id="@+id/content_frame" - android:layout_width="match_parent" - android:layout_height="match_parent"> - - <android.support.design.widget.CoordinatorLayout - android:id="@+id/coordinator_layout" - android:layout_width="match_parent" - android:layout_height="match_parent"> - - <com.mapbox.mapboxsdk.maps.MapView - android:id="@id/mapView" - android:layout_width="match_parent" - android:layout_height="match_parent" /> - - <android.support.design.widget.FloatingActionButton - android:id="@+id/fab" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_gravity="end|bottom" - android:layout_margin="@dimen/fab_margin" - android:src="@drawable/ic_layers_24dp" - app:backgroundTint="@android:color/white" /> - - </android.support.design.widget.CoordinatorLayout> - - </FrameLayout> +</android.support.design.widget.CoordinatorLayout> -</LinearLayout> diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_debug_mode.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_debug_mode.xml index 36adfbc6e9..4eec90f580 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_debug_mode.xml +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_debug_mode.xml @@ -1,57 +1,35 @@ <?xml version="1.0" encoding="utf-8"?> -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:app="http://schemas.android.com/apk/res-auto" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:orientation="vertical"> - - <android.support.v7.widget.Toolbar - android:id="@+id/toolbar" - android:layout_width="match_parent" - android:layout_height="?attr/actionBarSize" - android:background="@color/primary" - android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"> - - </android.support.v7.widget.Toolbar> - - <FrameLayout - android:id="@+id/content_frame" +<android.support.design.widget.CoordinatorLayout + xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + android:id="@+id/coordinator_layout" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:orientation="vertical"> + + <com.mapbox.mapboxsdk.maps.MapView + android:id="@+id/mapView" android:layout_width="match_parent" - android:layout_height="match_parent" - > - - <android.support.design.widget.CoordinatorLayout - android:id="@+id/coordinator_layout" - android:layout_width="match_parent" - android:layout_height="match_parent"> - - <com.mapbox.mapboxsdk.maps.MapView - android:id="@+id/mapView" - android:layout_width="match_parent" - android:layout_height="match_parent" /> - - <android.support.design.widget.FloatingActionButton - android:id="@+id/fabDebug" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_gravity="end|bottom" - android:layout_marginBottom="82dp" - android:layout_marginRight="@dimen/fab_margin" - android:src="@drawable/ic_refresh_24dp" - app:backgroundTint="@color/accent" - app:layout_anchorGravity="top" /> - - <android.support.design.widget.FloatingActionButton - android:id="@+id/fabStyles" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_gravity="end|bottom" - android:layout_margin="@dimen/fab_margin" - android:src="@drawable/ic_layers_24dp" - app:backgroundTint="@color/primary" /> - - </android.support.design.widget.CoordinatorLayout> - - </FrameLayout> - -</LinearLayout> + android:layout_height="match_parent"/> + + <android.support.design.widget.FloatingActionButton + android:id="@+id/fabDebug" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="end|bottom" + android:layout_marginBottom="82dp" + android:layout_marginRight="@dimen/fab_margin" + android:src="@drawable/ic_refresh_24dp" + app:backgroundTint="@color/accent" + app:layout_anchorGravity="top"/> + + <android.support.design.widget.FloatingActionButton + android:id="@+id/fabStyles" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="end|bottom" + android:layout_margin="@dimen/fab_margin" + android:src="@drawable/ic_layers_24dp" + app:backgroundTint="@color/primary"/> + +</android.support.design.widget.CoordinatorLayout> diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_default.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_default.xml index 742f6612bd..f292c80267 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_default.xml +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_default.xml @@ -1,19 +1,12 @@ <?xml version="1.0" encoding="utf-8"?> -<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" +<RelativeLayout + xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent"> - <android.support.v7.widget.Toolbar - android:id="@+id/toolbar" - android:layout_width="match_parent" - android:layout_height="?attr/actionBarSize" - android:background="@color/primary" - android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" /> - <com.mapbox.mapboxsdk.maps.MapView android:id="@+id/mapView" android:layout_width="match_parent" - android:layout_height="match_parent" - android:layout_below="@id/toolbar" /> + android:layout_height="match_parent"/> </RelativeLayout> diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_dynamic_marker.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_dynamic_marker.xml index 2625e65bbf..76c6988194 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_dynamic_marker.xml +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_dynamic_marker.xml @@ -1,51 +1,29 @@ <?xml version="1.0" encoding="utf-8"?> -<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" +<android.support.design.widget.CoordinatorLayout + xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" + android:id="@+id/coordinator_layout" android:layout_width="match_parent" android:layout_height="match_parent"> - <android.support.v7.widget.Toolbar - android:id="@+id/toolbar" - android:layout_width="match_parent" - android:layout_height="?attr/actionBarSize" - android:background="@color/primary" - android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" /> - - <FrameLayout - android:id="@+id/content_frame" + <com.mapbox.mapboxsdk.maps.MapView + android:id="@id/mapView" android:layout_width="match_parent" android:layout_height="match_parent" - android:layout_below="@+id/toolbar"> - - <android.support.design.widget.CoordinatorLayout - android:id="@+id/coordinator_layout" - android:layout_width="match_parent" - android:layout_height="match_parent"> - - <com.mapbox.mapboxsdk.maps.MapView - android:id="@id/mapView" - android:layout_width="match_parent" - android:layout_height="match_parent" - app:mapbox_cameraTargetLat="51.506675" - app:mapbox_cameraTargetLng="-0.128699" - app:mapbox_uiCompassFadeFacingNorth="false" - app:mapbox_cameraBearing="90" - app:mapbox_cameraTilt="40" - app:mapbox_cameraZoom="10" /> - - <android.support.design.widget.FloatingActionButton - android:id="@+id/fab" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_gravity="end|bottom" - android:layout_margin="@dimen/fab_margin" - android:src="@drawable/ic_animate_coordinates" - app:backgroundTint="@color/white" /> - - </android.support.design.widget.CoordinatorLayout> - - </FrameLayout> - -</RelativeLayout> - - + app:mapbox_cameraBearing="90" + app:mapbox_cameraTargetLat="51.506675" + app:mapbox_cameraTargetLng="-0.128699" + app:mapbox_cameraTilt="40" + app:mapbox_cameraZoom="10" + app:mapbox_uiCompassFadeFacingNorth="false"/> + + <android.support.design.widget.FloatingActionButton + android:id="@+id/fab" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="end|bottom" + android:layout_margin="@dimen/fab_margin" + android:src="@drawable/ic_animate_coordinates" + app:backgroundTint="@color/white"/> + +</android.support.design.widget.CoordinatorLayout>
\ No newline at end of file diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_feature_overview.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_feature_overview.xml new file mode 100644 index 0000000000..f917189a70 --- /dev/null +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_feature_overview.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="utf-8"?> +<LinearLayout + xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:orientation="vertical"> + + <android.support.v7.widget.RecyclerView + android:id="@+id/recyclerView" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:scrollbars="vertical"/> + +</LinearLayout>
\ No newline at end of file diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_geojson_clustering.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_geojson_clustering.xml index 4c0d067c14..f292c80267 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_geojson_clustering.xml +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_geojson_clustering.xml @@ -1,19 +1,12 @@ <?xml version="1.0" encoding="utf-8"?> -<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_width="match_parent" - android:layout_height="match_parent"> - - <android.support.v7.widget.Toolbar - android:id="@+id/toolbar" - android:layout_width="match_parent" - android:layout_height="?attr/actionBarSize" - android:background="@color/primary" - android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"/> +<RelativeLayout + xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="match_parent" + android:layout_height="match_parent"> <com.mapbox.mapboxsdk.maps.MapView android:id="@+id/mapView" android:layout_width="match_parent" - android:layout_height="match_parent" - android:layout_below="@id/toolbar"/> + android:layout_height="match_parent"/> </RelativeLayout> diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_infowindow.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_infowindow.xml index 1c8e33fb33..3339341f6e 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_infowindow.xml +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_infowindow.xml @@ -1,24 +1,18 @@ <?xml version="1.0" encoding="utf-8"?> -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" +<LinearLayout + xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> - <android.support.v7.widget.Toolbar - android:id="@+id/toolbar" - android:layout_width="match_parent" - android:layout_height="?attr/actionBarSize" - android:background="@color/primary" - android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" /> - <com.mapbox.mapboxsdk.maps.MapView android:id="@id/mapView" android:layout_width="match_parent" android:layout_height="match_parent" app:mapbox_cameraTargetLat="38.897705003219784" app:mapbox_cameraTargetLng="-77.03655168667463" - app:mapbox_styleUrl="@string/mapbox_style_mapbox_streets" - app:mapbox_cameraZoom="15" /> + app:mapbox_cameraZoom="15" + app:mapbox_styleUrl="@string/mapbox_style_mapbox_streets"/> </LinearLayout> diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_infowindow_adapter.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_infowindow_adapter.xml index 134c3f331e..abb41c05c4 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_infowindow_adapter.xml +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_infowindow_adapter.xml @@ -1,24 +1,18 @@ <?xml version="1.0" encoding="utf-8"?> -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" +<LinearLayout + xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> - <android.support.v7.widget.Toolbar - android:id="@+id/toolbar" - android:layout_width="match_parent" - android:layout_height="?attr/actionBarSize" - android:background="@color/primary" - android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" /> - <com.mapbox.mapboxsdk.maps.MapView android:id="@id/mapView" android:layout_width="match_parent" android:layout_height="match_parent" app:mapbox_cameraTargetLat="47.798202" app:mapbox_cameraTargetLng="7.573781" - app:mapbox_styleUrl="@string/mapbox_style_mapbox_streets" - app:mapbox_cameraZoom="4" /> + app:mapbox_cameraZoom="4" + app:mapbox_styleUrl="@string/mapbox_style_mapbox_streets"/> </LinearLayout> diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_location_picker.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_location_picker.xml deleted file mode 100644 index f6a89c0149..0000000000 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_location_picker.xml +++ /dev/null @@ -1,41 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_width="match_parent" - android:layout_height="match_parent"> - - <android.support.v7.widget.Toolbar - android:id="@+id/toolbar" - android:layout_width="match_parent" - android:layout_height="?attr/actionBarSize" - android:background="@color/primary" - android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" /> - - <com.mapbox.mapboxsdk.maps.MapView - android:id="@id/mapView" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:layout_below="@id/toolbar" /> - - <ImageButton - android:id="@+id/clearDisplayViewButton" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_above="@+id/selectLocationButton" - android:layout_alignParentLeft="true" - android:layout_alignParentStart="true" - android:layout_marginLeft="@dimen/full_button_margin" - android:background="@color/accent" - android:src="@drawable/ic_clear_24dp" - android:visibility="gone" /> - - <Button - android:id="@+id/selectLocationButton" - android:layout_width="fill_parent" - android:layout_height="wrap_content" - android:layout_alignParentBottom="true" - android:layout_margin="@dimen/full_button_margin" - android:background="@color/primary" - android:text="@string/navigation_select_location_button_text" - android:textColor="@android:color/white" /> - -</RelativeLayout> diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_main.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_main.xml deleted file mode 100644 index 41956385f9..0000000000 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_main.xml +++ /dev/null @@ -1,20 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:orientation="vertical"> - - <android.support.v7.widget.Toolbar - android:id="@+id/toolbar" - android:layout_width="match_parent" - android:layout_height="?attr/actionBarSize" - android:background="@color/primary" - android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" /> - - <android.support.v7.widget.RecyclerView - android:id="@+id/recyclerView" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:scrollbars="vertical" /> - -</LinearLayout>
\ No newline at end of file diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_manual_zoom.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_manual_zoom.xml index 3732326f39..d533762857 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_manual_zoom.xml +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_manual_zoom.xml @@ -1,25 +1,18 @@ <?xml version="1.0" encoding="utf-8"?> -<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_width="match_parent" - android:layout_height="match_parent" +<RelativeLayout + xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" - android:orientation="vertical"> - - <android.support.v7.widget.Toolbar - android:id="@+id/toolbar" - android:layout_width="match_parent" - android:layout_height="?attr/actionBarSize" - android:background="@color/primary" - android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" /> + android:layout_width="match_parent" + android:layout_height="match_parent"> <com.mapbox.mapboxsdk.maps.MapView android:id="@id/mapView" - app:mapbox_cameraTargetLat="50.871062" - app:mapbox_cameraTargetLng="1.583210" - app:mapbox_cameraBearing="220" - app:mapbox_cameraZoom="10" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_below="@id/toolbar" /> + android:layout_below="@id/toolbar" + app:mapbox_cameraBearing="220" + app:mapbox_cameraTargetLat="50.871062" + app:mapbox_cameraTargetLng="1.583210" + app:mapbox_cameraZoom="10"/> </RelativeLayout> diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_map_fragment.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_map_fragment.xml index a421f21ede..43fa8fb995 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_map_fragment.xml +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_map_fragment.xml @@ -1,22 +1,16 @@ <?xml version="1.0" encoding="utf-8"?> -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" +<LinearLayout + xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" tools:context=".activity.fragment.MapFragmentActivity"> - <android.support.v7.widget.Toolbar - android:id="@+id/toolbar" - android:layout_width="match_parent" - android:layout_height="?attr/actionBarSize" - android:background="@color/primary" - android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" /> - <FrameLayout android:id="@+id/fragment_container" android:layout_width="match_parent" - android:layout_height="match_parent" /> + android:layout_height="match_parent"/> </LinearLayout> diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_map_in_dialog.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_map_in_dialog.xml index 1edc456252..68c3c1ce5a 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_map_in_dialog.xml +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_map_in_dialog.xml @@ -4,13 +4,6 @@ android:layout_width="match_parent" android:layout_height="match_parent"> - <android.support.v7.widget.Toolbar - android:id="@+id/toolbar" - android:layout_width="match_parent" - android:layout_height="?attr/actionBarSize" - android:background="@color/primary" - android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" /> - <Button android:id="@+id/button_open_dialog" android:layout_width="wrap_content" diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_map_padding.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_map_padding.xml index cd61fef44b..a0de31ee48 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_map_padding.xml +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_map_padding.xml @@ -12,7 +12,6 @@ <View android:layout_width="@dimen/map_padding_left" android:layout_height="match_parent" - android:layout_marginTop="?attr/actionBarSize" android:alpha="0.5" android:background="@color/mapbox_blue" /> @@ -27,19 +26,10 @@ android:alpha="0.5" android:background="@color/mapbox_blue" /> - <android.support.v7.widget.Toolbar - android:id="@+id/toolbar" - android:layout_width="match_parent" - android:layout_height="?attr/actionBarSize" - android:alpha="0.5" - android:background="@color/primary" - android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" /> - <View android:layout_width="@dimen/map_padding_right" android:layout_height="match_parent" android:layout_gravity="end" - android:layout_marginTop="?attr/actionBarSize" android:alpha="0.5" android:background="@color/mapbox_blue" /> diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_map_simple.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_map_simple.xml index 4ad49e4a9f..96a3f5b046 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_map_simple.xml +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_map_simple.xml @@ -1,19 +1,15 @@ <?xml version="1.0" encoding="utf-8"?> -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" +<LinearLayout + xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" - android:orientation="vertical"> - - <android.support.v7.widget.Toolbar - android:id="@+id/toolbar" - android:layout_width="match_parent" - android:layout_height="?attr/actionBarSize" - android:background="@color/primary" - android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"/> + android:orientation="vertical" + tools:context=".activity.maplayout.SimpleMapActivity"> <com.mapbox.mapboxsdk.maps.MapView android:id="@id/mapView" android:layout_width="match_parent" - android:layout_height="match_parent" /> + android:layout_height="match_parent"/> </LinearLayout> diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_marker_bulk.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_marker_bulk.xml index 229d8e87c1..ff28d2edf0 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_marker_bulk.xml +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_marker_bulk.xml @@ -1,32 +1,19 @@ <?xml version="1.0" encoding="utf-8"?> -<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" +<RelativeLayout + xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent"> - <android.support.v7.widget.Toolbar - android:id="@id/toolbar" - android:layout_width="match_parent" - android:layout_height="?attr/actionBarSize" - android:background="@color/primary" - android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"> - - <Spinner - android:id="@+id/spinner" - android:layout_width="wrap_content" - android:layout_height="wrap_content" /> - - </android.support.v7.widget.Toolbar> - <com.mapbox.mapboxsdk.maps.MapView android:id="@id/mapView" android:layout_width="match_parent" android:layout_height="match_parent" - app:mapbox_cameraTargetLat="38.87031" android:layout_below="@id/toolbar" + app:mapbox_cameraTargetLat="38.87031" app:mapbox_cameraTargetLng="-77.00897" - app:mapbox_styleUrl="@string/mapbox_style_mapbox_streets" - app:mapbox_cameraZoom="10" /> + app:mapbox_cameraZoom="10" + app:mapbox_styleUrl="@string/mapbox_style_mapbox_streets"/> <TextView android:id="@+id/countView" @@ -45,6 +32,6 @@ android:layout_alignParentRight="true" android:layout_gravity="end|bottom" android:layout_margin="@dimen/fab_margin" - android:src="@drawable/ic_animate_coordinates" /> + android:src="@drawable/ic_animate_coordinates"/> </RelativeLayout> diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_marker_view.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_marker_view.xml index f06975466b..cf4b51bbe0 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_marker_view.xml +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_marker_view.xml @@ -1,16 +1,10 @@ <?xml version="1.0" encoding="utf-8"?> -<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" +<RelativeLayout + xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent"> - <android.support.v7.widget.Toolbar - android:id="@id/toolbar" - android:layout_width="match_parent" - android:layout_height="?attr/actionBarSize" - android:background="@color/primary" - android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" /> - <com.mapbox.mapboxsdk.maps.MapView android:id="@id/mapView" android:layout_width="match_parent" @@ -25,7 +19,6 @@ android:id="@+id/countView" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_below="@id/toolbar" android:padding="16dp" android:textSize="20sp" /> diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_marker_view_in_rect.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_marker_view_in_rect.xml index 36dd89c885..ecda2873ce 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_marker_view_in_rect.xml +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_marker_view_in_rect.xml @@ -4,18 +4,10 @@ android:layout_width="match_parent" android:layout_height="match_parent"> - <android.support.v7.widget.Toolbar - android:id="@+id/toolbar" - android:layout_width="match_parent" - android:layout_height="?attr/actionBarSize" - android:background="@color/primary" - android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"/> - <com.mapbox.mapboxsdk.maps.MapView android:id="@+id/mapView" android:layout_width="match_parent" - android:layout_height="match_parent" - android:layout_below="@id/toolbar"/> + android:layout_height="match_parent"/> <FrameLayout android:id="@+id/selection_box" @@ -23,6 +15,6 @@ android:layout_height="150dp" android:layout_centerInParent="true" android:alpha="0.3" - android:background="#1d72da"/> + android:background="@color/mapboxGreen"/> </RelativeLayout> diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_marker_view_scale.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_marker_view_scale.xml deleted file mode 100644 index 8f98b5bea2..0000000000 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_marker_view_scale.xml +++ /dev/null @@ -1,61 +0,0 @@ -<?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" - android:layout_width="match_parent" - android:layout_height="match_parent"> - - <android.support.v7.widget.Toolbar - android:id="@id/toolbar" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:background="@color/primary" - android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"> - - <RelativeLayout - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:paddingBottom="8dp"> - - <TextView - android:id="@+id/title" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginTop="12dp" - android:paddingBottom="8dp" - android:textSize="20sp" - android:textColor="#FFFFFF" - android:text="Scaling in the View Marker API" /> - - <TextView - android:id="@+id/textview_factor" - android:layout_alignBottom="@+id/seekbar_factor" - android:layout_below="@id/title" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:text="Scale: 1" /> - - <SeekBar - android:id="@+id/seekbar_factor" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_below="@id/title" - android:clickable="false" - android:layout_marginLeft="56dp" - android:progress="0" /> - - </RelativeLayout> - - - </android.support.v7.widget.Toolbar> - - <com.mapbox.mapboxsdk.maps.MapView - android:id="@id/mapView" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:layout_below="@id/toolbar" - app:mapbox_cameraTargetLat="38.907192" - app:mapbox_cameraTargetLng="-77.036871" - app:mapbox_styleUrl="@string/mapbox_style_mapbox_streets" - app:mapbox_cameraZoom="12" /> - -</RelativeLayout> diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_maxmin_zoom.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_maxmin_zoom.xml index 20de7c00bf..4428100e41 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_maxmin_zoom.xml +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_maxmin_zoom.xml @@ -1,25 +1,17 @@ <?xml version="1.0" encoding="utf-8"?> -<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" +<RelativeLayout + xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" - android:layout_height="match_parent" - android:orientation="vertical"> - - <android.support.v7.widget.Toolbar - android:id="@+id/toolbar" - android:layout_width="match_parent" - android:layout_height="?attr/actionBarSize" - android:background="@color/primary" - android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" /> + android:layout_height="match_parent"> <com.mapbox.mapboxsdk.maps.MapView android:id="@id/mapView" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_below="@id/toolbar" app:mapbox_cameraTargetLat="-1.063510" app:mapbox_cameraTargetLng=" 32.895425" - app:mapbox_styleUrl="@string/mapbox_style_satellite_streets" - app:mapbox_cameraZoom="4" /> + app:mapbox_cameraZoom="4" + app:mapbox_styleUrl="@string/mapbox_style_satellite_streets"/> </RelativeLayout> diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_metadata_update.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_metadata_update.xml index 067a52dae4..9e7715180c 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_metadata_update.xml +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_metadata_update.xml @@ -1,20 +1,14 @@ <?xml version="1.0" encoding="utf-8"?> -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" +<LinearLayout + xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> - <android.support.v7.widget.Toolbar - android:id="@+id/toolbar" - android:layout_width="match_parent" - android:layout_height="?attr/actionBarSize" - android:background="@color/primary" - android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" /> - <ListView android:id="@+id/listView" android:layout_width="match_parent" - android:layout_height="match_parent" /> + android:layout_height="match_parent"/> <TextView android:id="@android:id/empty" @@ -22,6 +16,6 @@ android:layout_height="match_parent" android:gravity="center" android:text="No Results" - android:textSize="24sp" /> + android:textSize="24sp"/> </LinearLayout>
\ No newline at end of file diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_multi_map.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_multi_map.xml index f8046a8821..f1a690bc84 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_multi_map.xml +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_multi_map.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" +<LinearLayout + xmlns:android="http://schemas.android.com/apk/res/android" xmlns:mapbox="http://schemas.android.com/tools" android:id="@+id/map_container" android:layout_width="match_parent" @@ -23,7 +24,7 @@ mapbox:center_latitude="38.913187" mapbox:center_longitude="-77.032546" mapbox:style_url="mapbox://styles/mapbox/streets-v9" - mapbox:zoom="12" /> + mapbox:zoom="12"/> <!-- SF --> <fragment @@ -35,7 +36,7 @@ mapbox:center_latitude="37.775732" mapbox:center_longitude="-122.413985" mapbox:style_url="mapbox://styles/mapbox/outdoors-v9" - mapbox:zoom="13" /> + mapbox:zoom="13"/> </LinearLayout> <LinearLayout @@ -55,7 +56,7 @@ mapbox:center_latitude="12.97913" mapbox:center_longitude="77.59188" mapbox:style_url="mapbox://styles/mapbox/light-v9" - mapbox:zoom="14" /> + mapbox:zoom="14"/> <!-- Ayacucho --> <fragment @@ -67,6 +68,6 @@ mapbox:center_latitude="-13.155980" mapbox:center_longitude="-74.217134" mapbox:style_url="mapbox://styles/mapbox/dark-v9" - mapbox:zoom="15" /> + mapbox:zoom="15"/> </LinearLayout> </LinearLayout>
\ No newline at end of file diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_my_location_customization.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_my_location_customization.xml index 262128703f..d65d5796f1 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_my_location_customization.xml +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_my_location_customization.xml @@ -1,17 +1,11 @@ <?xml version="1.0" encoding="utf-8"?> -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" +<LinearLayout + xmlns:android="http://schemas.android.com/apk/res/android" android:id="@id/container" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> - <android.support.v7.widget.Toolbar - android:id="@id/toolbar" - android:layout_width="match_parent" - android:layout_height="?attr/actionBarSize" - android:background="@color/primary" - android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" /> - <FrameLayout android:id="@id/progress" android:layout_width="match_parent" @@ -21,7 +15,7 @@ style="?android:attr/progressBarStyleLarge" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_gravity="center" /> + android:layout_gravity="center"/> </FrameLayout> diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_my_location_dot_color.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_my_location_dot_color.xml index d41cc79326..7cd6bd451c 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_my_location_dot_color.xml +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_my_location_dot_color.xml @@ -1,23 +1,14 @@ <?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:mapbox="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent"> - <android.support.v7.widget.Toolbar - android:id="@+id/toolbar" - android:layout_width="match_parent" - android:layout_height="?attr/actionBarSize" - android:background="@color/primary" - android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"/> - <com.mapbox.mapboxsdk.maps.MapView android:id="@id/mapView" android:layout_width="match_parent" android:layout_height="match_parent" - android:layout_below="@+id/toolbar" mapbox:mapbox_uiAttribution="false" mapbox:mapbox_uiLogo="false"/> diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_my_location_toggle.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_my_location_toggle.xml index 8ca01ef411..74a1811339 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_my_location_toggle.xml +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_my_location_toggle.xml @@ -1,36 +1,23 @@ <?xml version="1.0" encoding="utf-8"?> -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" +<android.support.design.widget.CoordinatorLayout + xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" + android:id="@id/coordinator_layout" android:layout_width="match_parent" - android:layout_height="match_parent" - android:orientation="vertical"> + android:layout_height="match_parent"> - <android.support.v7.widget.Toolbar - android:id="@id/toolbar" + <com.mapbox.mapboxsdk.maps.MapView + android:id="@id/mapView" android:layout_width="match_parent" - android:layout_height="?attr/actionBarSize" - android:background="@color/primary" - android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" /> + android:layout_height="match_parent"/> - <android.support.design.widget.CoordinatorLayout - android:id="@id/coordinator_layout" - android:layout_width="match_parent" - android:layout_height="match_parent"> - - <com.mapbox.mapboxsdk.maps.MapView - android:id="@id/mapView" - android:layout_width="match_parent" - android:layout_height="match_parent" /> - - <android.support.design.widget.FloatingActionButton - android:id="@+id/fabLocationToggle" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_gravity="end|bottom" - android:layout_margin="@dimen/fab_margin" - android:src="@drawable/ic_my_location_24dp" - tools:backgroundTint="@color/primary" /> - - </android.support.design.widget.CoordinatorLayout> + <android.support.design.widget.FloatingActionButton + android:id="@+id/fabLocationToggle" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="end|bottom" + android:layout_margin="@dimen/fab_margin" + android:src="@drawable/ic_my_location_24dp" + tools:backgroundTint="@color/primary"/> -</LinearLayout> +</android.support.design.widget.CoordinatorLayout> diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_offline.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_offline.xml index 434cb59115..d4b64b1ea2 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_offline.xml +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_offline.xml @@ -1,52 +1,44 @@ <?xml version="1.0" encoding="utf-8"?> -<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" +<RelativeLayout + xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" - android:layout_height="match_parent" - android:orientation="vertical"> - - <android.support.v7.widget.Toolbar - android:id="@+id/toolbar" - android:layout_width="match_parent" - android:layout_height="?attr/actionBarSize" - android:background="@color/primary" - android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" /> + android:layout_height="match_parent"> <ProgressBar android:id="@+id/progress_bar" style="?android:attr/progressBarStyleHorizontal" android:layout_width="match_parent" android:layout_height="25dp" - android:layout_below="@+id/toolbar" android:indeterminate="true" - android:visibility="gone" /> + android:visibility="gone"/> <com.mapbox.mapboxsdk.maps.MapView android:id="@id/mapView" android:layout_width="match_parent" android:layout_height="match_parent" - android:layout_below="@+id/progress_bar" /> + android:layout_below="@+id/progress_bar"/> <Button + android:id="@+id/button_download_region" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:padding="10dp" - android:text="@string/button_download_region" - android:id="@+id/button_download_region" - android:layout_margin="@dimen/fab_margin" + android:layout_alignParentBottom="true" android:layout_alignParentLeft="true" android:layout_alignParentStart="true" - android:layout_alignParentBottom="true" - android:background="@color/white"/> + android:layout_margin="@dimen/fab_margin" + android:background="@color/white" + android:padding="10dp" + android:text="@string/button_download_region"/> <Button + android:id="@+id/button_list_regions" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:padding="10dp" - android:text="@string/button_list_regions" - android:id="@+id/button_list_regions" android:layout_alignBottom="@+id/button_download_region" android:layout_alignParentRight="true" android:layout_marginRight="@dimen/fab_margin" - android:background="@color/white"/> + android:background="@color/white" + android:padding="10dp" + android:text="@string/button_list_regions"/> </RelativeLayout> diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_polygon.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_polygon.xml deleted file mode 100644 index 1c60deb328..0000000000 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_polygon.xml +++ /dev/null @@ -1,15 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:id="@+id/container" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:orientation="vertical"> - - <android.support.v7.widget.Toolbar - android:id="@id/toolbar" - android:layout_width="match_parent" - android:layout_height="?attr/actionBarSize" - android:background="@color/primary" - android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" /> - -</LinearLayout> diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_polyline.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_polyline.xml index d856676260..51474d35f0 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_polyline.xml +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_polyline.xml @@ -1,22 +1,14 @@ <?xml version="1.0" encoding="utf-8"?> -<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" +<RelativeLayout + xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" - android:layout_height="match_parent" - android:orientation="vertical"> - - <android.support.v7.widget.Toolbar - android:id="@+id/toolbar" - android:layout_width="match_parent" - android:layout_height="?attr/actionBarSize" - android:background="@color/primary" - android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" /> + android:layout_height="match_parent"> <com.mapbox.mapboxsdk.maps.MapView android:id="@id/mapView" android:layout_width="match_parent" android:layout_height="match_parent" - android:layout_below="@+id/toolbar" app:mapbox_uiAttributionTintColor="@android:color/holo_green_dark" app:mapbox_cameraTargetLat="47.798202" app:mapbox_cameraTargetLng="7.573781" diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_press_for_marker.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_press_for_marker.xml index f5a9a17917..9932803907 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_press_for_marker.xml +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_press_for_marker.xml @@ -1,28 +1,21 @@ <?xml version="1.0" encoding="utf-8"?> -<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" +<RelativeLayout + xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" - android:layout_height="match_parent" - android:orientation="vertical"> - - <android.support.v7.widget.Toolbar - android:id="@+id/toolbar" - android:layout_width="match_parent" - android:layout_height="?attr/actionBarSize" - android:background="@color/primary" - android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" /> + android:layout_height="match_parent"> <com.mapbox.mapboxsdk.maps.MapView android:id="@id/mapView" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_below="@id/toolbar" - app:mapbox_uiAttributionGravity="top|end" app:mapbox_cameraTargetLat="45.1855569" app:mapbox_cameraTargetLng="5.7215506" - app:mapbox_uiLogoGravity="top|end" - app:mapbox_uiLogoMarginRight="10dp" + app:mapbox_cameraZoom="11" app:mapbox_styleUrl="@string/mapbox_style_mapbox_streets" - app:mapbox_cameraZoom="11" /> + app:mapbox_uiAttributionGravity="top|end" + app:mapbox_uiLogoGravity="top|end" + app:mapbox_uiLogoMarginRight="10dp"/> </RelativeLayout> diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_print.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_print.xml index 76451f5918..143f71478f 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_print.xml +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_print.xml @@ -1,45 +1,23 @@ <?xml version="1.0" encoding="utf-8"?> -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" +<android.support.design.widget.CoordinatorLayout + xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" + android:id="@+id/coordinator_layout" android:layout_width="match_parent" - android:layout_height="match_parent" - android:orientation="vertical"> + android:layout_height="match_parent"> - <android.support.v7.widget.Toolbar - android:id="@+id/toolbar" + <com.mapbox.mapboxsdk.maps.MapView + android:id="@id/mapView" android:layout_width="match_parent" - android:layout_height="?attr/actionBarSize" - android:background="@color/primary" - android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"> - - </android.support.v7.widget.Toolbar> - - <FrameLayout - android:id="@+id/content_frame" - android:layout_width="match_parent" - android:layout_height="match_parent"> - - <android.support.design.widget.CoordinatorLayout - android:id="@+id/coordinator_layout" - android:layout_width="match_parent" - android:layout_height="match_parent"> - - <com.mapbox.mapboxsdk.maps.MapView - android:id="@id/mapView" - android:layout_width="match_parent" - android:layout_height="match_parent" /> - - <android.support.design.widget.FloatingActionButton - android:id="@+id/fab" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_gravity="end|bottom" - android:layout_margin="@dimen/fab_margin" - android:src="@drawable/ic_print_24dp" - app:backgroundTint="@color/accent" /> - - </android.support.design.widget.CoordinatorLayout> - - </FrameLayout> - -</LinearLayout> + android:layout_height="match_parent"/> + + <android.support.design.widget.FloatingActionButton + android:id="@+id/fab" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="end|bottom" + android:layout_margin="@dimen/fab_margin" + android:src="@drawable/ic_print_24dp" + app:backgroundTint="@color/accent"/> + +</android.support.design.widget.CoordinatorLayout> diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_query_features_box.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_query_features_box.xml index dfd067cec7..3ddd7d64b4 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_query_features_box.xml +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_query_features_box.xml @@ -1,16 +1,10 @@ <?xml version="1.0" encoding="utf-8"?> -<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" +<RelativeLayout + xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent"> - <android.support.v7.widget.Toolbar - android:id="@+id/toolbar" - android:layout_width="match_parent" - android:layout_height="?attr/actionBarSize" - android:background="@color/primary" - android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" /> - <com.mapbox.mapboxsdk.maps.MapView android:id="@+id/mapView" android:layout_width="match_parent" @@ -18,7 +12,7 @@ android:layout_below="@id/toolbar" app:mapbox_cameraTargetLat="52.0907" app:mapbox_cameraTargetLng="5.1214" - app:mapbox_cameraZoom="16" /> + app:mapbox_cameraZoom="16"/> <FrameLayout android:id="@+id/selection_box" @@ -26,6 +20,6 @@ android:layout_height="150dp" android:layout_centerInParent="true" android:alpha="0.3" - android:background="#1d72da" /> + android:background="@color/mapboxGreen"/> </RelativeLayout> diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_query_features_point.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_query_features_point.xml index 6889a5fac1..66750dc47e 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_query_features_point.xml +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_query_features_point.xml @@ -1,23 +1,16 @@ <?xml version="1.0" encoding="utf-8"?> -<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" +<RelativeLayout + xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent"> - <android.support.v7.widget.Toolbar - android:id="@+id/toolbar" - android:layout_width="match_parent" - android:layout_height="?attr/actionBarSize" - android:background="@color/primary" - android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" /> - <com.mapbox.mapboxsdk.maps.MapView android:id="@+id/mapView" android:layout_width="match_parent" android:layout_height="match_parent" - android:layout_below="@id/toolbar" app:mapbox_cameraTargetLat="52.0907" app:mapbox_cameraTargetLng="5.1214" - app:mapbox_cameraZoom="16" /> + app:mapbox_cameraZoom="16"/> </RelativeLayout> diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_runtime_style.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_runtime_style.xml index 34823b0da1..7454ce5860 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_runtime_style.xml +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_runtime_style.xml @@ -1,19 +1,12 @@ <?xml version="1.0" encoding="utf-8"?> -<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" +<RelativeLayout + xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent"> - <android.support.v7.widget.Toolbar - android:id="@+id/toolbar" - android:layout_width="match_parent" - android:layout_height="?attr/actionBarSize" - android:background="@color/primary" - android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" /> - <com.mapbox.mapboxsdk.maps.MapView android:id="@id/mapView" android:layout_width="match_parent" - android:layout_height="match_parent" - android:layout_below="@id/toolbar" /> + android:layout_height="match_parent"/> </RelativeLayout> diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_snapshot.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_snapshot.xml index ac69780592..67ee0cc0b2 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_snapshot.xml +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_snapshot.xml @@ -1,21 +1,14 @@ <?xml version="1.0" encoding="utf-8"?> -<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" +<RelativeLayout + xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> - <android.support.v7.widget.Toolbar - android:id="@+id/toolbar" - android:layout_width="match_parent" - android:layout_height="?attr/actionBarSize" - android:background="@color/primary" - android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" /> - <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" - android:layout_below="@+id/toolbar" android:orientation="vertical"> <ImageView @@ -23,7 +16,7 @@ android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1" - android:background="@color/primary" /> + android:background="@color/primary"/> <com.mapbox.mapboxsdk.maps.MapView android:id="@id/mapView" @@ -42,6 +35,6 @@ android:layout_alignParentRight="true" android:layout_margin="@dimen/fab_margin" android:src="@drawable/ic_add_a_photo_black_24dp" - app:backgroundTint="@android:color/white" /> + app:backgroundTint="@android:color/white"/> </RelativeLayout> diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_style_file.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_style_file.xml index e0e2cbfdab..69954db3c1 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_style_file.xml +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_style_file.xml @@ -1,26 +1,18 @@ <?xml version="1.0" encoding="utf-8"?> -<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" +<RelativeLayout + xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" - android:layout_height="match_parent" - android:orientation="vertical"> - - <android.support.v7.widget.Toolbar - android:id="@+id/toolbar" - android:layout_width="match_parent" - android:layout_height="?attr/actionBarSize" - android:background="@color/primary" - android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" /> + android:layout_height="match_parent"> <com.mapbox.mapboxsdk.maps.MapView android:id="@id/mapView" - android:layout_below="@id/toolbar" android:layout_width="match_parent" + android:layout_height="match_parent" app:mapbox_cameraTargetLat="52.519003" app:mapbox_cameraTargetLng="13.400972" - app:mapbox_styleUrl="@string/mapbox_style_mapbox_streets" app:mapbox_cameraZoom="16" - android:layout_height="match_parent"/> + app:mapbox_styleUrl="@string/mapbox_style_mapbox_streets"/> <android.support.design.widget.FloatingActionButton android:id="@id/fab" @@ -31,6 +23,6 @@ android:layout_alignParentRight="true" android:layout_margin="@dimen/fab_margin" android:src="@drawable/ic_add_24dp" - app:backgroundTint="@android:color/white" /> + app:backgroundTint="@android:color/white"/> </RelativeLayout> diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_symbollayer.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_symbollayer.xml index 67892abbd1..9b88994f1c 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_symbollayer.xml +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_symbollayer.xml @@ -1,22 +1,15 @@ <?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" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:orientation="vertical"> - - <android.support.v7.widget.Toolbar - android:id="@+id/toolbar" - android:layout_width="match_parent" - android:layout_height="?attr/actionBarSize" - android:background="@color/primary" - android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"/> +<RelativeLayout + xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:orientation="vertical"> <com.mapbox.mapboxsdk.maps.MapView android:id="@id/mapView" android:layout_width="match_parent" android:layout_height="match_parent" - android:layout_below="@id/toolbar" app:mapbox_styleUrl="@string/mapbox_style_mapbox_streets"/> </RelativeLayout> diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_viewpager.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_viewpager.xml index 9bb5560bb2..d2ccda3229 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_viewpager.xml +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_viewpager.xml @@ -1,21 +1,13 @@ <?xml version="1.0" encoding="utf-8"?> -<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" +<RelativeLayout + xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" - android:layout_height="match_parent" - android:orientation="vertical"> - - <android.support.v7.widget.Toolbar - android:id="@+id/toolbar" - android:layout_width="match_parent" - android:layout_height="?attr/actionBarSize" - android:background="@color/primary" - android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" /> + android:layout_height="match_parent"> <android.support.v4.view.ViewPager android:id="@+id/viewpager" android:layout_width="match_parent" - android:layout_height="match_parent" - android:layout_below="@id/toolbar"> + android:layout_height="match_parent"> <android.support.v4.view.PagerTabStrip android:id="@+id/viewpager_header" @@ -23,7 +15,7 @@ android:layout_height="wrap_content" android:layout_gravity="top" android:paddingBottom="4dp" - android:paddingTop="4dp" /> + android:paddingTop="4dp"/> </android.support.v4.view.ViewPager> diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_visible_bounds.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_visible_bounds.xml index 17a5c27942..89a28a7799 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_visible_bounds.xml +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_visible_bounds.xml @@ -1,19 +1,13 @@ <?xml version="1.0" encoding="utf-8"?> -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" +<LinearLayout + xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> - <android.support.v7.widget.Toolbar - android:id="@+id/toolbar" - android:layout_width="match_parent" - android:layout_height="?attr/actionBarSize" - android:background="@color/primary" - android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" /> - <com.mapbox.mapboxsdk.maps.MapView android:id="@id/mapView" android:layout_width="match_parent" - android:layout_height="match_parent" /> + android:layout_height="match_parent"/> </LinearLayout> diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/item_main_feature.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/item_main_feature.xml index 93af094e3f..d2c493b2e2 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/item_main_feature.xml +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/item_main_feature.xml @@ -1,10 +1,13 @@ <?xml version="1.0" encoding="utf-8"?> -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" +<LinearLayout + xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="72dp" android:background="?android:attr/selectableItemBackground" android:orientation="vertical" + android:paddingEnd="16dp" android:paddingLeft="16dp" + android:paddingRight="16dp" android:paddingStart="16dp" android:paddingTop="16dp"> @@ -12,24 +15,22 @@ android:id="@+id/nameView" android:layout_width="match_parent" android:layout_height="wrap_content" - android:gravity="center_vertical" - android:text="Dummy headline" - android:layout_marginRight="16dp" android:layout_marginEnd="16dp" - android:singleLine="true" + android:layout_marginRight="16dp" + android:gravity="center_vertical" + android:maxLines="1" android:textColor="@android:color/black" - android:textSize="16sp" /> + android:textSize="16sp"/> <TextView android:id="@+id/descriptionView" android:layout_width="match_parent" android:layout_height="wrap_content" - android:alpha="0.56" - android:layout_marginRight="16dp" android:layout_marginEnd="16dp" - android:singleLine="true" - android:text="Description is dummy dummy" + android:layout_marginRight="16dp" + android:alpha="0.56" + android:maxLines="1" android:textColor="@android:color/black" - android:textSize="14sp" /> + android:textSize="14sp"/> </LinearLayout>
\ No newline at end of file diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/section_main_layout.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/section_main_layout.xml index 8978d4e3eb..d1e1cb7b54 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/section_main_layout.xml +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/section_main_layout.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> -<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" +<RelativeLayout + xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="48dp"> @@ -7,21 +8,21 @@ android:layout_width="match_parent" android:layout_height="0.25dp" android:alpha="0.56" - android:background="@drawable/line_divider" /> + android:background="@drawable/line_divider"/> <TextView android:id="@+id/section_text" android:layout_width="match_parent" android:layout_height="48dp" + android:layout_marginEnd="16dp" android:layout_marginLeft="16dp" + android:layout_marginRight="16dp" android:layout_marginStart="16dp" android:layout_marginTop="16dp" - android:layout_marginRight="16dp" - android:layout_marginEnd="16dp" android:alpha="0.54" android:background="@android:color/transparent" - android:singleLine="true" + android:maxLines="1" android:textColor="@android:color/black" - android:textSize="14sp" /> + android:textSize="14sp"/> </RelativeLayout>
\ No newline at end of file diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/view_text_marker.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/view_text_marker.xml index 8a3508691a..a13b830067 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/view_text_marker.xml +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/view_text_marker.xml @@ -2,7 +2,7 @@ <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:background="@color/mapbox_green"> + android:background="@color/mapboxGreen"> <TextView android:id="@id/textView" diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/menu/menu_bulk_marker.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/menu/menu_bulk_marker.xml new file mode 100644 index 0000000000..ca3850a65d --- /dev/null +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/menu/menu_bulk_marker.xml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="utf-8"?> +<menu xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto"> + <item + android:id="@+id/spinner" + android:title="Amount of markers" + app:actionViewClass="android.widget.Spinner" + app:showAsAction="always"/> +</menu>
\ No newline at end of file diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/values-v21/styles.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/values-v21/styles.xml index 3d61b9a36d..fb2c4ee92e 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/values-v21/styles.xml +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/values-v21/styles.xml @@ -3,16 +3,16 @@ <style name="AppTheme" parent="AppBaseTheme"> - </style>r + </style> - <style name="AppTheme.ActionBar.Transparent" parent="AppTheme"> + <style name="AppTheme.ActionBar.Transparent" parent="NoActionBar"> <item name="colorPrimary">@android:color/transparent</item> <item name="android:windowDrawsSystemBarBackgrounds">true</item> <item name="android:windowTranslucentStatus">true</item> </style> <style name="AppTheme.ActionBar" parent="AppTheme"> - <item name="colorPrimaryDark">@color/primary_dark</item> + <item name="colorPrimaryDark">@color/primaryDark</item> <item name="colorPrimary">@color/primary</item> </style> diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/values/colors.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/values/colors.xml index 78fc76af1c..3c6fc61bc3 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/values/colors.xml +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/values/colors.xml @@ -1,12 +1,17 @@ <?xml version="1.0" encoding="utf-8"?> <resources> - <color name="primary">#1E8CAB</color> - <color name="primary_dark">#166B83</color> + <color name="primary">#52A1D8</color> + <color name="primaryDark">#3887BE</color> <color name="accent">#E55E5E</color> <color name="white">#F9F9F9</color> - <color name="mapbox_green">#56B881</color> + <color name="mapboxGreen">#56B881</color> + <color name="mapboxPurple">#8a8acb</color> - <color name="red_accent">#D50000</color> - <color name="blue_accent">#2962FF</color> - <color name="green_accent">#1B5E20</color> -</resources> + <color name="materialGrey">#F5F5F5</color> + <color name="materialDarkGrey">#DFDFDF</color> + + <color name="redAccent">#D50000</color> + <color name="blueAccent">#2962FF</color> + <color name="greenAccent">#1B5E20</color> + +</resources>
\ No newline at end of file diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/values/dimens.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/values/dimens.xml index b77a25b681..03727b7fb9 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/values/dimens.xml +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/values/dimens.xml @@ -8,6 +8,7 @@ <dimen name="map_padding_left">96dp</dimen> <dimen name="map_padding_bottom">256dp</dimen> <dimen name="map_padding_right">32dp</dimen> + <dimen name="map_padding_top">0dp</dimen> <dimen name="toolbar_shadow">4dp</dimen> <dimen name="locationview_background_drawable_padding">2dp</dimen> <dimen name="locationview_padding_top">350dp</dimen> diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/values/strings.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/values/strings.xml index 53688cdf35..c15b679643 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/values/strings.xml +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/values/strings.xml @@ -13,13 +13,12 @@ <!-- Annotations --> <string name="activity_add_bulk_markers">Add Markers In Bulk</string> - <string name="activity_animated_marker">Animated Marker (experimental)</string> + <string name="activity_animated_marker">Animated Markers</string> <string name="activity_dynamic_marker">Dynamic Marker</string> <string name="activity_polyline">Polyline</string> <string name="activity_polygon">Polygon</string> <string name="activity_press_for_marker">Press Map For Marker</string> <string name="activity_view_marker">View Marker API</string> - <string name="activity_view_marker_scale">Scaling in the View Marker API</string> <string name="activity_add_remove_markers">Add/Remove marker</string> <!-- InfoWindow--> @@ -34,14 +33,6 @@ <string name="activity_camera_position">CameraPosition Method</string> <string name="activity_scroll_by">Scroll By Method</string> - <!-- API --> - <string name="activity_directions">Directions</string> - <string name="activity_geocoder">Geocoder</string> - - <!-- Navigation --> - <string name="activity_location_picker">Location Picker</string> - <string name="activity_car_driving">Driving animation</string> - <!-- Other --> <string name="activity_double_map">Double Map Activity</string> <string name="activity_back_to_map">Back to map activity</string> @@ -98,19 +89,15 @@ <string name="description_debug_mode">Debug Mode</string> <string name="description_offline">Offline Map example</string> <string name="description_update_metadata">Update metadata example</string> - <string name="description_animated_marker">Animate the position change of a Marker</string> + <string name="description_animated_marker">Animate the position change of a marker</string> <string name="description_polyline">Add a polyline to a map</string> <string name="description_polygon">Add a polygon to a map</string> - <string name="description_directions">Example with Directions API</string> - <string name="description_geocoder">Example with Geocoder API</string> <string name="description_scroll_by">Scroll with pixels in x,y direction</string> <string name="description_snapshot">Example to make a snapshot of the map</string> <string name="description_doublemap">2 maps in a view hierarchy</string> <string name="description_back_to_map">Restart map view after temporarily leaving to another activity</string> <string name="description_view_marker">Use an Android SDK View as marker</string> - <string name="description_view_marker_scale">Scale a View Marker</string> <string name="description_dynamic_info_window_adapter">Learn how to create a dynamic custom InfoWindow</string> - <string name="description_location_picker">Use a fixed Marker to select your location</string> <string name="description_viewpager">Use SupportMapFragments in a ViewPager</string> <string name="description_runtime_style">Adopt the map style on the fly</string> <string name="description_symbol_layer">Manipulate symbols at runtime</string> @@ -123,7 +110,6 @@ <string name="description_query_rendered_features_box_count">Count all rendered features in box</string> <string name="description_query_rendered_features_box_symbol_count">Count all rendered symbols in box</string> <string name="description_query_rendered_features_box_highlight">Hightligh buildings in box</string> - <string name="description_car_driving">MyLocationView follow map update example</string> <string name="description_simple_map">Shows a simple map</string> <string name="description_add_remove_markers">Based on zoom level</string> <string name="description_style_file">Use a local file as the style</string> @@ -141,15 +127,12 @@ <string name="category_annotation">Annotation</string> <string name="category_camera">Camera</string> <string name="category_custom_layer">Custom Layer</string> - <string name="category_directions">Directions</string> <string name="category_fragment">Fragment</string> - <string name="category_geocoding">Geocoding</string> <string name="category_imagegenerator">Image Generator</string> - <string name="category_infowindow">InfoWindow</string> + <string name="category_infowindow">Info Window</string> <string name="category_maplayout">Map Layout</string> <string name="category_offline">Offline</string> <string name="category_userlocation">User Location</string> - <string name="category_navigation">Navigation</string> <string name="category_style">Styling</string> <string name="category_features">Features</string> diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/values/styles.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/values/styles.xml index e358fcd5a0..4b431bfe48 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/values/styles.xml +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/values/styles.xml @@ -1,14 +1,21 @@ <?xml version="1.0" encoding="utf-8"?> <resources> - <style name="AppBaseTheme" parent="@style/Theme.AppCompat.Light.NoActionBar"> + <style name="AppBaseTheme" parent="Theme.AppCompat.Light.DarkActionBar"> <item name="colorPrimary">@color/primary</item> - <item name="colorPrimaryDark">@color/primary_dark</item> + <item name="colorPrimaryDark">@color/primaryDark</item> <item name="colorAccent">@color/accent</item> <item name="android:windowBackground">@color/white</item> </style> - <style name="AppTheme.ActionBar.Transparent" parent="AppTheme"> + <style name="NoActionBar" parent="Theme.AppCompat.NoActionBar"> + <item name="colorPrimary">@color/primary</item> + <item name="colorPrimaryDark">@color/primaryDark</item> + <item name="colorAccent">@color/accent</item> + <item name="android:windowBackground">@color/white</item> + </style> + + <style name="AppTheme.ActionBar.Transparent" parent="NoActionBar"> <item name="android:windowContentOverlay">@null</item> <item name="windowActionBarOverlay">true</item> <item name="colorPrimary">@android:color/transparent</item> |