Update downloads

This commit is contained in:
Victor Shcherb 2015-10-19 23:44:06 +02:00
parent 869a5569a0
commit 5d412c8f94
3 changed files with 7 additions and 5 deletions

View file

@ -85,8 +85,6 @@ public class OsmAndAppCustomization {
} }
public void updatedLoadedFiles(Map<String, String> indexFileNames, Map<String, String> indexActivatedFileNames) {
}
public List<String> onIndexingFiles(IProgress progress, Map<String, String> indexFileNames) { public List<String> onIndexingFiles(IProgress progress, Map<String, String> indexFileNames) {
return Collections.emptyList(); return Collections.emptyList();

View file

@ -44,7 +44,6 @@ public class DownloadResources extends DownloadResourceGroup {
listWithAlternatives(dateFormat, app.getAppPath(""), IndexConstants.EXTRA_EXT, indexActivatedFileNames); listWithAlternatives(dateFormat, app.getAppPath(""), IndexConstants.EXTRA_EXT, indexActivatedFileNames);
Map<String, String> indexFileNames = app.getResourceManager().getIndexFileNames(); Map<String, String> indexFileNames = app.getResourceManager().getIndexFileNames();
listWithAlternatives(dateFormat, app.getAppPath(""), IndexConstants.EXTRA_EXT, indexFileNames); listWithAlternatives(dateFormat, app.getAppPath(""), IndexConstants.EXTRA_EXT, indexFileNames);
app.getAppCustomization().updatedLoadedFiles(indexFileNames, indexActivatedFileNames);
listWithAlternatives(dateFormat, app.getAppPath(IndexConstants.TILES_INDEX_DIR), IndexConstants.SQLITE_EXT, listWithAlternatives(dateFormat, app.getAppPath(IndexConstants.TILES_INDEX_DIR), IndexConstants.SQLITE_EXT,
indexFileNames); indexFileNames);
app.getResourceManager().getBackupIndexes(indexFileNames); app.getResourceManager().getBackupIndexes(indexFileNames);
@ -124,6 +123,7 @@ public class DownloadResources extends DownloadResourceGroup {
protected void updateFilesToUpdate() { protected void updateFilesToUpdate() {
initAlreadyLoadedFiles();
List<IndexItem> stillUpdate = new ArrayList<IndexItem>(); List<IndexItem> stillUpdate = new ArrayList<IndexItem>();
for (IndexItem item : itemsToUpdate) { for (IndexItem item : itemsToUpdate) {
String sfName = item.getTargetFileName(); String sfName = item.getTargetFileName();

View file

@ -269,6 +269,11 @@ public class DownloadResourceGroupFragment extends DialogFragment implements Dow
this.ctx = ctx; this.ctx = ctx;
textView = (TextView) v.findViewById(R.id.title); textView = (TextView) v.findViewById(R.id.title);
} }
private boolean isParentWorld(DownloadResourceGroup group) {
return group.getParentGroup() == null
|| group.getParentGroup().getType() == DownloadResourceGroupType.WORLD;
}
private Drawable getIconForGroup(DownloadResourceGroup group) { private Drawable getIconForGroup(DownloadResourceGroup group) {
Drawable iconLeft; Drawable iconLeft;
@ -277,8 +282,7 @@ public class DownloadResourceGroupFragment extends DialogFragment implements Dow
iconLeft = ctx.getMyApplication().getIconsCache().getContentIcon(R.drawable.ic_action_volume_up); iconLeft = ctx.getMyApplication().getIconsCache().getContentIcon(R.drawable.ic_action_volume_up);
} else { } else {
IconsCache cache = ctx.getMyApplication().getIconsCache(); IconsCache cache = ctx.getMyApplication().getIconsCache();
if (group.getParentGroup() == null if (isParentWorld(group) || isParentWorld(group.getParentGroup())) {
|| group.getParentGroup().getType() == DownloadResourceGroupType.WORLD) {
iconLeft = cache.getContentIcon(R.drawable.ic_world_globe_dark); iconLeft = cache.getContentIcon(R.drawable.ic_world_globe_dark);
} else { } else {
DownloadResourceGroup ggr = group DownloadResourceGroup ggr = group