From 67dd09448ca5751f47021deaf650edb5684d8fd0 Mon Sep 17 00:00:00 2001 From: Cameron Mace Date: Tue, 25 Oct 2016 15:56:18 -0400 Subject: [PATCH] Release 4.2.0-beta.4 (#170) * minor changes to match website examples * fixes retrofit memory leak on device rotation * gets rid of unused import * bumped version to beta.4 * added missing file back --- MapboxAndroidDemo/build.gradle | 10 +++++----- .../examples/annotations/DrawGeojsonLineActivity.java | 2 +- .../examples/mas/DirectionsActivity.java | 7 ++++++- .../examples/mas/MapMatchingActivity.java | 7 ++++++- .../layout/activity_annotation_basic_marker_view.xml | 2 +- .../layout/activity_annotation_custom_info_window.xml | 2 +- .../res/layout/activity_annotation_geojson_line.xml | 2 +- .../src/main/res/layout/activity_annotation_marker.xml | 2 +- .../main/res/layout/activity_annotation_polygon.xml | 2 +- .../res/layout/activity_basic_support_map_frag.xml | 2 +- .../src/main/res/layout/activity_camera_animate.xml | 2 +- .../main/res/layout/activity_camera_bounding_box.xml | 2 +- .../src/main/res/layout/activity_location_basic.xml | 2 +- .../src/main/res/layout/activity_location_tracking.xml | 3 ++- .../src/main/res/layout/activity_mas_directions.xml | 2 +- .../src/main/res/layout/activity_mas_geocoding.xml | 2 +- .../src/main/res/layout/activity_mas_map_matching.xml | 4 +++- .../src/main/res/layout/activity_mas_static_image.xml | 2 +- .../src/main/res/layout/activity_offline_simple.xml | 2 +- .../src/main/res/layout/activity_simplify_polyline.xml | 4 +++- .../src/main/res/layout/activity_style_default.xml | 2 +- .../main/res/layout/activity_style_mapbox_studio.xml | 2 +- .../src/main/res/layout/activity_style_raster.xml | 2 +- .../src/main/res/layout/activity_style_satellite.xml | 2 +- 24 files changed, 43 insertions(+), 28 deletions(-) diff --git a/MapboxAndroidDemo/build.gradle b/MapboxAndroidDemo/build.gradle index 89378c42b..83ea0981f 100644 --- a/MapboxAndroidDemo/build.gradle +++ b/MapboxAndroidDemo/build.gradle @@ -11,8 +11,8 @@ android { defaultConfig { minSdkVersion 15 targetSdkVersion 25 - versionCode 31 - versionName "4.2.0-beta.3" + versionCode 32 + versionName "4.2.0-beta.4" } buildTypes { @@ -25,7 +25,7 @@ android { repositories { maven { url "https://jitpack.io" } - maven { url "http://oss.sonatype.org/content/repositories/snapshots/" } +// maven { url "http://oss.sonatype.org/content/repositories/snapshots/" } } dependencies { @@ -39,8 +39,8 @@ dependencies { compile 'com.squareup.picasso:picasso:2.5.2' // Mapbox dependencies -// compile('com.mapbox.mapboxsdk:mapbox-android-sdk:4.2.0-beta.3@aar') { - compile('com.mapbox.mapboxsdk:mapbox-android-sdk:4.2.0-SNAPSHOT@aar') { +// compile('com.mapbox.mapboxsdk:mapbox-android-sdk:4.2.0-SNAPSHOT@aar') { + compile('com.mapbox.mapboxsdk:mapbox-android-sdk:4.2.0-beta.4@aar') { transitive = true } compile('com.mapbox.mapboxsdk:mapbox-android-services:1.3.1@aar') { diff --git a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/annotations/DrawGeojsonLineActivity.java b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/annotations/DrawGeojsonLineActivity.java index 2d204c015..8649dfee5 100644 --- a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/annotations/DrawGeojsonLineActivity.java +++ b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/annotations/DrawGeojsonLineActivity.java @@ -27,7 +27,7 @@ public class DrawGeojsonLineActivity extends AppCompatActivity implements OnMapReadyCallback { - private static final String TAG = "MainActivity"; + private static final String TAG = "DrawGeojsonLineActivity"; private MapView mapView; private MapboxMap mapboxMap; diff --git a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/mas/DirectionsActivity.java b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/mas/DirectionsActivity.java index 96498bf7c..a97e523cb 100644 --- a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/mas/DirectionsActivity.java +++ b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/mas/DirectionsActivity.java @@ -36,6 +36,7 @@ public class DirectionsActivity extends AppCompatActivity { private MapView mapView; private MapboxMap map; private DirectionsRoute currentRoute; + private MapboxDirections client; @Override protected void onCreate(Bundle savedInstanceState) { @@ -85,7 +86,7 @@ public void onMapReady(MapboxMap mapboxMap) { private void getRoute(Position origin, Position destination) throws ServicesException { - MapboxDirections client = new MapboxDirections.Builder() + client = new MapboxDirections.Builder() .setOrigin(origin) .setDestination(destination) .setProfile(DirectionsCriteria.PROFILE_CYCLING) @@ -164,6 +165,10 @@ protected void onSaveInstanceState(Bundle outState) { @Override protected void onDestroy() { super.onDestroy(); + // Cancel the directions API request + if (client != null) { + client.cancelCall(); + } mapView.onDestroy(); } diff --git a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/mas/MapMatchingActivity.java b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/mas/MapMatchingActivity.java index ccd671869..ca6a48f7f 100644 --- a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/mas/MapMatchingActivity.java +++ b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/mas/MapMatchingActivity.java @@ -41,6 +41,7 @@ public class MapMatchingActivity extends AppCompatActivity { private MapView mapView; private MapboxMap map; + private MapboxMapMatching client; @Override protected void onCreate(Bundle savedInstanceState) { @@ -88,6 +89,10 @@ public void onLowMemory() { @Override protected void onDestroy() { super.onDestroy(); + // Cancel the MapMatching API request + if (client != null) { + client.cancelCall(); + } mapView.onDestroy(); } @@ -171,7 +176,7 @@ private void drawBeforeMapMatching(List points) { private void drawMapMatched(LineString lineString, int precision) { try { // Setup the request using a client. - MapboxMapMatching client = new MapboxMapMatching.Builder() + client = new MapboxMapMatching.Builder() .setAccessToken(MapboxAccountManager.getInstance().getAccessToken()) .setProfile(DirectionsCriteria.PROFILE_DRIVING) .setGpsPrecison(precision) diff --git a/MapboxAndroidDemo/src/main/res/layout/activity_annotation_basic_marker_view.xml b/MapboxAndroidDemo/src/main/res/layout/activity_annotation_basic_marker_view.xml index b515182bd..cf8a8fef5 100644 --- a/MapboxAndroidDemo/src/main/res/layout/activity_annotation_basic_marker_view.xml +++ b/MapboxAndroidDemo/src/main/res/layout/activity_annotation_basic_marker_view.xml @@ -5,7 +5,7 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" - tools:context=".MainActivity"> + tools:context=".examples.annotations.BasicMarkerViewActivity"> + tools:context=".examples.annotations.CustomInfoWindowActivity"> + tools:context=".examples.annotations.DrawGeojsonLineActivity"> + tools:context=".examples.annotations.DrawMarkerActivity"> + tools:context=".examples.annotations.DrawPolygonActivity"> + tools:context=".examples.basics.SupportMapFragmentActivity"> + tools:context=".examples.camera.AnimateMapCameraActivity"> + tools:context=".examples.camera.BoundingBoxCameraActivity"> + tools:context=".examples.location.BasicUserLocation"> + tools:context=".examples.location.LocationTrackingActivity"> + tools:context=".examples.mas.DirectionsActivity"> + tools:context=".examples.mas.GeocodingActivity"> + android:orientation="vertical" + tools:context=".examples.mas.MapMatchingActivity"> + tools:context=".examples.mas.StaticImageActivity"> + tools:context=".examples.offline.SimpleOfflineMapActivity"> + android:orientation="vertical" + tools:context=".examples.mas.SimplifyPolylineActivity"> + tools:context=".examples.styles.DefaultStyleActivity"> + tools:context=".examples.styles.MapboxStudioStyleActivity">