Merge remote-tracking branch 'origin/master'

This commit is contained in:
Weblate 2015-11-05 19:35:51 +01:00
commit a9b3a1c222
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) {