Downloader.ProgressListener


interface Downloader.ProgressListener


Receives progress updates during download operations.

Summary

Public functions

Unit
onProgress(
    contentLength: Long,
    bytesDownloaded: Long,
    percentDownloaded: Float
)

Called when progress is made during a download operation.

Public functions

onProgress

fun onProgress(
    contentLength: Long,
    bytesDownloaded: Long,
    percentDownloaded: Float
): Unit

Called when progress is made during a download operation.

May be called directly from download, or from any other thread used by the downloader. In all cases, download is guaranteed not to return until after the last call to this method has finished executing.

Parameters
contentLength: Long

The length of the content in bytes, or LENGTH_UNSET if unknown.

bytesDownloaded: Long

The number of bytes that have been downloaded.

percentDownloaded: Float

The percentage of the content that has been downloaded, or PERCENTAGE_UNSET.