This commit is contained in:
Alexey Kulish 2015-11-05 21:35:32 +03:00
parent 483cac58f0
commit 43fde8e7b0
2 changed files with 12 additions and 3 deletions

View file

@ -219,14 +219,17 @@ public class DownloadIndexesThread {
}
if (currentDownloadingItem == null) {
execute(new DownloadIndexesAsyncTask());
} else {
downloadInProgress();
}
}
public void cancelDownload(IndexItem item) {
if(currentDownloadingItem == item) {
downloadFileHelper.setInterruptDownloading(true);;
downloadFileHelper.setInterruptDownloading(true);
} else {
indexItemDownloading.remove(item);
downloadInProgress();
}
}

View file

@ -169,13 +169,19 @@ public class MapDataMenuController extends MenuController {
rightTitleButtonController.visible = indexItem != null && indexItem.isDownloaded();
boolean hasIndexes = downloadThread.getIndexes().isDownloadedFromInternet;
boolean isDownloading = indexItem != null && downloadThread.getCurrentDownloadingItem() == indexItem;
boolean isDownloading = indexItem != null && downloadThread.isDownloading(indexItem);
if (!hasIndexes) {
titleProgressController.setIndexesDownloadMode();
titleProgressController.visible = true;
} else if (isDownloading) {
titleProgressController.setMapDownloadMode();
titleProgressController.progress = downloadThread.getCurrentDownloadingItemProgress();
if (downloadThread.getCurrentDownloadingItem() == indexItem) {
titleProgressController.indeterminate = false;
titleProgressController.progress = downloadThread.getCurrentDownloadingItemProgress();
} else {
titleProgressController.indeterminate = true;
titleProgressController.progress = 0;
}
double mb = indexItem.getArchiveSizeMB();
String v ;
if (titleProgressController.progress != -1) {