From 4eb39fc8da6db5b5e9fac6e0a43d884a9171ec04 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Thu, 13 Dec 2012 23:42:36 +0100 Subject: [PATCH] Add colors --- .../osmand/plus/activities/DownloadIndexActivity.java | 4 ++++ .../net/osmand/plus/download/DownloadIndexAdapter.java | 10 +++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/activities/DownloadIndexActivity.java b/OsmAnd/src/net/osmand/plus/activities/DownloadIndexActivity.java index 58dea6d18d..4d5d795032 100644 --- a/OsmAnd/src/net/osmand/plus/activities/DownloadIndexActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/DownloadIndexActivity.java @@ -238,6 +238,9 @@ public class DownloadIndexActivity extends OsmandExpandableListActivity { final Map listAlreadyDownloaded = listAlreadyDownloadedWithAlternatives(); final List filtered = new ArrayList(); for (IndexItem fileItem : listAdapter.getIndexFiles()) { + if(fileItem.isAlreadyDownloaded(listAlreadyDownloaded)){ + filtered.add(fileItem); + } if (listAlreadyDownloaded.containsKey(fileItem.getTargetFileName())) { filtered.add(fileItem); } @@ -455,6 +458,7 @@ public class DownloadIndexActivity extends OsmandExpandableListActivity { listWithAlternatives(settings.extendOsmandPath(ResourceManager.BACKUP_PATH),BINARY_MAP_INDEX_EXT, files); listWithAlternatives(settings.extendOsmandPath(ResourceManager.APP_DIR),BINARY_MAP_INDEX_EXT, files); listWithAlternatives(settings.extendOsmandPath(ResourceManager.APP_DIR),EXTRA_EXT, files); + listWithAlternatives(settings.extendOsmandPath(ResourceManager.SRTM_PATH),BINARY_MAP_INDEX_EXT, files); listWithAlternatives(settings.extendOsmandPath(ResourceManager.VOICE_PATH),"", files); listWithAlternatives(settings.extendOsmandPath(ResourceManager.VOICE_PATH),"", files); return files; diff --git a/OsmAnd/src/net/osmand/plus/download/DownloadIndexAdapter.java b/OsmAnd/src/net/osmand/plus/download/DownloadIndexAdapter.java index 2c7b53a509..ec66da470b 100644 --- a/OsmAnd/src/net/osmand/plus/download/DownloadIndexAdapter.java +++ b/OsmAnd/src/net/osmand/plus/download/DownloadIndexAdapter.java @@ -239,12 +239,16 @@ public class DownloadIndexAdapter extends OsmandBaseExpandableListAdapter implem }); if (indexFileNames != null) { - String sfName = e.getTargetFileName(); - if (!indexFileNames.containsKey(sfName)) { + + if (!e.isAlreadyDownloaded(indexFileNames)) { item.setTextColor(downloadActivity.getResources().getColor(R.color.index_unknown)); item.setTypeface(Typeface.DEFAULT, Typeface.NORMAL); } else { - if (e.getDate() != null) { + if(e.getType() == DownloadActivityType.SRTM_FILE){ + item.setTextColor(downloadActivity.getResources().getColor(R.color.act_index_uptodate)); // GREEN + item.setTypeface(Typeface.DEFAULT, Typeface.NORMAL); + } else if (e.getDate() != null) { + String sfName = e.getTargetFileName(); if (e.getDate().equals(indexActivatedFileNames.get(sfName))) { item.setText(item.getText() + "\n" + downloadActivity.getResources().getString(R.string.local_index_installed) + " : " + indexActivatedFileNames.get(sfName));