diff options
author | Tobrun <tobrun.van.nuland@gmail.com> | 2017-07-05 08:37:27 +0200 |
---|---|---|
committer | Tobrun <tobrun.van.nuland@gmail.com> | 2017-07-05 08:37:27 +0200 |
commit | 14c221fce77ce5041e16db8a40081cbcc54a1902 (patch) | |
tree | e887d5d690893f7fcb5001a926e6f41a9fb06c41 /platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/offline/OfflineRegionStatus.java | |
parent | 60eae41549cec18dfeed5175fe1d6c327060a8de (diff) | |
parent | d2d8a575be2d4f28894c0c1f845cbb464869d97c (diff) | |
download | qtlocation-mapboxgl-14c221fce77ce5041e16db8a40081cbcc54a1902.tar.gz |
Merge branch 'release-ios-v3.6.0-android-v5.1.0'
# Conflicts:
# .travis.yml
# circle.yml
# cmake/core-files.cmake
# include/mbgl/style/function/composite_function.hpp
# platform/android/CHANGELOG.md
# platform/android/MapboxGLAndroidSDK/build.gradle
# platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/Mapbox.java
# platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/constants/MyBearingTracking.java
# platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/constants/MyLocationTracking.java
# platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LocationSource.java
# platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/CameraChangeDispatcher.java
# platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapGestureDetector.java
# platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapView.java
# platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMap.java
# platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/TrackingSettings.java
# platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/Transform.java
# platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/widgets/MyLocationView.java
# platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/light/Light.java
# platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/light/Position.java
# platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/light/light.java.ejs
# platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/utils/BitmapUtils.java
# platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/testapp/style/LightTest.java
# platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/testapp/style/light.junit.ejs
# platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/camera/CameraPositionActivity.java
# platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/userlocation/MockLocationEngine.java
# platform/android/dependencies.gradle
# platform/android/src/native_map_view.cpp
# platform/darwin/scripts/generate-style-code.js
# platform/darwin/src/MGLGeometry_Private.h
# platform/darwin/src/MGLLight.h
# platform/darwin/src/MGLLight.mm
# platform/darwin/src/MGLSource.h
# platform/darwin/src/MGLStyle.h
# platform/darwin/src/MGLStyle.mm
# platform/darwin/test/MGLLightTest.mm
# platform/default/default_file_source.cpp
# platform/ios/CHANGELOG.md
# platform/ios/Mapbox-iOS-SDK-symbols.podspec
# platform/ios/Mapbox-iOS-SDK.podspec
# platform/ios/resources/Images.xcassets/default_marker.imageset/default_marker.pdf
# platform/macos/CHANGELOG.md
# scripts/generate-shaders.js
# src/mbgl/layout/symbol_layout.cpp
# src/mbgl/programs/program.hpp
# src/mbgl/programs/symbol_program.hpp
# src/mbgl/programs/uniforms.hpp
# src/mbgl/renderer/frame_history.cpp
# src/mbgl/renderer/paint_property_binder.hpp
# src/mbgl/shaders/line.cpp
# src/mbgl/shaders/line_pattern.cpp
# src/mbgl/shaders/line_sdf.cpp
# src/mbgl/sprite/sprite_atlas.hpp
# src/mbgl/style/layers/line_layer_properties.hpp
# src/mbgl/style/sources/geojson_source.cpp
# src/mbgl/style/style.cpp
# src/mbgl/text/glyph_atlas.hpp
# src/mbgl/tile/geometry_tile.cpp
# src/mbgl/tile/geometry_tile.hpp
# test/style/style.test.cpp
Diffstat (limited to 'platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/offline/OfflineRegionStatus.java')
-rw-r--r-- | platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/offline/OfflineRegionStatus.java | 60 |
1 files changed, 59 insertions, 1 deletions
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/offline/OfflineRegionStatus.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/offline/OfflineRegionStatus.java index 9c3655fbec..fe12dd46c4 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/offline/OfflineRegionStatus.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/offline/OfflineRegionStatus.java @@ -7,6 +7,7 @@ package com.mapbox.mapboxsdk.offline; * <p> * Note that the total required size in bytes is not currently available. A * future API release may provide an estimate of this number. + * </p> */ public class OfflineRegionStatus { @@ -51,6 +52,7 @@ public class OfflineRegionStatus { * Specifically, it is false during early phases of an offline download. Once * style and tile sources have been downloaded, it is possible to calculate the * precise number of required resources, at which point it is set to true. + * </p> */ private boolean requiredResourceCountIsPrecise = true; @@ -73,37 +75,93 @@ public class OfflineRegionStatus { } /** - * Is the region complete? + * Validates if the region download has completed + * + * @return true if download is complete, false if not */ public boolean isComplete() { return (completedResourceCount == requiredResourceCount); } + /** + * Returns the download state. + * <p> + * State is defined as + * </p> + * <ul> + * <li>{@link OfflineRegion#STATE_ACTIVE}</li> + * <li>{@link OfflineRegion#STATE_INACTIVE}</li> + * </ul> + * + * @return the download state. + */ @OfflineRegion.DownloadState public int getDownloadState() { return downloadState; } + /** + * Get the number of resources (inclusive of tiles) that have been fully downloaded + * and are ready for offline access. + * + * @return the amount of resources that have finished downloading. + */ public long getCompletedResourceCount() { return completedResourceCount; } + /** + * The cumulative size, in bytes, of all resources (inclusive of tiles) that have + * been fully downloaded. + * + * @return the size of the resources that have finished downloading + */ public long getCompletedResourceSize() { return completedResourceSize; } + /** + * Get the number of tiles that have been fully downloaded and are ready for + * offline access. + * + * @return the completed tile count + */ public long getCompletedTileCount() { return completedTileCount; } + /** + * Get the cumulative size, in bytes, of all tiles that have been fully downloaded. + * + * @return the completed tile size + */ public long getCompletedTileSize() { return completedTileSize; } + /** + * Get the number of resources that are known to be required for this region. See the + * documentation for `requiredResourceCountIsPrecise` for an important caveat + * about this number. + * + * @return the amount of resources that are required + */ public long getRequiredResourceCount() { return requiredResourceCount; } + /** + * Returns when the value of requiredResourceCount is a precise + * count of the number of required resources, and false when it is merely a lower + * bound. + * <p> + * Specifically, it is false during early phases of an offline download. Once + * style and tile sources have been downloaded, it is possible to calculate the + * precise number of required resources, at which point it is set to true. + * </p> + * + * @return True if the required resource count is precise, false if not + */ public boolean isRequiredResourceCountPrecise() { return requiredResourceCountIsPrecise; } |