From e7c41bb7ca035c922cf5bab372350320468b5d45 Mon Sep 17 00:00:00 2001 From: Antonio Zugaldia Date: Tue, 15 Mar 2016 10:48:28 -0400 Subject: [PATCH] [android] Add Javadoc for offline package Fixes #4295 --- .../mapboxsdk/offline/OfflineManager.java | 31 ++++++++++++++-- .../mapboxsdk/offline/OfflineRegion.java | 35 ++++++++++++++++--- 2 files changed, 58 insertions(+), 8 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 e632bcd76..726cac63b 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 @@ -32,17 +32,42 @@ public class OfflineManager { // This object is implemented as a singleton private static OfflineManager instance; - /* - * Callbacks + /** + * This callback receives an asynchronous response containing a list of all + * {@link OfflineRegion} in the database, or an error message otherwise. */ - public interface ListOfflineRegionsCallback { + /** + * Receives the list of offline regions + * + * @param offlineRegions + */ void onList(OfflineRegion[] offlineRegions); + + /** + * Receives the error message + * + * @param error + */ void onError(String error); } + /** + * This callback receives an asynchronous response containing the newly created + * {@link OfflineRegion} in the database, or an error message otherwise. + */ public interface CreateOfflineRegionCallback { + /** + * Receives the newly created offline region + * @param offlineRegion + */ void onCreate(OfflineRegion offlineRegion); + + /** + * Receives the error message + * + * @param error + */ void onError(String error); } 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 f47b41e24..0f192cde4 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 @@ -10,8 +10,9 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; /** - * To use offline maps on mobile, you will first have to create an offline region. - * Use OfflineManager.createOfflineRegion() to create a new offline region. + * An offline region is the basic building block for offline mobile maps. + * Use {@link com.mapbox.mapboxsdk.offline.OfflineManager.CreateOfflineRegionCallback} + * to create a new offline region. */ public class OfflineRegion { @@ -76,17 +77,41 @@ public class OfflineRegion { void mapboxTileCountLimitExceeded(long limit); } - /* - * Callbacks + /** + * This callback receives an asynchronous response containing the {@link OfflineRegionStatus} + * of the offline region, or a {@link String} error message otherwise. */ - public interface OfflineRegionStatusCallback { + /** + * Receives the status + * + * @param status + */ void onStatus(OfflineRegionStatus status); + + /** + * Receives the error message + * + * @param error + */ void onError(String error); } + /** + * This callback receives an asynchronous response containing a notification when + * an offline region has been deleted, or a {@link String} error message otherwise. + */ public interface OfflineRegionDeleteCallback { + /** + * Receives the delete notification + */ void onDelete(); + + /** + * Receives the error message + * + * @param error + */ void onError(String error); }