diff options
author | tobrun <tobrun.van.nuland@gmail.com> | 2019-04-24 14:34:44 +0200 |
---|---|---|
committer | Tobrun <tobrun.van.nuland@gmail.com> | 2019-04-26 16:08:55 +0200 |
commit | 7854f0fc96dc68e49befdfebeceba7f5312e16ff (patch) | |
tree | 79394c79f68ff166680e732f29d0ddb608747037 | |
parent | 70abecdde8fffd5d3b167fcb993eaa8cb01ffc06 (diff) | |
download | qtlocation-mapboxgl-7854f0fc96dc68e49befdfebeceba7f5312e16ff.tar.gz |
[android] - use same isComplete logic as core
-rw-r--r-- | platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/offline/OfflineRegionStatus.java | 16 |
1 files changed, 8 insertions, 8 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 1fd60de79d..eff132a1a3 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 @@ -14,37 +14,37 @@ import android.support.annotation.Keep; public class OfflineRegionStatus { @OfflineRegion.DownloadState - private int downloadState = OfflineRegion.STATE_INACTIVE; + private int downloadState; /** * The number of resources (inclusive of tiles) that have been fully downloaded * and are ready for offline access. */ - private long completedResourceCount = 0; + private final long completedResourceCount; /** * The cumulative size, in bytes, of all resources (inclusive of tiles) that have * been fully downloaded. */ - private long completedResourceSize = 0; + private final long completedResourceSize; /** * The number of tiles that have been fully downloaded and are ready for * offline access. */ - private long completedTileCount = 0; + private final long completedTileCount; /** * The cumulative size, in bytes, of all tiles that have been fully downloaded. */ - private long completedTileSize = 0; + private final long completedTileSize; /** * 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. */ - private long requiredResourceCount = 0; + private final long requiredResourceCount; /** * This property is true when the value of requiredResourceCount is a precise @@ -56,7 +56,7 @@ public class OfflineRegionStatus { * precise number of required resources, at which point it is set to true. * </p> */ - private boolean requiredResourceCountIsPrecise = true; + private final boolean requiredResourceCountIsPrecise; /* * Use setObserver(OfflineRegionObserver observer) to obtain a OfflineRegionStatus object. @@ -83,7 +83,7 @@ public class OfflineRegionStatus { * @return true if download is complete, false if not */ public boolean isComplete() { - return (completedResourceCount == requiredResourceCount) && downloadState == OfflineRegion.STATE_INACTIVE; + return completedResourceCount >= requiredResourceCount; } /** |