DownloadQueueManager

Properties

Link copied to clipboard
Link copied to clipboard
const val QUEUE_KEY: String

Functions

Link copied to clipboard

Add a new object to the queue. Will not queue completed downloads or current downloads.

Link copied to clipboard

Cancels an active download or removes it from queue depending on where it is.

Link copied to clipboard

Refreshes the queue flow with the same value, but copied. Good to run if the downloads are affected by some outside value change.

Link copied to clipboard
fun init(context: Context)

Start the queue, marks all queue objects as in progress. Note that this may run twice without the service restarting because MainActivity may be recreated.

Link copied to clipboard

Start a real download from the first item in the queue

Link copied to clipboard

Removes all queued items

Link copied to clipboard

Removes all objects with the same id from the internal persistent queue

Link copied to clipboard
fun reorderItem(downloadQueueWrapper: DownloadObjects.DownloadQueueWrapper, newPosition: Int)

Will move the download queue wrapper to a new position in the queue. If the item does not exist it will also insert it.