Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvng <viktor.govako@gmail.com>2012-07-18 10:59:20 +0400
committerAlex Zolotarev <alex@maps.me>2015-09-23 01:41:11 +0300
commitb6d8c6fbad4d9080a1824086d19f1d91f583a811 (patch)
tree01ef737774714cc644ddc7077c012f8dc3c84f7d
parent863377eaa9d7fbafdcc218ec49a4aaf2a042967f (diff)
[android] Add Toast for Pro version to uninstall Lite version.
-rw-r--r--android/res/values-cs/strings.xml2
-rw-r--r--android/res/values-ru/strings.xml5
-rw-r--r--android/res/values/strings.xml5
-rw-r--r--android/src/com/mapswithme/maps/DownloadResourcesActivity.java48
-rw-r--r--android/src/com/mapswithme/maps/MapStorage.java2
-rw-r--r--strings.txt13
6 files changed, 50 insertions, 25 deletions
diff --git a/android/res/values-cs/strings.xml b/android/res/values-cs/strings.xml
index 06cb2b08cb..150bfa215e 100644
--- a/android/res/values-cs/strings.xml
+++ b/android/res/values-cs/strings.xml
@@ -144,5 +144,5 @@
<string name="continue_download">Pokračovat</string>
<string name="downloaded_touch_to_update">Staženo (%s), klepni pro smazání</string>
<string name="update_mb_or_kb">Aktualizace %s</string>
- <string name="search_update_maps">Pro funkci vyhledávání musíš aktualizovat mapy</string>
+ <string name="search_update_maps">Pro funkci vyhledávání musíš aktualizovat mapy:</string>
</resources>
diff --git a/android/res/values-ru/strings.xml b/android/res/values-ru/strings.xml
index e357c1054f..cc0a6b5381 100644
--- a/android/res/values-ru/strings.xml
+++ b/android/res/values-ru/strings.xml
@@ -148,8 +148,9 @@
<string name="continue_download">Продолжить</string>
<string name="downloaded_touch_to_update">Загружено (%s), нажмите для обновления или удаления</string>
<string name="update_mb_or_kb">Обновить %s</string>
- <string name="search_update_maps">Для функции поиска необходимо обновить устаревшие карты</string>
- <string name="advise_update_maps">Доступно обновление для следующих карт</string>
+ <string name="search_update_maps">Для функции поиска необходимо обновить устаревшие карты:</string>
+ <string name="advise_update_maps">Доступно обновление для следующих карт:</string>
+ <string name="suggest_uninstall_lite">Maps With Me Lite больше не нужна. Рекомендуем ее удалить.</string>
<!-- Add New Bookmark Set dialog title -->
<string name="add_new_set">Добавить группу</string>
<!-- Place Page - Add To Bookmarks button -->
diff --git a/android/res/values/strings.xml b/android/res/values/strings.xml
index 5c00bb7e11..ba30062544 100644
--- a/android/res/values/strings.xml
+++ b/android/res/values/strings.xml
@@ -152,8 +152,9 @@
<string name="continue_download">Continue</string>
<string name="downloaded_touch_to_update">Downloaded (%s), touch to update or delete</string>
<string name="update_mb_or_kb">Update %s</string>
- <string name="search_update_maps">You need updated maps for search function</string>
- <string name="advise_update_maps">Update available for this maps</string>
+ <string name="search_update_maps">You need to updated maps for search function:</string>
+ <string name="advise_update_maps">Update available for this maps:</string>
+ <string name="suggest_uninstall_lite">You don\'t need Maps With Me Lite any more, so you can uninstall it.</string>
<!-- Add New Bookmark Set dialog title -->
<string name="add_new_set">Add New Set</string>
<!-- Place Page - Add To Bookmarks button -->
diff --git a/android/src/com/mapswithme/maps/DownloadResourcesActivity.java b/android/src/com/mapswithme/maps/DownloadResourcesActivity.java
index 78ee454e31..61633d7636 100644
--- a/android/src/com/mapswithme/maps/DownloadResourcesActivity.java
+++ b/android/src/com/mapswithme/maps/DownloadResourcesActivity.java
@@ -14,6 +14,7 @@ import android.widget.Button;
import android.widget.CheckBox;
import android.widget.ProgressBar;
import android.widget.TextView;
+import android.widget.Toast;
import com.mapswithme.maps.location.LocationService;
import com.mapswithme.util.ConnectionState;
@@ -229,33 +230,52 @@ public class DownloadResourcesActivity extends Activity implements LocationServi
mProgress.setProgress((int)current);
}
- @Override
- protected void onCreate(Bundle savedInstanceState)
+ private Intent getPackageIntent(String s)
{
- super.onCreate(savedInstanceState);
-
- mApplication = (MWMApplication)getApplication();
+ return getPackageManager().getLaunchIntentForPackage(s);
+ }
- if (!mApplication.isProVersion())
+ private boolean checkLiteProPackages(boolean isPro)
+ {
+ try
{
- try
+ if (!isPro)
{
- Log.d(TAG, "Trying to launch pro version");
-
- Intent intent = getPackageManager().getLaunchIntentForPackage("com.mapswithme.maps.pro");
+ final Intent intent = getPackageIntent("com.mapswithme.maps.pro");
if (intent != null)
{
+ Log.i(TAG, "Trying to launch pro version");
+
startActivity(intent);
finish();
- return;
+ return true;
}
}
- catch (ActivityNotFoundException e)
+ else
{
- // suppress this exception - no pro version installed
- Log.d(TAG, "Pro version not installed");
+ if (getPackageIntent("com.mapswithme.maps") != null)
+ {
+ Toast.makeText(this, R.string.suggest_uninstall_lite, Toast.LENGTH_LONG).show();
+ }
}
}
+ catch (ActivityNotFoundException ex)
+ {
+ Log.d(TAG, "Intent not found", ex);
+ }
+
+ return false;
+ }
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState)
+ {
+ super.onCreate(savedInstanceState);
+
+ mApplication = (MWMApplication)getApplication();
+
+ if (checkLiteProPackages(mApplication.isProVersion()))
+ return;
setContentView(R.layout.download_resources);
diff --git a/android/src/com/mapswithme/maps/MapStorage.java b/android/src/com/mapswithme/maps/MapStorage.java
index a874469c9d..220de68b46 100644
--- a/android/src/com/mapswithme/maps/MapStorage.java
+++ b/android/src/com/mapswithme/maps/MapStorage.java
@@ -186,7 +186,7 @@ public class MapStorage
if (count == 0)
return false;
- String msg = context.getString(msgID) + ":";
+ String msg = context.getString(msgID);
for (int i = 0; i < maps.length; ++i)
{
if (indexes[i] != null)
diff --git a/strings.txt b/strings.txt
index 4831ece83d..ceb48046c0 100644
--- a/strings.txt
+++ b/strings.txt
@@ -669,12 +669,15 @@
ru = Обновить %@
cs = Aktualizace %@
[search_update_maps]
- en = You need updated maps for search function
- ru = Для функции поиска необходимо обновить устаревшие карты
- cs = Pro funkci vyhledávání musíš aktualizovat mapy
+ en = You need to updated maps for search function:
+ ru = Для функции поиска необходимо обновить устаревшие карты:
+ cs = Pro funkci vyhledávání musíš aktualizovat mapy:
[advise_update_maps]
- en = Update available for this maps
- ru = Доступно обновление для следующих карт
+ en = Update available for this maps:
+ ru = Доступно обновление для следующих карт:
+ [suggest_uninstall_lite]
+ en = You don't need Maps With Me Lite any more, so you can uninstall it.
+ ru = Maps With Me Lite больше не нужна. Рекомендуем ее удалить.
[add_new_set]
en = Add New Set
tags = ios