From 43fde8e7b0feb71b31181fca78199b6770808931 Mon Sep 17 00:00:00 2001 From: Alexey Kulish Date: Thu, 5 Nov 2015 21:35:32 +0300 Subject: [PATCH] Fixes --- .../osmand/plus/download/DownloadIndexesThread.java | 5 ++++- .../controllers/MapDataMenuController.java | 10 ++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/download/DownloadIndexesThread.java b/OsmAnd/src/net/osmand/plus/download/DownloadIndexesThread.java index 1615fc057e..f603283be2 100644 --- a/OsmAnd/src/net/osmand/plus/download/DownloadIndexesThread.java +++ b/OsmAnd/src/net/osmand/plus/download/DownloadIndexesThread.java @@ -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(); } } diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/MapDataMenuController.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/MapDataMenuController.java index 4598217e9e..7d360daab8 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/MapDataMenuController.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/MapDataMenuController.java @@ -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) {