[android] Add Javadoc for offline package

Fixes #4295
This commit is contained in:
Antonio Zugaldia
2016-03-15 10:48:28 -04:00
parent b8aeb1a9f8
commit e7c41bb7ca
2 changed files with 58 additions and 8 deletions

View File

@@ -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);
}

View File

@@ -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);
}