Fixes
This commit is contained in:
parent
815fdc2df5
commit
c329e2bedf
4 changed files with 11 additions and 7 deletions
|
@ -299,6 +299,7 @@ public class DownloadIndexesThread {
|
||||||
currentRunningTask.add(this);
|
currentRunningTask.add(this);
|
||||||
super.onPreExecute();
|
super.onPreExecute();
|
||||||
this.message = ctx.getString(R.string.downloading_list_indexes);
|
this.message = ctx.getString(R.string.downloading_list_indexes);
|
||||||
|
indexes.downloadFromInternetFailed = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -323,10 +324,9 @@ public class DownloadIndexesThread {
|
||||||
|
|
||||||
protected void onPostExecute(DownloadResources result) {
|
protected void onPostExecute(DownloadResources result) {
|
||||||
indexes = result;
|
indexes = result;
|
||||||
|
result.downloadFromInternetFailed = !result.isDownloadedFromInternet;
|
||||||
if (result.mapVersionIsIncreased) {
|
if (result.mapVersionIsIncreased) {
|
||||||
showWarnDialog();
|
showWarnDialog();
|
||||||
} else if (!result.isDownloadedFromInternet) {
|
|
||||||
AccessibleToast.makeText(ctx, R.string.list_index_files_was_not_loaded, Toast.LENGTH_LONG).show();
|
|
||||||
}
|
}
|
||||||
currentRunningTask.remove(this);
|
currentRunningTask.remove(this);
|
||||||
newDownloadIndexes();
|
newDownloadIndexes();
|
||||||
|
|
|
@ -19,6 +19,7 @@ import java.util.Map;
|
||||||
|
|
||||||
public class DownloadResources extends DownloadResourceGroup {
|
public class DownloadResources extends DownloadResourceGroup {
|
||||||
public boolean isDownloadedFromInternet = false;
|
public boolean isDownloadedFromInternet = false;
|
||||||
|
public boolean downloadFromInternetFailed = false;
|
||||||
public boolean mapVersionIsIncreased = false;
|
public boolean mapVersionIsIncreased = false;
|
||||||
public OsmandApplication app;
|
public OsmandApplication app;
|
||||||
private Map<String, String> indexFileNames = new LinkedHashMap<>();
|
private Map<String, String> indexFileNames = new LinkedHashMap<>();
|
||||||
|
|
|
@ -245,12 +245,10 @@ public class MapDataMenuController extends MenuController {
|
||||||
rightTitleButtonController.visible = indexItem != null && indexItem.isDownloaded();
|
rightTitleButtonController.visible = indexItem != null && indexItem.isDownloaded();
|
||||||
topRightTitleButtonController.visible = otherIndexItems.size() > 0;
|
topRightTitleButtonController.visible = otherIndexItems.size() > 0;
|
||||||
|
|
||||||
boolean hasIndexes = downloadThread.getIndexes().isDownloadedFromInternet;
|
boolean downloadIndexes = !downloadThread.getIndexes().isDownloadedFromInternet
|
||||||
|
&& !downloadThread.getIndexes().downloadFromInternetFailed;
|
||||||
boolean isDownloading = indexItem != null && downloadThread.isDownloading(indexItem);
|
boolean isDownloading = indexItem != null && downloadThread.isDownloading(indexItem);
|
||||||
if (!hasIndexes) {
|
if (isDownloading) {
|
||||||
titleProgressController.setIndexesDownloadMode();
|
|
||||||
titleProgressController.visible = true;
|
|
||||||
} else if (isDownloading) {
|
|
||||||
titleProgressController.setMapDownloadMode();
|
titleProgressController.setMapDownloadMode();
|
||||||
if (downloadThread.getCurrentDownloadingItem() == indexItem) {
|
if (downloadThread.getCurrentDownloadingItem() == indexItem) {
|
||||||
titleProgressController.indeterminate = false;
|
titleProgressController.indeterminate = false;
|
||||||
|
@ -272,6 +270,9 @@ public class MapDataMenuController extends MenuController {
|
||||||
titleProgressController.caption = v;
|
titleProgressController.caption = v;
|
||||||
}
|
}
|
||||||
titleProgressController.visible = true;
|
titleProgressController.visible = true;
|
||||||
|
} else if (downloadIndexes) {
|
||||||
|
titleProgressController.setIndexesDownloadMode();
|
||||||
|
titleProgressController.visible = true;
|
||||||
} else {
|
} else {
|
||||||
titleProgressController.visible = false;
|
titleProgressController.visible = false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -156,11 +156,13 @@ public class MapMultiSelectionMenu extends BaseMenuController {
|
||||||
hide();
|
hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
for (Map.Entry<Object, IContextMenuProvider> e : selectedObjects.entrySet()) {
|
for (Map.Entry<Object, IContextMenuProvider> e : selectedObjects.entrySet()) {
|
||||||
if (e.getValue() instanceof ContextMenuLayer.IContextMenuProviderSelection) {
|
if (e.getValue() instanceof ContextMenuLayer.IContextMenuProviderSelection) {
|
||||||
((ContextMenuLayer.IContextMenuProviderSelection) e.getValue()).setSelectedObject(e.getKey());
|
((ContextMenuLayer.IContextMenuProviderSelection) e.getValue()).setSelectedObject(e.getKey());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
this.latLon = latLon;
|
this.latLon = latLon;
|
||||||
createCollection(selectedObjects);
|
createCollection(selectedObjects);
|
||||||
|
|
Loading…
Reference in a new issue