From fd33e066a4440b74328ff4b7139c297ae302c66b Mon Sep 17 00:00:00 2001 From: tobrun Date: Wed, 29 May 2019 11:48:29 +0200 Subject: [android] - add external links to javadoc generation, fix warnings and errors, add package-info to loader module package --- circle.yml | 3 + .../mapboxsdk/location/LocationComponent.java | 5 +- .../LocationComponentActivationOptions.java | 2 +- .../location/LocationComponentOptions.java | 64 +++++++++++----------- .../main/java/com/mapbox/mapboxsdk/maps/Style.java | 4 +- .../mapboxsdk/module/loader/package-info.java | 4 ++ .../mapbox/mapboxsdk/style/layers/Property.java | 2 +- platform/android/gradle/gradle-javadoc.gradle | 9 +-- platform/android/scripts/generate-style-code.js | 4 ++ 9 files changed, 55 insertions(+), 42 deletions(-) create mode 100644 platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/module/loader/package-info.java diff --git a/circle.yml b/circle.yml index 0be9f3291f..ceeca4bdd6 100644 --- a/circle.yml +++ b/circle.yml @@ -651,6 +651,9 @@ jobs: - run: name: Build release Test App command: make android + - run: + name: Generate javadoc + command: make android-javadoc - save-dependencies: { gradle: true } - run: name: gzip debugable .so files diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LocationComponent.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LocationComponent.java index 9a1a1a8182..5d8847eab4 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LocationComponent.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LocationComponent.java @@ -18,6 +18,7 @@ import com.mapbox.android.core.location.LocationEngineCallback; import com.mapbox.android.core.location.LocationEngineProvider; import com.mapbox.android.core.location.LocationEngineRequest; import com.mapbox.android.core.location.LocationEngineResult; +import com.mapbox.android.core.permissions.PermissionsManager; import com.mapbox.mapboxsdk.R; import com.mapbox.mapboxsdk.camera.CameraPosition; import com.mapbox.mapboxsdk.camera.CameraUpdate; @@ -69,7 +70,7 @@ import static com.mapbox.mapboxsdk.location.LocationComponentConstants.TRANSITIO * *

* Using this component requires you to request permission beforehand manually or using - * {@link com.mapbox.android.core.permissions.PermissionsManager}. Either + * {@link PermissionsManager}. Either * {@code ACCESS_COARSE_LOCATION} or {@code ACCESS_FINE_LOCATION} permissions can be requested for * this component to work as expected. *

@@ -868,7 +869,7 @@ public final class LocationComponent { *

    * {@code
    * mapboxMap.addOnCameraIdleListener(new MapboxMap.OnCameraIdleListener() {
-   *   @Override
+   *   {@literal @}Override
    *   public void onCameraIdle() {
    *     double zoom = mapboxMap.getCameraPosition().zoom;
    *     int maxAnimationFps;
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LocationComponentActivationOptions.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LocationComponentActivationOptions.java
index 3f71209d10..04987621ef 100644
--- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LocationComponentActivationOptions.java
+++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LocationComponentActivationOptions.java
@@ -151,7 +151,7 @@ public class LocationComponentActivationOptions {
      * Deliver your own {@link LocationEngine} to the LocationComponent.
      * 

* The true/false - * {@link LocationComponentActivationOptions#builder(Context, Style)#useDefaultLocationEngine} + * {@link LocationComponentActivationOptions.Builder#useDefaultLocationEngine()} * activation option is ignored when a non-null {@link LocationEngine} is set via * this `locationEngine()` method. * diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LocationComponentOptions.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LocationComponentOptions.java index 2e1630031f..8ab03e7acd 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LocationComponentOptions.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LocationComponentOptions.java @@ -336,9 +336,9 @@ public class LocationComponentOptions implements Parcelable { /** * Set the opacity of the accuracy view to a value from 0 to 1, where 0 means the accuracy view is * completely transparent and 1 means the view is completely opaque. + * References style attribute R.styleable#LocationComponent_accuracyAlpha * * @return the opacity of the accuracy view - * @attr ref R.styleable#LocationComponent_accuracyAlpha */ public float accuracyAlpha() { return accuracyAlpha; @@ -346,9 +346,9 @@ public class LocationComponentOptions implements Parcelable { /** * Solid color to use as the accuracy view color property. + * References style attribute R.styleable#LocationComponent_accuracyColor * * @return the color of the accuracy view - * @attr ref R.styleable#LocationComponent_accuracyColor */ @ColorInt public int accuracyColor() { @@ -357,9 +357,9 @@ public class LocationComponentOptions implements Parcelable { /** * Defines the drawable used for the stale background icon. + * References style attribute R.styleable#LocationComponent_backgroundDrawableStale * * @return the drawable resource ID - * @attr ref R.styleable#LocationComponent_backgroundDrawableStale */ @DrawableRes public int backgroundDrawableStale() { @@ -384,9 +384,9 @@ public class LocationComponentOptions implements Parcelable { /** * Defines the drawable used for the stale foreground icon. + * References style attribute R.styleable#LocationComponent_foregroundDrawableStale * * @return the drawable resource ID - * @attr ref R.styleable#LocationComponent_foregroundDrawableStale */ @DrawableRes public int foregroundDrawableStale() { @@ -411,9 +411,9 @@ public class LocationComponentOptions implements Parcelable { /** * Defines the drawable used for the navigation state icon. + * References style attribute R.styleable#LocationComponent_gpsDrawable * * @return the drawable resource ID - * @attr ref R.styleable#LocationComponent_gpsDrawable */ @DrawableRes public int gpsDrawable() { @@ -438,9 +438,9 @@ public class LocationComponentOptions implements Parcelable { /** * Supply a Drawable that is to be rendered on top of all of the content in the Location LayerComponent layer stack. + * References style attribute R.styleable#LocationComponent_foregroundDrawable * * @return the drawable resource used for the foreground layer - * @attr ref R.styleable#LocationComponent_foregroundDrawable */ @DrawableRes public int foregroundDrawable() { @@ -465,9 +465,9 @@ public class LocationComponentOptions implements Parcelable { /** * Defines the drawable used for the background state icon. + * References style attribute R.styleable#LocationComponent_backgroundDrawable * * @return the drawable resource ID - * @attr ref R.styleable#LocationComponent_backgroundDrawable */ @DrawableRes public int backgroundDrawable() { @@ -492,9 +492,9 @@ public class LocationComponentOptions implements Parcelable { /** * Defines the drawable used for the bearing icon. + * References style attribute R.styleable#LocationComponent_bearingDrawable * * @return the drawable resource ID - * @attr ref R.styleable#LocationComponent_bearingDrawable */ @DrawableRes public int bearingDrawable() { @@ -519,9 +519,9 @@ public class LocationComponentOptions implements Parcelable { /** * Defines the bearing icon color as an integer. + * References style attribute R.styleable#LocationComponent_bearingTintColor * * @return the color integer resource - * @attr ref R.styleable#LocationComponent_bearingTintColor */ @ColorInt @Nullable @@ -531,9 +531,9 @@ public class LocationComponentOptions implements Parcelable { /** * Defines the foreground color as an integer. + * References style attribute R.styleable#LocationComponent_foregroundTintColor * * @return the color integer resource - * @attr ref R.styleable#LocationComponent_foregroundTintColor */ @ColorInt @Nullable @@ -543,9 +543,9 @@ public class LocationComponentOptions implements Parcelable { /** * Defines the background color as an integer. + * References style attribute R.styleable#LocationComponent_backgroundTintColor * * @return the color integer resource - * @attr ref R.styleable#LocationComponent_backgroundTintColor */ @ColorInt @Nullable @@ -555,9 +555,9 @@ public class LocationComponentOptions implements Parcelable { /** * Defines the foreground stale color as an integer. + * References style attribute R.styleable#LocationComponent_foregroundStaleTintColor * * @return the color integer resource - * @attr ref R.styleable#LocationComponent_foregroundStaleTintColor */ @ColorInt @Nullable @@ -567,9 +567,9 @@ public class LocationComponentOptions implements Parcelable { /** * Defines the background stale color as an integer. + * References style attribute R.styleable#LocationComponent_backgroundStaleTintColor * * @return the color integer resource - * @attr ref R.styleable#LocationComponent_backgroundStaleTintColor */ @ColorInt @Nullable @@ -580,9 +580,9 @@ public class LocationComponentOptions implements Parcelable { /** * Sets the base elevation of this view, in pixels. To turn off the shadow that appears under * the location icon, set the elevation to 0. + * References style attribute R.styleable#LocationComponent_elevation * * @return the elevation currently set for the location component icon - * @attr ref R.styleable#LocationComponent_elevation */ @Dimension public float elevation() { @@ -592,9 +592,9 @@ public class LocationComponentOptions implements Parcelable { /** * Enable or disable to stale state mode. This mode indicates to the user that the location being * displayed on the map hasn't been updated in a specific amount of time. + * References style attribute R.styleable#LocationComponent_enableStaleState * * @return whether the stale state mode is enabled or not - * @attr ref R.styleable#LocationComponent_enableStaleState */ public boolean enableStaleState() { return enableStaleState; @@ -604,10 +604,10 @@ public class LocationComponentOptions implements Parcelable { * Set the delay before the location icon becomes stale. The timer begins approximately when a new * location update comes in and using this defined time, if an update hasn't occured by the end, * the location is considered stale. + * References style attribute R.styleable#LocationComponent_staleStateDelay * * @return the duration in milliseconds which it should take before the location is * considered stale - * @attr ref R.styleable#LocationComponent_staleStateDelay */ public long staleStateTimeout() { return staleStateTimeout; @@ -1199,10 +1199,10 @@ public class LocationComponentOptions implements Parcelable { /** * Set the opacity of the accuracy view to a value from 0 to 1, where 0 means the accuracy view * is completely transparent and 1 means the view is completely opaque. + * References style attribute R.styleable#LocationComponent_accuracyAlpha * * @param accuracyAlpha the opacity of the accuracy view * @return this builder for chaining options together - * @attr ref R.styleable#LocationComponent_accuracyAlpha */ @NonNull public LocationComponentOptions.Builder accuracyAlpha(float accuracyAlpha) { @@ -1212,10 +1212,10 @@ public class LocationComponentOptions implements Parcelable { /** * Solid color to use as the accuracy view color property. + * References style attribute R.styleable#LocationComponent_accuracyColor * * @param accuracyColor the color of the accuracy view * @return this builder for chaining options together - * @attr ref R.styleable#LocationComponent_accuracyColor */ @NonNull public LocationComponentOptions.Builder accuracyColor(int accuracyColor) { @@ -1225,10 +1225,10 @@ public class LocationComponentOptions implements Parcelable { /** * Defines the drawable used for the stale background icon. + * References style attribute R.styleable#LocationComponent_backgroundDrawableStale * * @param backgroundDrawableStale the drawable resource ID * @return this builder for chaining options together - * @attr ref R.styleable#LocationComponent_backgroundDrawableStale */ @NonNull public LocationComponentOptions.Builder backgroundDrawableStale(int backgroundDrawableStale) { @@ -1256,10 +1256,10 @@ public class LocationComponentOptions implements Parcelable { /** * Defines the drawable used for the stale foreground icon. + * References style attribute R.styleable#LocationComponent_foregroundDrawableStale * * @param foregroundDrawableStale the drawable resource ID * @return this builder for chaining options together - * @attr ref R.styleable#LocationComponent_foregroundDrawableStale */ @NonNull public LocationComponentOptions.Builder foregroundDrawableStale(int foregroundDrawableStale) { @@ -1287,10 +1287,10 @@ public class LocationComponentOptions implements Parcelable { /** * Defines the drawable used for the navigation state icon. + * References style attribute R.styleable#LocationComponent_gpsDrawable * * @param gpsDrawable the drawable resource ID * @return this builder for chaining options together - * @attr ref R.styleable#LocationComponent_gpsDrawable */ @NonNull public LocationComponentOptions.Builder gpsDrawable(int gpsDrawable) { @@ -1318,10 +1318,10 @@ public class LocationComponentOptions implements Parcelable { /** * Supply a Drawable that is to be rendered on top of all of the content in the Location Component layer stack. + * References style attribute R.styleable#LocationComponent_foregroundDrawable * * @param foregroundDrawable the drawable resource used for the foreground layer * @return this builder for chaining options together - * @attr ref R.styleable#LocationComponent_foregroundDrawable */ @NonNull public LocationComponentOptions.Builder foregroundDrawable(int foregroundDrawable) { @@ -1349,10 +1349,10 @@ public class LocationComponentOptions implements Parcelable { /** * Defines the drawable used for the background state icon. + * References style attribute R.styleable#LocationComponent_backgroundDrawable * * @param backgroundDrawable the drawable resource ID * @return this builder for chaining options together - * @attr ref R.styleable#LocationComponent_backgroundDrawable */ @NonNull public LocationComponentOptions.Builder backgroundDrawable(int backgroundDrawable) { @@ -1380,10 +1380,10 @@ public class LocationComponentOptions implements Parcelable { /** * Defines the drawable used for the bearing icon. + * References style attribute R.styleable#LocationComponent_bearingDrawable * * @param bearingDrawable the drawable resource ID * @return this builder for chaining options together - * @attr ref R.styleable#LocationComponent_bearingDrawable */ @NonNull public LocationComponentOptions.Builder bearingDrawable(int bearingDrawable) { @@ -1411,10 +1411,10 @@ public class LocationComponentOptions implements Parcelable { /** * Defines the bearing icon color as an integer. + * References style attribute R.styleable#LocationComponent_bearingTintColor * * @param bearingTintColor the color integer resource * @return this builder for chaining options together - * @attr ref R.styleable#LocationComponent_bearingTintColor */ @NonNull public LocationComponentOptions.Builder bearingTintColor(@Nullable Integer bearingTintColor) { @@ -1424,10 +1424,10 @@ public class LocationComponentOptions implements Parcelable { /** * Defines the foreground color as an integer. + * References style attribute R.styleable#LocationComponent_foregroundTintColor * * @param foregroundTintColor the color integer resource * @return this builder for chaining options together - * @attr ref R.styleable#LocationComponent_foregroundTintColor */ @NonNull public LocationComponentOptions.Builder foregroundTintColor(@Nullable Integer foregroundTintColor) { @@ -1437,10 +1437,10 @@ public class LocationComponentOptions implements Parcelable { /** * Defines the background color as an integer. + * References style attribute R.styleable#LocationComponent_backgroundTintColor * * @param backgroundTintColor the color integer resource * @return this builder for chaining options together - * @attr ref R.styleable#LocationComponent_backgroundTintColor */ @NonNull public LocationComponentOptions.Builder backgroundTintColor(@Nullable Integer backgroundTintColor) { @@ -1450,10 +1450,10 @@ public class LocationComponentOptions implements Parcelable { /** * Defines the foreground stale color as an integer. + * References style attribute R.styleable#LocationComponent_foregroundStaleTintColor * * @param foregroundStaleTintColor the color integer resource * @return this builder for chaining options together - * @attr ref R.styleable#LocationComponent_foregroundStaleTintColor */ @NonNull public LocationComponentOptions.Builder foregroundStaleTintColor(@Nullable Integer foregroundStaleTintColor) { @@ -1463,10 +1463,10 @@ public class LocationComponentOptions implements Parcelable { /** * Defines the background stale color as an integer. + * References style attribute R.styleable#LocationComponent_backgroundStaleTintColor * * @param backgroundStaleTintColor the color integer resource * @return this builder for chaining options together - * @attr ref R.styleable#LocationComponent_backgroundStaleTintColor */ @NonNull public LocationComponentOptions.Builder backgroundStaleTintColor(@Nullable Integer backgroundStaleTintColor) { @@ -1476,10 +1476,10 @@ public class LocationComponentOptions implements Parcelable { /** * Sets the base elevation of this view, in pixels. + * References style attribute R.styleable#LocationComponent_elevation * * @param elevation the elevation currently set for the location icon * @return this builder for chaining options together - * @attr ref R.styleable#LocationComponent_elevation */ @NonNull public LocationComponentOptions.Builder elevation(float elevation) { @@ -1490,10 +1490,10 @@ public class LocationComponentOptions implements Parcelable { /** * Enable or disable to stale state mode. This mode indicates to the user that the location * being displayed on the map hasn't been updated in a specific amount of time. + * References style attribute R.styleable#LocationComponent_enableStaleState * * @param enabled whether the stale state mode is enabled or not * @return this builder for chaining options together - * @attr ref R.styleable#LocationComponent_enableStaleState */ @NonNull public LocationComponentOptions.Builder enableStaleState(boolean enabled) { @@ -1505,11 +1505,11 @@ public class LocationComponentOptions implements Parcelable { * Set the timeout before the location icon becomes stale. The timer begins approximately when a * new location update comes in and using this defined time, if an update hasn't occurred by the * end, the location is considered stale. + * References style attribute R.styleable#LocationComponent_staleStateTimeout * * @param timeout the duration in milliseconds which it should take before the location is * considered stale * @return this builder for chaining options together - * @attr ref R.styleable#LocationComponent_staleStateTimeout */ @NonNull public LocationComponentOptions.Builder staleStateTimeout(long timeout) { diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/Style.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/Style.java index 84efe6a4af..c8f7ee6978 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/Style.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/Style.java @@ -30,7 +30,7 @@ import java.util.Map; * The proxy object for current map style. *

* To create new instances of this object, create a new instance using a {@link Builder} and load the style with - * {@link MapboxMap#setStyle(Builder)}. This object is returned from {@link MapboxMap#getStyle()} once the style + * MapboxMap. This object is returned from {@link MapboxMap#getStyle()} once the style * has been loaded by underlying map. *

*/ @@ -628,7 +628,7 @@ public class Style { *

* This method is asynchronous and will return before the style finishes loading. * If you wish to wait for the map to finish loading, listen to the {@link MapView.OnDidFinishLoadingStyleListener} - * callback or use {@link MapboxMap#setStyle(String, OnStyleLoaded)} instead. + * callback or provide an {@link OnStyleLoaded} callback when setting the style on MapboxMap. *

* If the style fails to load or an invalid style URL is set, the map view will become blank. * An error message will be logged in the Android logcat and {@link MapView.OnDidFailLoadingMapListener} callback diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/module/loader/package-info.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/module/loader/package-info.java new file mode 100644 index 0000000000..e296baeffe --- /dev/null +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/module/loader/package-info.java @@ -0,0 +1,4 @@ +/** + * Contains the Mapbox Maps Android Modular Library Loader API classes. + */ +package com.mapbox.mapboxsdk.module.loader; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/Property.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/Property.java index 0a1d1cacbe..8ffcf6ddb8 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/Property.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/Property.java @@ -111,7 +111,7 @@ public final class Property { // SYMBOL_Z_ORDER: Controls the order in which overlapping symbols in the same layer are rendered /** - * If {@link SYMBOL_SORT_KEY} is set, sort based on that. Otherwise sort symbols by their y-position relative to the viewport. + * If symbol sort key is set, sort based on that. Otherwise sort symbols by their y-position relative to the viewport. */ public static final String SYMBOL_Z_ORDER_AUTO = "auto"; /** diff --git a/platform/android/gradle/gradle-javadoc.gradle b/platform/android/gradle/gradle-javadoc.gradle index 410fba1dba..3a634433b5 100644 --- a/platform/android/gradle/gradle-javadoc.gradle +++ b/platform/android/gradle/gradle-javadoc.gradle @@ -2,17 +2,18 @@ android.libraryVariants.all { variant -> def name = variant.name task "javadoc$name"(type: Javadoc) { description = "Generates javadoc for build $name" - failOnError = false destinationDir = new File(destinationDir, variant.baseName) source = variant.sourceSets.collect { it.java.sourceFiles }.inject { m, i -> m + i } + classpath += variant.javaCompile.classpath + classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) options.windowTitle("Mapbox Maps SDK for Android $VERSION_NAME Reference") options.docTitle("Mapbox Maps SDK for Android $VERSION_NAME") options.header("Mapbox Maps SDK for Android $VERSION_NAME Reference") options.bottom("© 2015–2019 Mapbox. All rights reserved.") options.links("http://docs.oracle.com/javase/7/docs/api/") - options.linksOffline("http://d.android.com/reference/", "$System.env.ANDROID_HOME/docs/reference") + options.linksOffline "http://d.android.com/reference","${android.sdkDirectory}/docs/reference" options.overview("src/main/java/overview.html") options.group("Mapbox Android SDK", "com.mapbox.*") - exclude '**/R.java', '**/BuildConfig.java' + exclude '**/R.java', '**/BuildConfig.java', '**/**.java.ejs', '**/**.html' } -} +} \ No newline at end of file diff --git a/platform/android/scripts/generate-style-code.js b/platform/android/scripts/generate-style-code.js index 98a18120fc..d7ab7e8827 100755 --- a/platform/android/scripts/generate-style-code.js +++ b/platform/android/scripts/generate-style-code.js @@ -276,6 +276,10 @@ global.propertyValueDoc = function (property, value) { return '{@link Property#' + `${propertyValue}` + '}'; } else if (str.substr(offset - 4, 3) !== 'CSS' && symbol[0].toUpperCase() != symbol[0]) { // Property 'enums' + if (symbol === 'symbol-sort-key') { + return 'symbol sort key'; + } + symbol = snakeCaseUpper(symbol); return '{@link ' + symbol + '}'; } else { -- cgit v1.2.1