mapbox-plugin-offline

//mapboxpluginoffline/io.github.xit0c.mapboxpluginoffline.model/OfflineDownload

OfflineDownload

[androidJvm]
class OfflineDownload(regionId: Long, options: OfflineDownloadOptions, completedResourceCount: Long, requiredResourceCount: Long, completedResourceSize: Long, isActive: Boolean) : Parcelable

This model represents the download managed by the OfflineService.

It holds the options with which the download has been started, the id (regionId) of the region generated by Mapbox with OfflineManager.createOfflineRegion() and some of the OfflineRegionStatus data returned by the OfflineRegionObserver attached to the region in order to monitor its download state.

Constructors

   
OfflineDownload [androidJvm]
fun OfflineDownload(regionId: Long, options: OfflineDownloadOptions)
Creates a OfflineDownload with the given values and no status data.
OfflineDownload [androidJvm]
fun OfflineDownload(regionId: Long, options: OfflineDownloadOptions, completedResourceCount: Long, requiredResourceCount: Long, completedResourceSize: Long, isActive: Boolean)
Creates a OfflineDownload with the given values.

Functions

Name Summary
getCompletedResourceCount [androidJvm]
fun getCompletedResourceCount(): Long
As in OfflineRegionStatus, returns the number of resources that have been fully download.
getCompletedResourceSize [androidJvm]
fun getCompletedResourceSize(): Long
As in OfflineRegionStatus, returns the cumulative size, in bytes, of all resources that have been fully downloaded.
getPercentage [androidJvm]
fun getPercentage(): Int
Returns the download’s resources completion percentage.
getRequiredResourceCount [androidJvm]
fun getRequiredResourceCount(): Long
As in OfflineRegionStatus, returns the number of resources that are known to be required.
isActive [androidJvm]
fun isActive(): Boolean
Validates if OfflineRegionStatus.getDownloadState() equals OfflineRegion.STATE_ACTIVE.
isComplete [androidJvm]
fun isComplete(): Boolean
As in OfflineRegionStatus, validates if the region download has completed.
toString [androidJvm]
open override fun toString(): String
Returns a String representation of this object.

Properties

Name Summary
options [androidJvm]
val options: OfflineDownloadOptions
Options used to start the download.
regionId [androidJvm]
val regionId: Long
OfflineRegion id.