Java Code Examples for com.liulishuo.filedownloader.BaseDownloadTask#getId()

The following examples show how to use com.liulishuo.filedownloader.BaseDownloadTask#getId() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: NotificationSampleActivity.java    From FileDownloader with Apache License 2.0 5 votes vote down vote up
@Override
protected BaseNotificationItem create(BaseDownloadTask task) {
    return new NotificationItem(
            task.getId(),
            "Task-" + task.getId(),
            "",
            channelId
    );
}
 
Example 2
Source File: TasksManagerDemoActivity.java    From FileDownloader with Apache License 2.0 5 votes vote down vote up
private TaskItemViewHolder checkCurrentHolder(final BaseDownloadTask task) {
    final TaskItemViewHolder tag = (TaskItemViewHolder) task.getTag();
    if (tag.id != task.getId()) {
        return null;
    }

    return tag;
}
 
Example 3
Source File: MessageSnapshotTaker.java    From FileDownloader with Apache License 2.0 5 votes vote down vote up
public static MessageSnapshot catchPause(BaseDownloadTask task) {
    if (task.isLargeFile()) {
        return new LargeMessageSnapshot.PausedSnapshot(task.getId(),
                task.getLargeFileSoFarBytes(), task.getLargeFileTotalBytes());
    } else {
        return new SmallMessageSnapshot.PausedSnapshot(task.getId(),
                task.getSmallFileSoFarBytes(), task.getSmallFileTotalBytes());
    }
}