-
public interface DownloadCallbackThis is a callback to be invoked when downloading.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classDownloadCallback.Companion
-
Method Summary
Modifier and Type Method Description UnitonStart(Integer downloadId, Long totalBytes)Invoked when downloading is started. UnitonRetry(Integer downloadId)Invoked when download retrying. UnitonProgress(Integer downloadId, Long bytesWritten, Long totalBytes)Invoked when downloading is in progress. UnitonSuccess(Integer downloadId, String filepath)Invoked when downloading successfully. UnitonFailure(Integer downloadId, Integer statusCode, String errMsg)Invoked when downloading failed. -
-
Method Detail
-
onStart
@MainThread() Unit onStart(Integer downloadId, Long totalBytes)
Invoked when downloading is started.
- Parameters:
downloadId- download id in download request queuetotalBytes- total bytes of the file
-
onRetry
@MainThread() Unit onRetry(Integer downloadId)
Invoked when download retrying.
- Parameters:
downloadId- download id in download request queue
-
onProgress
@MainThread() Unit onProgress(Integer downloadId, Long bytesWritten, Long totalBytes)
Invoked when downloading is in progress.
- Parameters:
downloadId- download id in download request queuebytesWritten- the bytes has written to local disktotalBytes- total bytes of the file
-
onSuccess
@MainThread() Unit onSuccess(Integer downloadId, String filepath)
Invoked when downloading successfully.
- Parameters:
downloadId- download id in download request queuefilepath- the filepath of downloaded file
-
-
-
-