From efac9b2b18af6a3f7b2b27ece4441f306e4ccba0 Mon Sep 17 00:00:00 2001 From: Tobrun Van Nuland Date: Thu, 27 Jul 2017 08:29:59 +0200 Subject: [android] - fix lint issues SDK --- platform/android/MapboxGLAndroidSDK/build.gradle | 2 +- .../MapboxGLAndroidSDK/lint-baseline-local.xml | 37 + .../MapboxGLAndroidSDK/lint/lint-baseline-ci.xml | 587 +---- .../src/main/java/com/mapbox/mapboxsdk/Mapbox.java | 2 + .../mapbox/mapboxsdk/annotations/IconFactory.java | 2 + .../com/mapbox/mapboxsdk/http/HTTPRequest.java | 15 +- .../java/com/mapbox/mapboxsdk/maps/MapboxMap.java | 5 +- .../com/mapbox/mapboxsdk/maps/NativeMapView.java | 10 +- .../java/com/mapbox/mapboxsdk/maps/Transform.java | 4 +- .../mapboxsdk/maps/widgets/MyLocationView.java | 2 + .../mapbox/mapboxsdk/net/ConnectivityReceiver.java | 4 +- .../mapbox/mapboxsdk/offline/OfflineManager.java | 10 +- .../com/mapbox/mapboxsdk/storage/FileSource.java | 6 +- .../mapbox/mapboxsdk/style/functions/Function.java | 2 +- .../src/main/res-public/values/public.xml | 4 +- .../main/res/color/mapbox_material_bg_selector.xml | 5 - .../res/drawable-nodpi/mapbox_mapview_preview.jpg | Bin 0 -> 166053 bytes .../res/drawable-xxhdpi/mapbox_mapview_preview.jpg | Bin 166053 -> 0 bytes .../mapbox_infowindow_icon_bg.9.png | Bin 928 -> 0 bytes .../res/layout/mapbox_attribution_list_item.xml | 1 + .../main/res/layout/mapbox_infowindow_content.xml | 3 +- .../main/res/layout/mapbox_view_image_marker.xml | 7 +- .../src/main/res/values/colors.xml | 1 - .../src/main/res/values/dimens.xml | 9 - .../android/MapboxGLAndroidSDKTestApp/build.gradle | 6 +- .../lint/lint-baseline-ci.xml | 2554 +------------------- .../testapp/maps/widgets/MyLocationViewTest.java | 2 + .../testapp/utils/OnMapReadyIdlingResource.java | 4 +- .../mapboxsdk/testapp/MapboxApplication.java | 4 +- .../testapp/activity/FeatureOverviewActivity.java | 2 +- .../annotation/AddRemoveMarkerActivity.java | 8 +- .../activity/annotation/BulkMarkerActivity.java | 2 +- .../activity/annotation/MarkerViewActivity.java | 7 +- .../annotation/MarkerViewsInRectangleActivity.java | 2 +- .../activity/camera/CameraPositionActivity.java | 2 + .../QueryRenderedFeaturesBoxCountActivity.java | 13 +- .../QueryRenderedFeaturesBoxHighlightActivity.java | 2 +- ...ueryRenderedFeaturesBoxSymbolCountActivity.java | 4 +- .../QueryRenderedFeaturesPropertiesActivity.java | 19 +- .../activity/imagegenerator/SnapshotActivity.java | 4 +- .../DynamicInfoWindowAdapterActivity.java | 7 +- .../activity/maplayout/DebugModeActivity.java | 2 +- .../testapp/activity/offline/OfflineActivity.java | 12 +- .../activity/style/CircleLayerActivity.java | 4 +- .../activity/style/GeoJsonClusteringActivity.java | 2 +- .../activity/style/RealTimeGeoJsonActivity.java | 2 +- .../activity/style/RuntimeStyleActivity.java | 12 +- .../testapp/activity/style/StyleFileActivity.java | 2 +- .../userlocation/MyLocationDrawableActivity.java | 2 +- .../model/other/OfflineListRegionsDialog.java | 2 +- .../mapboxsdk/testapp/utils/OfflineUtils.java | 2 +- .../mapboxsdk/testapp/utils/TimingLogger.java | 6 +- .../src/main/res/drawable/ic_check_box.xml | 9 - .../src/main/res/drawable/marker.xml | 4 - .../res/layout/activity_animated_image_source.xml | 12 - .../main/res/layout/activity_building_layer.xml | 10 +- .../res/layout/activity_camera_animation_types.xml | 5 + .../src/main/res/layout/activity_circle_layer.xml | 2 + .../src/main/res/layout/activity_debug_mode.xml | 2 + .../src/main/res/layout/activity_map_in_dialog.xml | 7 +- .../src/main/res/layout/activity_map_padding.xml | 15 +- .../src/main/res/layout/activity_marker_bulk.xml | 1 + .../src/main/res/layout/activity_marker_view.xml | 8 +- .../main/res/layout/activity_metadata_update.xml | 2 +- .../src/main/res/layout/activity_multi_map.xml | 8 +- .../layout/activity_my_location_customization.xml | 25 +- .../src/main/res/layout/activity_offline.xml | 41 +- .../res/layout/activity_offline_region_delete.xml | 2 +- .../src/main/res/layout/activity_scroll_by.xml | 14 +- .../src/main/res/layout/activity_snapshot.xml | 1 + .../src/main/res/layout/activity_viewpager.xml | 1 - .../src/main/res/layout/dialog_camera_position.xml | 30 +- .../src/main/res/layout/fragment_double_map.xml | 1 - .../src/main/res/layout/item_main_feature.xml | 2 + .../src/main/res/layout/section_main_layout.xml | 1 + .../src/main/res/layout/view_custom_marker.xml | 2 + .../src/main/res/layout/view_text_marker.xml | 1 + .../src/main/res/menu/menu_building.xml | 4 +- .../src/main/res/menu/menu_bulk_marker.xml | 2 +- .../src/main/res/menu/menu_custom_layer.xml | 12 +- .../src/main/res/menu/menu_data_driven_style.xml | 18 +- .../src/main/res/menu/menu_padding.xml | 4 +- .../src/main/res/menu/menu_press_for_marker.xml | 3 +- .../src/main/res/menu/menu_runtime_style.xml | 32 +- .../src/main/res/menu/menu_symbol_layer.xml | 6 +- .../src/main/res/menu/menu_zoom.xml | 10 +- .../src/main/res/values/dimens.xml | 1 - .../src/main/res/values/strings.xml | 56 +- 88 files changed, 430 insertions(+), 3332 deletions(-) create mode 100644 platform/android/MapboxGLAndroidSDK/lint-baseline-local.xml delete mode 100644 platform/android/MapboxGLAndroidSDK/src/main/res/color/mapbox_material_bg_selector.xml create mode 100644 platform/android/MapboxGLAndroidSDK/src/main/res/drawable-nodpi/mapbox_mapview_preview.jpg delete mode 100644 platform/android/MapboxGLAndroidSDK/src/main/res/drawable-xxhdpi/mapbox_mapview_preview.jpg delete mode 100644 platform/android/MapboxGLAndroidSDK/src/main/res/drawable-xxxhdpi/mapbox_infowindow_icon_bg.9.png delete mode 100644 platform/android/MapboxGLAndroidSDKTestApp/src/main/res/drawable/ic_check_box.xml delete mode 100644 platform/android/MapboxGLAndroidSDKTestApp/src/main/res/drawable/marker.xml diff --git a/platform/android/MapboxGLAndroidSDK/build.gradle b/platform/android/MapboxGLAndroidSDK/build.gradle index 0cb6e529f1..5e7025c4c8 100644 --- a/platform/android/MapboxGLAndroidSDK/build.gradle +++ b/platform/android/MapboxGLAndroidSDK/build.gradle @@ -116,7 +116,7 @@ android { } lintOptions { - baseline file("lint-baseline.xml") + baseline file("lint-baseline-local.xml") checkAllWarnings true warningsAsErrors true } diff --git a/platform/android/MapboxGLAndroidSDK/lint-baseline-local.xml b/platform/android/MapboxGLAndroidSDK/lint-baseline-local.xml new file mode 100644 index 0000000000..0a76f53505 --- /dev/null +++ b/platform/android/MapboxGLAndroidSDK/lint-baseline-local.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + diff --git a/platform/android/MapboxGLAndroidSDK/lint/lint-baseline-ci.xml b/platform/android/MapboxGLAndroidSDK/lint/lint-baseline-ci.xml index 4dc8ecde70..fd65c9f627 100644 --- a/platform/android/MapboxGLAndroidSDK/lint/lint-baseline-ci.xml +++ b/platform/android/MapboxGLAndroidSDK/lint/lint-baseline-ci.xml @@ -1,5 +1,5 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/Mapbox.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/Mapbox.java index 3af7921596..70b13f05fb 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/Mapbox.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/Mapbox.java @@ -1,5 +1,6 @@ package com.mapbox.mapboxsdk; +import android.annotation.SuppressLint; import android.content.Context; import android.net.ConnectivityManager; import android.net.NetworkInfo; @@ -26,6 +27,7 @@ import com.mapbox.services.android.telemetry.location.LocationEnginePriority; @UiThread public final class Mapbox { + @SuppressLint("StaticFieldLeak") private static Mapbox INSTANCE; private Context context; private String accessToken; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/IconFactory.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/IconFactory.java index f9ca9bf4cc..3c9cb31211 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/IconFactory.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/IconFactory.java @@ -1,5 +1,6 @@ package com.mapbox.mapboxsdk.annotations; +import android.annotation.SuppressLint; import android.content.Context; import android.graphics.Bitmap; import android.graphics.BitmapFactory; @@ -35,6 +36,7 @@ public final class IconFactory { public static final String ICON_MARKERVIEW_ID = ICON_ID_PREFIX + "marker_view"; private Context context; + @SuppressLint("StaticFieldLeak") private static IconFactory instance; private Icon defaultMarker; private Icon defaultMarkerView; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/http/HTTPRequest.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/http/HTTPRequest.java index 9c8cda5544..91a235616a 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/http/HTTPRequest.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/http/HTTPRequest.java @@ -109,13 +109,11 @@ class HTTPRequest implements Callback { @Override public void onResponse(Call call, Response response) throws IOException { if (response.isSuccessful()) { - Timber.v(String.format("[HTTP] Request was successful (code = %d).", response.code())); + Timber.v("[HTTP] Request was successful (code = %s).", response.code()); } else { // We don't want to call this unsuccessful because a 304 isn't really an error String message = !TextUtils.isEmpty(response.message()) ? response.message() : "No additional information"; - Timber.d(String.format( - "[HTTP] Request with response code = %d: %s", - response.code(), message)); + Timber.d("[HTTP] Request with response code = %s: %s", response.code(), message); } byte[] body; @@ -160,15 +158,12 @@ class HTTPRequest implements Callback { String errorMessage = e.getMessage() != null ? e.getMessage() : "Error processing the request"; if (type == TEMPORARY_ERROR) { - Timber.d(String.format(MapboxConstants.MAPBOX_LOCALE, - "Request failed due to a temporary error: %s", errorMessage)); + Timber.d("Request failed due to a temporary error: %s", errorMessage); } else if (type == CONNECTION_ERROR) { - Timber.i(String.format(MapboxConstants.MAPBOX_LOCALE, - "Request failed due to a connection error: %s", errorMessage)); + Timber.i("Request failed due to a connection error: %s", errorMessage); } else { // PERMANENT_ERROR - Timber.w(String.format(MapboxConstants.MAPBOX_LOCALE, - "Request failed due to a permanent error: %s", errorMessage)); + Timber.w("Request failed due to a permanent error: %s", errorMessage); } mLock.lock(); diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMap.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMap.java index f47fcdfd4a..3b8bc16bb3 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMap.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMap.java @@ -272,7 +272,6 @@ public final class MapboxMap { * Check whether tile pre-fetching is enabled or not. * * @return true if enabled - * * @see MapboxMap#setPrefetchesTiles(boolean) */ @UiThread @@ -316,7 +315,7 @@ public final class MapboxMap { // noinspection unchecked return (T) nativeMapView.getLayer(layerId); } catch (ClassCastException exception) { - Timber.e(String.format("Layer: %s is a different type: %s", layerId, exception)); + Timber.e(exception, "Layer: %s is a different type: ", layerId); return null; } } @@ -437,7 +436,7 @@ public final class MapboxMap { // noinspection unchecked return (T) nativeMapView.getSource(sourceId); } catch (ClassCastException exception) { - Timber.e(String.format("Source: %s is a different type: %s", sourceId, exception)); + Timber.e(exception, "Source: %s is a different type: ", sourceId); return null; } } diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/NativeMapView.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/NativeMapView.java index 52596358e2..ddeb4b326e 100755 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/NativeMapView.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/NativeMapView.java @@ -17,7 +17,6 @@ import com.mapbox.mapboxsdk.annotations.Marker; import com.mapbox.mapboxsdk.annotations.Polygon; import com.mapbox.mapboxsdk.annotations.Polyline; import com.mapbox.mapboxsdk.camera.CameraPosition; -import com.mapbox.mapboxsdk.constants.MapboxConstants; import com.mapbox.mapboxsdk.geometry.LatLng; import com.mapbox.mapboxsdk.geometry.LatLngBounds; import com.mapbox.mapboxsdk.geometry.ProjectedMeters; @@ -84,9 +83,10 @@ final class NativeMapView { private boolean isDestroyedOn(String callingMethod) { if (destroyed && !TextUtils.isEmpty(callingMethod)) { - Timber.e(String.format(MapboxConstants.MAPBOX_LOCALE, + Timber.e( "You're calling `%s` after the `MapView` was destroyed, were you invoking it after `onDestroy()`?", - callingMethod)); + callingMethod + ); } return destroyed; } @@ -143,14 +143,14 @@ final class NativeMapView { if (width > 65535) { // we have seen edge cases where devices return incorrect values #6111 Timber.e("Device returned an out of range width size, " - + "capping value at 65535 instead of " + width); + + "capping value at 65535 instead of %s", width); width = 65535; } if (height > 65535) { // we have seen edge cases where devices return incorrect values #6111 Timber.e("Device returned an out of range height size, " - + "capping value at 65535 instead of " + height); + + "capping value at 65535 instead of %s", height); height = 65535; } nativeResizeView(width, height); diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/Transform.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/Transform.java index d788b7772b..6f63c2eba8 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/Transform.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/Transform.java @@ -346,7 +346,7 @@ final class Transform implements MapView.OnMapChangedListener { void setMinZoom(double minZoom) { if ((minZoom < MapboxConstants.MINIMUM_ZOOM) || (minZoom > MapboxConstants.MAXIMUM_ZOOM)) { - Timber.e("Not setting minZoomPreference, value is in unsupported range: " + minZoom); + Timber.e("Not setting minZoomPreference, value is in unsupported range: %s", minZoom); return; } mapView.setMinZoom(minZoom); @@ -358,7 +358,7 @@ final class Transform implements MapView.OnMapChangedListener { void setMaxZoom(double maxZoom) { if ((maxZoom < MapboxConstants.MINIMUM_ZOOM) || (maxZoom > MapboxConstants.MAXIMUM_ZOOM)) { - Timber.e("Not setting maxZoomPreference, value is in unsupported range: " + maxZoom); + Timber.e("Not setting maxZoomPreference, value is in unsupported range: %s", maxZoom); return; } mapView.setMaxZoom(maxZoom); diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/widgets/MyLocationView.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/widgets/MyLocationView.java index 017fdb353a..4e696fb56b 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/widgets/MyLocationView.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/widgets/MyLocationView.java @@ -1,6 +1,7 @@ package com.mapbox.mapboxsdk.maps.widgets; import android.animation.ValueAnimator; +import android.annotation.SuppressLint; import android.content.Context; import android.graphics.Camera; import android.graphics.Canvas; @@ -775,6 +776,7 @@ public class MyLocationView extends View { locationSource = new WeakReference<>(locationEngine); } + @SuppressLint("MissingPermission") @Override public void onConnected() { MyLocationView locationView = userLocationView.get(); diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/net/ConnectivityReceiver.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/net/ConnectivityReceiver.java index a1bd98b780..817dcdb438 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/net/ConnectivityReceiver.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/net/ConnectivityReceiver.java @@ -1,5 +1,6 @@ package com.mapbox.mapboxsdk.net; +import android.annotation.SuppressLint; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; @@ -21,6 +22,7 @@ import timber.log.Timber; * Not public api. */ public class ConnectivityReceiver extends BroadcastReceiver { + @SuppressLint("StaticFieldLeak") private static ConnectivityReceiver INSTANCE; /** @@ -82,7 +84,7 @@ public class ConnectivityReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { boolean connected = isConnected(context); - Timber.v("Connected: " + connected); + Timber.v("Connected: %s", connected); // Loop over listeners for (ConnectivityListener listener : listeners) { diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/offline/OfflineManager.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/offline/OfflineManager.java index 1e6f44f094..130284e88d 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/offline/OfflineManager.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/offline/OfflineManager.java @@ -1,5 +1,6 @@ package com.mapbox.mapboxsdk.offline; +import android.annotation.SuppressLint; import android.content.Context; import android.os.Handler; import android.os.Looper; @@ -40,6 +41,7 @@ public class OfflineManager { private Handler handler; // This object is implemented as a singleton + @SuppressLint("StaticFieldLeak") private static OfflineManager instance; // The application context @@ -90,11 +92,11 @@ public class OfflineManager { */ private OfflineManager(Context context) { this.context = context.getApplicationContext(); - this.fileSource = FileSource.getInstance(context); + this.fileSource = FileSource.getInstance(this.context); initialize(fileSource); // Delete any existing previous ambient cache database - deleteAmbientDatabase(context); + deleteAmbientDatabase(this.context); } private void deleteAmbientDatabase(final Context context) { @@ -107,10 +109,10 @@ public class OfflineManager { File file = new File(path); if (file.exists()) { file.delete(); - Timber.d("Old ambient cache database deleted to save space: " + path); + Timber.d("Old ambient cache database deleted to save space: %s", path); } } catch (Exception exception) { - Timber.e("Failed to delete old ambient cache database: ", exception); + Timber.e(exception, "Failed to delete old ambient cache database: "); } } }).start(); diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/storage/FileSource.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/storage/FileSource.java index eafef80e8d..a968cdf192 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/storage/FileSource.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/storage/FileSource.java @@ -72,9 +72,9 @@ public class FileSource { MapboxConstants.KEY_META_DATA_SET_STORAGE_EXTERNAL, MapboxConstants.DEFAULT_SET_STORAGE_EXTERNAL); } catch (PackageManager.NameNotFoundException exception) { - Timber.e("Failed to read the package metadata: ", exception); + Timber.e(exception,"Failed to read the package metadata: "); } catch (Exception exception) { - Timber.e("Failed to read the storage key: ", exception); + Timber.e(exception, "Failed to read the storage key: "); } String cachePath = null; @@ -83,7 +83,7 @@ public class FileSource { // Try getting the external storage path cachePath = context.getExternalFilesDir(null).getAbsolutePath(); } catch (NullPointerException exception) { - Timber.e("Failed to obtain the external storage path: ", exception); + Timber.e(exception, "Failed to obtain the external storage path: "); } } diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/functions/Function.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/functions/Function.java index e1e40821b1..e7bb52ebb3 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/functions/Function.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/functions/Function.java @@ -279,7 +279,7 @@ public class Function { // noinspection unchecked return (S) stops; } catch (ClassCastException exception) { - Timber.e(String.format("Stops: %s is a different type: %s", stops.getClass(), exception)); + Timber.e(exception, "Stops: %s is a different type: ", stops.getClass()); return null; } } diff --git a/platform/android/MapboxGLAndroidSDK/src/main/res-public/values/public.xml b/platform/android/MapboxGLAndroidSDK/src/main/res-public/values/public.xml index 3decd6ead1..d59eef7427 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/res-public/values/public.xml +++ b/platform/android/MapboxGLAndroidSDK/src/main/res-public/values/public.xml @@ -83,11 +83,13 @@ - + + + diff --git a/platform/android/MapboxGLAndroidSDK/src/main/res/color/mapbox_material_bg_selector.xml b/platform/android/MapboxGLAndroidSDK/src/main/res/color/mapbox_material_bg_selector.xml deleted file mode 100644 index 4c733ed112..0000000000 --- a/platform/android/MapboxGLAndroidSDK/src/main/res/color/mapbox_material_bg_selector.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/platform/android/MapboxGLAndroidSDK/src/main/res/drawable-nodpi/mapbox_mapview_preview.jpg b/platform/android/MapboxGLAndroidSDK/src/main/res/drawable-nodpi/mapbox_mapview_preview.jpg new file mode 100644 index 0000000000..3a21fc08bc Binary files /dev/null and b/platform/android/MapboxGLAndroidSDK/src/main/res/drawable-nodpi/mapbox_mapview_preview.jpg differ diff --git a/platform/android/MapboxGLAndroidSDK/src/main/res/drawable-xxhdpi/mapbox_mapview_preview.jpg b/platform/android/MapboxGLAndroidSDK/src/main/res/drawable-xxhdpi/mapbox_mapview_preview.jpg deleted file mode 100644 index 3a21fc08bc..0000000000 Binary files a/platform/android/MapboxGLAndroidSDK/src/main/res/drawable-xxhdpi/mapbox_mapview_preview.jpg and /dev/null differ diff --git a/platform/android/MapboxGLAndroidSDK/src/main/res/drawable-xxxhdpi/mapbox_infowindow_icon_bg.9.png b/platform/android/MapboxGLAndroidSDK/src/main/res/drawable-xxxhdpi/mapbox_infowindow_icon_bg.9.png deleted file mode 100644 index 584b320299..0000000000 Binary files a/platform/android/MapboxGLAndroidSDK/src/main/res/drawable-xxxhdpi/mapbox_infowindow_icon_bg.9.png and /dev/null differ diff --git a/platform/android/MapboxGLAndroidSDK/src/main/res/layout/mapbox_attribution_list_item.xml b/platform/android/MapboxGLAndroidSDK/src/main/res/layout/mapbox_attribution_list_item.xml index 763bb118e0..648946e8ce 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/res/layout/mapbox_attribution_list_item.xml +++ b/platform/android/MapboxGLAndroidSDK/src/main/res/layout/mapbox_attribution_list_item.xml @@ -9,5 +9,6 @@ android:paddingLeft="24dp" android:paddingRight="24dp" android:textAllCaps="true" + android:textIsSelectable="true" android:textAppearance="?android:attr/textAppearanceButton" android:textColor="@color/mapbox_blue"/> diff --git a/platform/android/MapboxGLAndroidSDK/src/main/res/layout/mapbox_infowindow_content.xml b/platform/android/MapboxGLAndroidSDK/src/main/res/layout/mapbox_infowindow_content.xml index 26c974dc0d..027f3690d5 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/res/layout/mapbox_infowindow_content.xml +++ b/platform/android/MapboxGLAndroidSDK/src/main/res/layout/mapbox_infowindow_content.xml @@ -23,6 +23,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginBottom="2dp" + android:textIsSelectable="true" android:maxEms="17" android:textColor="@android:color/black" android:textSize="18sp" @@ -34,13 +35,13 @@ android:layout_height="wrap_content" android:layout_marginBottom="2dp" android:layout_marginTop="2dp" + android:textIsSelectable="true" android:lineSpacingExtra="1dp" android:maxEms="17" android:textColor="@color/mapbox_gray" android:textSize="14sp"/> + android:id="@+id/image" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:contentDescription="@null"/> diff --git a/platform/android/MapboxGLAndroidSDK/src/main/res/values/colors.xml b/platform/android/MapboxGLAndroidSDK/src/main/res/values/colors.xml index 63ef42c2c3..68e70e948e 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/res/values/colors.xml +++ b/platform/android/MapboxGLAndroidSDK/src/main/res/values/colors.xml @@ -3,5 +3,4 @@ #7D7F80 #EEEEEE #1E8CAB - @color/mapbox_blue diff --git a/platform/android/MapboxGLAndroidSDK/src/main/res/values/dimens.xml b/platform/android/MapboxGLAndroidSDK/src/main/res/values/dimens.xml index 8edbd47c29..1c6a265587 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/res/values/dimens.xml +++ b/platform/android/MapboxGLAndroidSDK/src/main/res/values/dimens.xml @@ -2,17 +2,8 @@ 8dp 8dp - -2dp - 1.5dp - @dimen/mapbox_two_dp - @dimen/mapbox_two_dp - @dimen/mapbox_two_dp - @dimen/mapbox_two_dp - 2dp 4dp 8dp - 10dp - 16dp 92dp 18dp diff --git a/platform/android/MapboxGLAndroidSDKTestApp/build.gradle b/platform/android/MapboxGLAndroidSDKTestApp/build.gradle index b13362751a..1e4af3acf6 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/build.gradle +++ b/platform/android/MapboxGLAndroidSDKTestApp/build.gradle @@ -25,12 +25,10 @@ android { } lintOptions { - baseline file("lint-baseline.xml") + baseline file("lint-baseline-local.xml") checkAllWarnings true warningsAsErrors true - disable 'MissingTranslation' - disable 'IconDensities' - disable 'InvalidPackage' + disable 'MissingTranslation', 'GoogleAppIndexingWarning', 'UnpackedNativeCode' } buildTypes { diff --git a/platform/android/MapboxGLAndroidSDKTestApp/lint/lint-baseline-ci.xml b/platform/android/MapboxGLAndroidSDKTestApp/lint/lint-baseline-ci.xml index 89eab70c48..15198aa45e 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/lint/lint-baseline-ci.xml +++ b/platform/android/MapboxGLAndroidSDKTestApp/lint/lint-baseline-ci.xml @@ -1,5 +1,5 @@ - Concurrent Open InfoWindows @@ -185,5 +187,57 @@ Stamford Bridge Arsenal Emirates Stadium - Zoom: %s + Zoom: %d + "ViewCache size %d" + Latitude + -180 + Longitude + Zoom + 18 + Bearing + 0 + Tilt + No Results + Change intensity + Change Anchor + Amount of markers + Update layer (invalidate) + Red + Green + Blue + Add an exponential zoom function + Add an interval zoom function + Add a categorical source function + Add an exponential source function + Add an identity source function + Add an interval source function + Add a composite, categorical function + Add a composite, exponential function + Add a composite, interval function + My Location Tracking + Bangalore + List all layers in the style + List all sources in the style + Color the water + Set background opacity + Set road symbol placement to Point + Set layer visibility to false + Add a parks layer + Add a dynamic GeoJSON source + Remove buildings layer + Add a terrain layer + Add a satellite layer + Change the water color on zoom + Custom tiles + Apply filtered fill + Apply filtered line + Apply numeric fill filter + Toggle text size + Toggle text field contents + Toggle text font + Zoom in + Zoom out + Zoom by 2 + Zoom to point + Zoom to 4 -- cgit v1.2.1