From 502b730829823514c7bd2db1685ea91deea348c4 Mon Sep 17 00:00:00 2001 From: rachytski Date: Fri, 6 Jul 2012 14:43:37 -0700 Subject: [PATCH] handling ON_DISK_OUT_OF_DATE enum in DownloadResourcesActivity. --- android/res/values-de/strings.xml | 2 +- android/res/values-es/strings.xml | 2 +- android/res/values-fr/strings.xml | 2 +- android/res/values-ru/strings.xml | 5 ++++- android/res/values/strings.xml | 5 ++++- .../maps/DownloadResourcesActivity.java | 22 ++++++++++++++++--- strings.txt | 7 ++++++ 7 files changed, 37 insertions(+), 8 deletions(-) diff --git a/android/res/values-de/strings.xml b/android/res/values-de/strings.xml index 9c56b0e813..b4876134b7 100644 --- a/android/res/values-de/strings.xml +++ b/android/res/values-de/strings.xml @@ -1,6 +1,6 @@ - + diff --git a/android/res/values-es/strings.xml b/android/res/values-es/strings.xml index 50e489ef08..df620124e7 100644 --- a/android/res/values-es/strings.xml +++ b/android/res/values-es/strings.xml @@ -1,6 +1,6 @@ - + diff --git a/android/res/values-fr/strings.xml b/android/res/values-fr/strings.xml index 9f12ca1f96..d19f1cae8a 100644 --- a/android/res/values-fr/strings.xml +++ b/android/res/values-fr/strings.xml @@ -1,6 +1,6 @@ - + diff --git a/android/res/values-ru/strings.xml b/android/res/values-ru/strings.xml index 1af37b2680..a13aeb2200 100644 --- a/android/res/values-ru/strings.xml +++ b/android/res/values-ru/strings.xml @@ -1,6 +1,6 @@ - + @@ -136,8 +136,11 @@ Перейти на карту Пока загружается %s \nвы можете пользоваться приложением. Загрузить %s? + Обновить %s? Вы можете загрузить карту\nвашего текущего местоположения. + + Вы можете обновить карту\nвашего текущего местоположения. Карта местности, в которой\nвы находитесь (%s) уже загружена. diff --git a/android/res/values/strings.xml b/android/res/values/strings.xml index 6486575ef0..148249fc1d 100644 --- a/android/res/values/strings.xml +++ b/android/res/values/strings.xml @@ -1,6 +1,6 @@ - + @@ -137,8 +137,11 @@ Go to map Downloading %s. You can now\n\"proceed to the map. Download %s? + Update %s? You can download the map\nof your current location. + + You can update the map\of your current location. The map at your current\nlocation (%s) is up-to-date diff --git a/android/src/com/mapswithme/maps/DownloadResourcesActivity.java b/android/src/com/mapswithme/maps/DownloadResourcesActivity.java index 88d99d3b48..707f77c440 100644 --- a/android/src/com/mapswithme/maps/DownloadResourcesActivity.java +++ b/android/src/com/mapswithme/maps/DownloadResourcesActivity.java @@ -356,14 +356,30 @@ public class DownloadResourcesActivity extends Activity implements LocationServi mCountryName = findCountryByPos(lat, lon); if (mCountryName != null) { - if (mMapStorage.countryStatus(mMapStorage.findIndexByName(mCountryName)) == MapStorage.ON_DISK) + int countryStatus = mMapStorage.countryStatus(mMapStorage.findIndexByName(mCountryName)); + if (countryStatus == MapStorage.ON_DISK) mLocationMsgView.setText(String.format(getString(R.string.download_location_map_up_to_date), mCountryName)); else { - mLocationMsgView.setText(getString(R.string.download_location_map_proposal)); CheckBox checkBox = (CheckBox)findViewById(R.id.download_country_checkbox); checkBox.setVisibility(View.VISIBLE); - checkBox.setText(String.format(getString(R.string.download_country_ask), mCountryName)); + + String msgViewText; + String checkBoxText; + + if (countryStatus == MapStorage.ON_DISK_OUT_OF_DATE) + { + msgViewText = getString(R.string.download_location_update_map_proposal); + checkBoxText = String.format(getString(R.string.update_country_ask), mCountryName); + } + else + { + msgViewText = getString(R.string.download_location_map_proposal); + checkBoxText = String.format(getString(R.string.download_country_ask), mCountryName); + } + + mLocationMsgView.setText(msgViewText); + checkBox.setText(checkBoxText); } mLocationService.stopUpdate(this); diff --git a/strings.txt b/strings.txt index 9e80ae6fd4..fb6ca647d2 100644 --- a/strings.txt +++ b/strings.txt @@ -558,10 +558,17 @@ [download_country_ask] en = Download %@? ru = Загрузить %@? + [update_country_ask] + en = Update %@? + ru = Обновить %@? [download_location_map_proposal] en = You can download the map\nof your current location. comment = REMOVE THIS STRING AFTER REFACTORING ru = Вы можете загрузить карту\nвашего текущего местоположения. + [download_location_update_map_proposal] + en = You can update the map\of your current location. + comment = REMOVE THIS_STRING AFTER REFACTORING + ru = Вы можете обновить карту\nвашего текущего местоположения. [download_location_map_up_to_date] en = The map at your current\nlocation (%@) is up-to-date comment = REMOVE THIS STRING AFTER REFACTORING