diff options
author | Tobrun <tobrun.van.nuland@gmail.com> | 2016-08-08 21:51:52 -0400 |
---|---|---|
committer | Tobrun <tobrun.van.nuland@gmail.com> | 2016-08-08 21:51:52 -0400 |
commit | 63efa9bf7d7df678b6061eea722ead20f8328b02 (patch) | |
tree | c2b74c7bc261dde32c07ba1aab3d37e5ccfea69b /platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/offline | |
parent | 82f19b94f7697d18adf6f9d0eb3b5b3d3b67e4a4 (diff) | |
download | qtlocation-mapboxgl-63efa9bf7d7df678b6061eea722ead20f8328b02.tar.gz |
[android] #5880 - javadoc cleanup part one
Diffstat (limited to 'platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/offline')
2 files changed, 50 insertions, 19 deletions
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 7b41184a5a..80d5ff7db0 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 @@ -55,16 +55,16 @@ public class OfflineManager { */ public interface ListOfflineRegionsCallback { /** - * Receives the list of offline regions + * Receives the list of offline regions. * - * @param offlineRegions + * @param offlineRegions the offline region array */ void onList(OfflineRegion[] offlineRegions); /** - * Receives the error message + * Receives the error message. * - * @param error + * @param error the error message */ void onError(String error); } @@ -75,16 +75,16 @@ public class OfflineManager { */ public interface CreateOfflineRegionCallback { /** - * Receives the newly created offline region + * Receives the newly created offline region. * - * @param offlineRegion + * @param offlineRegion the offline region to create */ void onCreate(OfflineRegion offlineRegion); /** - * Receives the error message + * Receives the error message. * - * @param error + * @param error the error message to be shown */ void onError(String error); } @@ -149,6 +149,8 @@ public class OfflineManager { * <p> * Code from https://developer.android.com/guide/topics/data/data-storage.html#filesExternal * </p> + * + * @return true if external storage is readable */ public static boolean isExternalStorageReadable() { String state = Environment.getExternalStorageState(); @@ -193,7 +195,7 @@ public class OfflineManager { /** * Access token getter/setter * - * @param accessToken + * @param accessToken the accessToken to be used by the offline manager. * @deprecated As of release 4.1.0, replaced by {@link MapboxAccountManager#start(Context, String)} ()} */ @Deprecated @@ -226,6 +228,8 @@ public class OfflineManager { * The query will be executed asynchronously and the results passed to the given * callback on the main thread. * </p> + * + * @param callback the callback to be invoked */ public void listOfflineRegions(@NonNull final ListOfflineRegionsCallback callback) { listOfflineRegions(mDefaultFileSourcePtr, new ListOfflineRegionsCallback() { @@ -262,6 +266,10 @@ public class OfflineManager { * downloading resources, call `OfflineRegion.setDownloadState(DownloadState.STATE_ACTIVE)`, * optionally registering an `OfflineRegionObserver` beforehand. * </p> + * + * @param definition the offline region definition + * @param metadata the metadata in bytes + * @param callback the callback to be invoked */ public void createOfflineRegion( @NonNull OfflineRegionDefinition definition, diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/offline/OfflineRegion.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/offline/OfflineRegion.java index 3756c93df2..22cb034f08 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/offline/OfflineRegion.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/offline/OfflineRegion.java @@ -55,8 +55,11 @@ public class OfflineRegion { * Implement this method to be notified of a change in the status of an * offline region. Status changes include any change in state of the members * of OfflineRegionStatus. - * + * <p> * This method will be executed on the main thread. + * </p> + * + * @param status the changed status */ void onStatusChanged(OfflineRegionStatus status); @@ -65,8 +68,11 @@ public class OfflineRegion { * regional resources. Such errors may be recoverable; for example the implementation * will attempt to re-request failed resources based on an exponential backoff * algorithm, or when it detects that network access has been restored. - * + * <p> * This method will be executed on the main thread. + * </p> + * + * @param error the offline region error message */ void onError(OfflineRegionError error); @@ -93,14 +99,14 @@ public class OfflineRegion { /** * Receives the status * - * @param status + * @param status the offline region status */ void onStatus(OfflineRegionStatus status); /** * Receives the error message * - * @param error + * @param error the error message */ void onError(String error); } @@ -118,7 +124,7 @@ public class OfflineRegion { /** * Receives the error message * - * @param error + * @param error the error message */ void onError(String error); } @@ -127,15 +133,17 @@ public class OfflineRegion { * A region is either inactive (not downloading, but previously-downloaded * resources are available for use), or active (resources are being downloaded * or will be downloaded, if necessary, when network access is available). - * + * <p> * This state is independent of whether or not the complete set of resources * is currently available for offline use. To check if that is the case, use * `OfflineRegionStatus.isComplete()`. + * </p> */ @IntDef({STATE_INACTIVE, STATE_ACTIVE}) @Retention(RetentionPolicy.SOURCE) - public @interface DownloadState {} + public @interface DownloadState { + } public static final int STATE_INACTIVE = 0; public static final int STATE_ACTIVE = 1; @@ -148,6 +156,8 @@ public class OfflineRegion { /** * Gets whether or not the `OfflineRegionObserver` will continue to deliver messages even if * the region state has been set as STATE_INACTIVE. + * + * @return true if delivering inactive messages */ public boolean isDeliveringInactiveMessages() { return deliverInactiveMessages; @@ -157,6 +167,8 @@ public class OfflineRegion { * When set true, the `OfflineRegionObserver` will continue to deliver messages even if * the region state has been set as STATE_INACTIVE (operations happen asynchronously). If set * false, the client won't be notified of further messages. + * + * @param deliverInactiveMessages true if it should deliver inactive messages */ public void setDeliverInactiveMessages(boolean deliverInactiveMessages) { this.deliverInactiveMessages = deliverInactiveMessages; @@ -203,6 +215,8 @@ public class OfflineRegion { /** * Register an observer to be notified when the state of the region changes. + * + * @param observer the observer to be notified */ public void setObserver(@NonNull final OfflineRegionObserver observer) { setOfflineRegionObserver(new OfflineRegionObserver() { @@ -246,6 +260,8 @@ public class OfflineRegion { /** * Pause or resume downloading of regional resources. + * + * @param state the download state */ public void setDownloadState(@DownloadState int state) { this.state = state; @@ -256,6 +272,8 @@ public class OfflineRegion { * Retrieve the current status of the region. The query will be executed * asynchronously and the results passed to the given callback which will be * executed on the main thread. + * + * @param callback the callback to invoked. */ public void getStatus(@NonNull final OfflineRegionStatusCallback callback) { getOfflineRegionStatus(new OfflineRegionStatusCallback() { @@ -284,14 +302,19 @@ public class OfflineRegion { /** * Remove an offline region from the database and perform any resources evictions * necessary as a result. - * + * <p> * Eviction works by removing the least-recently requested resources not also required * by other regions, until the database shrinks below a certain size. - * + * </p> + * <p> * When the operation is complete or encounters an error, the given callback will be * executed on the main thread. - * + * </p> + * <p> * After you call this method, you may not call any additional methods on this object. + * </p> + * + * @param callback the callback to be invoked */ public void delete(@NonNull final OfflineRegionDeleteCallback callback) { deleteOfflineRegion(new OfflineRegionDeleteCallback() { |