Add method to cancel downloading of multiple items
This commit is contained in:
parent
178690a9e4
commit
0f3376a427
1 changed files with 16 additions and 0 deletions
|
@ -283,6 +283,22 @@ public class DownloadIndexesThread {
|
|||
}
|
||||
}
|
||||
|
||||
public void cancelDownload(List<IndexItem> items) {
|
||||
if (items != null) {
|
||||
boolean updateProgress = false;
|
||||
for (IndexItem item : items) {
|
||||
if (currentDownloadingItem == item) {
|
||||
downloadFileHelper.setInterruptDownloading(true);
|
||||
} else {
|
||||
indexItemDownloading.remove(item);
|
||||
updateProgress = true;
|
||||
}
|
||||
}
|
||||
if (updateProgress) {
|
||||
downloadInProgress();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public IndexItem getCurrentDownloadingItem() {
|
||||
return currentDownloadingItem;
|
||||
|
|
Loading…
Reference in a new issue