public abstract class FileDownloadNotificationListener extends FileDownloadListener
| Constructor and Description |
|---|
FileDownloadNotificationListener(FileDownloadNotificationHelper helper) |
| Modifier and Type | Method and Description |
|---|---|
void |
addNotificationItem(BaseDownloadTask task) |
void |
addNotificationItem(int downloadId) |
protected void |
blockComplete(BaseDownloadTask task) |
protected void |
completed(BaseDownloadTask task) |
protected abstract BaseNotificationItem |
create(BaseDownloadTask task) |
void |
destroyNotification(BaseDownloadTask task)
The notification item with the
task is told to destroy. |
protected boolean |
disableNotification(BaseDownloadTask task) |
protected void |
error(BaseDownloadTask task,
java.lang.Throwable e) |
FileDownloadNotificationHelper |
getHelper() |
protected boolean |
interceptCancel(BaseDownloadTask task,
BaseNotificationItem notificationItem) |
protected void |
paused(BaseDownloadTask task,
int soFarBytes,
int totalBytes) |
protected void |
pending(BaseDownloadTask task,
int soFarBytes,
int totalBytes) |
protected void |
progress(BaseDownloadTask task,
int soFarBytes,
int totalBytes) |
protected void |
retry(BaseDownloadTask task,
java.lang.Throwable ex,
int retryingTimes,
int soFarBytes) |
void |
showIndeterminate(BaseDownloadTask task) |
void |
showProgress(BaseDownloadTask task,
int soFarBytes,
int totalBytes) |
protected void |
started(BaseDownloadTask task) |
protected void |
warn(BaseDownloadTask task) |
connected, isInvalidpublic FileDownloadNotificationListener(FileDownloadNotificationHelper helper)
public FileDownloadNotificationHelper getHelper()
public void addNotificationItem(int downloadId)
public void addNotificationItem(BaseDownloadTask task)
public void destroyNotification(BaseDownloadTask task)
task is told to destroy.task - The task used to identify the will be destroyed notification item.public void showIndeterminate(BaseDownloadTask task)
public void showProgress(BaseDownloadTask task, int soFarBytes, int totalBytes)
protected abstract BaseNotificationItem create(BaseDownloadTask task)
task - The task used to bind with the will be created notification item.task.protected boolean interceptCancel(BaseDownloadTask task, BaseNotificationItem notificationItem)
task - The task.notificationItem - The notification item.true if you want to survive the notification item, and we will don't cancel
the relate notification from the notification panel when the relate task is finished,
false otherwise.
Default: false
destroyNotification(BaseDownloadTask)protected boolean disableNotification(BaseDownloadTask task)
task - The task.true if you want to disable the internal notification lifecycle, and in this
case all method about the notification will be invalid, false otherwise.
Default: false
protected void pending(BaseDownloadTask task, int soFarBytes, int totalBytes)
pending in class FileDownloadListenerprotected void started(BaseDownloadTask task)
started in class FileDownloadListenerprotected void progress(BaseDownloadTask task, int soFarBytes, int totalBytes)
progress in class FileDownloadListenerprotected void retry(BaseDownloadTask task, java.lang.Throwable ex, int retryingTimes, int soFarBytes)
retry in class FileDownloadListenerprotected void blockComplete(BaseDownloadTask task)
blockComplete in class FileDownloadListenerprotected void completed(BaseDownloadTask task)
completed in class FileDownloadListenerprotected void paused(BaseDownloadTask task, int soFarBytes, int totalBytes)
paused in class FileDownloadListenerprotected void error(BaseDownloadTask task, java.lang.Throwable e)
error in class FileDownloadListenerprotected void warn(BaseDownloadTask task)
warn in class FileDownloadListener