From 7c2745d4c1bae8fd27a4ae016f747a2932d90d2d Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Thu, 7 May 2015 00:38:07 +0200 Subject: [PATCH] Updates in download activity --- OsmAnd/res/layout/download_index_list_item.xml | 1 + OsmAnd/res/values-ru/strings.xml | 2 +- .../src/net/osmand/plus/download/BaseDownloadActivity.java | 2 +- .../osmand/plus/download/DownloadOsmandIndexesHelper.java | 5 +++-- .../src/net/osmand/plus/download/UpdatesIndexFragment.java | 1 - 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/OsmAnd/res/layout/download_index_list_item.xml b/OsmAnd/res/layout/download_index_list_item.xml index 8c0ebe9279..f916aee5d0 100644 --- a/OsmAnd/res/layout/download_index_list_item.xml +++ b/OsmAnd/res/layout/download_index_list_item.xml @@ -58,6 +58,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:textSize="@dimen/default_sub_text_size" + android:textColor="@color/color_ok" tools:text="@string/lorem_ipsum" android:visibility="gone" android:maxLines="1"/> diff --git a/OsmAnd/res/values-ru/strings.xml b/OsmAnd/res/values-ru/strings.xml index da74aba355..89f706243d 100644 --- a/OsmAnd/res/values-ru/strings.xml +++ b/OsmAnd/res/values-ru/strings.xml @@ -310,7 +310,7 @@ - Локальная версия + Загружено %1$d из %2$d объектов успешно архивированы. %1$d из %2$d объектов успешно удалены. %1$d из %2$d объектов успешно активированы. diff --git a/OsmAnd/src/net/osmand/plus/download/BaseDownloadActivity.java b/OsmAnd/src/net/osmand/plus/download/BaseDownloadActivity.java index ad6593f068..36343a7872 100644 --- a/OsmAnd/src/net/osmand/plus/download/BaseDownloadActivity.java +++ b/OsmAnd/src/net/osmand/plus/download/BaseDownloadActivity.java @@ -38,11 +38,11 @@ public class BaseDownloadActivity extends ActionBarProgressActivity { @Override protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); settings = ((OsmandApplication) getApplication()).getSettings(); if (downloadListIndexThread == null) { downloadListIndexThread = new DownloadIndexesThread(this); } + super.onCreate(savedInstanceState); // Having the next line here causes bug AND-197: The storage folder dialogue popped up upon EVERY app startup, because the map list is not indexed yet. // Hence line moved to updateDownloads() now. // prepareDownloadDirectory(); diff --git a/OsmAnd/src/net/osmand/plus/download/DownloadOsmandIndexesHelper.java b/OsmAnd/src/net/osmand/plus/download/DownloadOsmandIndexesHelper.java index 6a8e074d7c..d99ae02e0f 100644 --- a/OsmAnd/src/net/osmand/plus/download/DownloadOsmandIndexesHelper.java +++ b/OsmAnd/src/net/osmand/plus/download/DownloadOsmandIndexesHelper.java @@ -84,8 +84,9 @@ public class DownloadOsmandIndexesHelper { if (target.endsWith("-tts/_ttsconfig.p") && target.startsWith("voice/")) { String voice = target.substring("voice/".length(), target.length() - "/_ttsconfig.p".length()); File destFile = new File(voicePath, voice + File.separatorChar + "_ttsconfig.p"); - result.add(new AssetIndexItem(voice +ext, "voice", date, dateModified, - "0.1", 1024*100, key, destFile.getPath(), DownloadActivityType.VOICE_FILE)); + + result.add(new AssetIndexItem(voice + ext, "voice", date, dateModified, "0.1", destFile.length(), key, + destFile.getPath(), DownloadActivityType.VOICE_FILE)); } } result.sort(); diff --git a/OsmAnd/src/net/osmand/plus/download/UpdatesIndexFragment.java b/OsmAnd/src/net/osmand/plus/download/UpdatesIndexFragment.java index 39eea32936..c337c60de9 100644 --- a/OsmAnd/src/net/osmand/plus/download/UpdatesIndexFragment.java +++ b/OsmAnd/src/net/osmand/plus/download/UpdatesIndexFragment.java @@ -103,7 +103,6 @@ public class UpdatesIndexFragment extends ListFragment { private void createListView() { updateHeader(); if (indexItems.size() == 0) { - indexItems.clear(); if (DownloadActivity.downloadListIndexThread.isDownloadedFromInternet()) { indexItems.add(new IndexItem(getString(R.string.everything_up_to_date), "", 0, "", 0, 0, null)); } else {