forked from organicmaps/organicmaps
[android] Add toast when country downloaded. Add spaces in download status strings.
This commit is contained in:
parent
444c745f4e
commit
e9d117feb3
10 changed files with 123 additions and 56 deletions
|
@ -105,7 +105,7 @@
|
|||
<!-- Message to display at the center of the screen when the country is added to the downloading queue -->
|
||||
<string name="country_status_added_to_queue">^přidáno do \nfronty stahování.</string>
|
||||
<!-- Message to display at the center of the screen when the country is downloading -->
|
||||
<string name="country_status_downloading">Stahuji^(^%)</string>
|
||||
<string name="country_status_downloading">Stahuji^ (^%)</string>
|
||||
<!-- Button text for the button at the center of the screen when the country is not downloaded -->
|
||||
<string name="country_status_download">Stáhnout^</string>
|
||||
<!-- Message to display at the center of the screen when the country download has failed -->
|
||||
|
@ -144,5 +144,6 @@
|
|||
<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>
|
||||
<!-- Show toast when we have countries without search index -->
|
||||
<string name="search_update_maps">Pro funkci vyhledávání musíš aktualizovat mapy:</string>
|
||||
</resources>
|
||||
|
|
|
@ -109,7 +109,7 @@
|
|||
<!-- Message to display at the center of the screen when the country is added to the downloading queue -->
|
||||
<string name="country_status_added_to_queue">^добавлено в очередь\nзагрузки.</string>
|
||||
<!-- Message to display at the center of the screen when the country is downloading -->
|
||||
<string name="country_status_downloading">Загружается^(^%)</string>
|
||||
<string name="country_status_downloading">Загружается^ (^%)</string>
|
||||
<!-- Button text for the button at the center of the screen when the country is not downloaded -->
|
||||
<string name="country_status_download">Загрузить^</string>
|
||||
<!-- Message to display at the center of the screen when the country download has failed -->
|
||||
|
@ -148,9 +148,16 @@
|
|||
<string name="continue_download">Продолжить</string>
|
||||
<string name="downloaded_touch_to_update">Загружено (%s), нажмите для обновления или удаления</string>
|
||||
<string name="update_mb_or_kb">Обновить %s</string>
|
||||
<!-- Show toast when we have countries without search index -->
|
||||
<string name="search_update_maps">Для функции поиска необходимо обновить устаревшие карты:</string>
|
||||
<!-- Show toast on start when we have out-of-date maps -->
|
||||
<string name="advise_update_maps">Доступно обновление для следующих карт:</string>
|
||||
<!-- Show toast in Pro version that Lite can be deleted -->
|
||||
<string name="suggest_uninstall_lite">Maps With Me Lite больше не нужна. Рекомендуем ее удалить.</string>
|
||||
<!-- Show toast when country has downloaded. -->
|
||||
<string name="download_country_success">%s успешно загружена.</string>
|
||||
<!-- Show toast when country downloading failed. -->
|
||||
<string name="download_country_failed">Загрузка %s провалилась.</string>
|
||||
<!-- Add New Bookmark Set dialog title -->
|
||||
<string name="add_new_set">Добавить группу</string>
|
||||
<!-- Place Page - Add To Bookmarks button -->
|
||||
|
|
|
@ -112,7 +112,7 @@
|
|||
<!-- Message to display at the center of the screen when the country is added to the downloading queue -->
|
||||
<string name="country_status_added_to_queue">^is added to the\ndownloading queue.</string>
|
||||
<!-- Message to display at the center of the screen when the country is downloading -->
|
||||
<string name="country_status_downloading">Downloading^(^%)</string>
|
||||
<string name="country_status_downloading">Downloading^ (^%)</string>
|
||||
<!-- Button text for the button at the center of the screen when the country is not downloaded -->
|
||||
<string name="country_status_download">Download^</string>
|
||||
<!-- Message to display at the center of the screen when the country download has failed -->
|
||||
|
@ -152,9 +152,16 @@
|
|||
<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>
|
||||
<!-- Show toast when we have countries without search index -->
|
||||
<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>
|
||||
<!-- Show toast on start when we have out-of-date maps -->
|
||||
<string name="advise_update_maps">Update available for these maps:</string>
|
||||
<!-- Show toast in Pro version that Lite can be deleted -->
|
||||
<string name="suggest_uninstall_lite">You don\'t need Maps With Me Lite any more, so you can uninstall it.</string>
|
||||
<!-- Show toast when country has downloaded. -->
|
||||
<string name="download_country_success">%s downloaded successfuly.</string>
|
||||
<!-- Show toast when country downloading failed. -->
|
||||
<string name="download_country_failed">Downloading of %s failed.</string>
|
||||
<!-- Add New Bookmark Set dialog title -->
|
||||
<string name="add_new_set">Add New Set</string>
|
||||
<!-- Place Page - Add To Bookmarks button -->
|
||||
|
|
|
@ -287,7 +287,7 @@ public class DownloadResourcesActivity extends Activity implements LocationServi
|
|||
|
||||
setContentView(R.layout.download_resources);
|
||||
|
||||
mMapStorage = MapStorage.getInstance();
|
||||
mMapStorage = mApplication.getMapStorage();
|
||||
mSlotId = mMapStorage.subscribe(this);
|
||||
|
||||
// Create sdcard folder if it doesn't exist
|
||||
|
|
|
@ -134,8 +134,9 @@ public class DownloadUI extends ListActivity implements MapStorage.Listener
|
|||
|
||||
public DownloadAdapter(Activity context)
|
||||
{
|
||||
m_storage = MapStorage.getInstance();
|
||||
m_packageName = context.getApplication().getPackageName();
|
||||
MWMApplication app = (MWMApplication) context.getApplication();
|
||||
m_storage = app.getMapStorage();
|
||||
m_packageName = app.getPackageName();
|
||||
|
||||
m_context = context;
|
||||
m_inflater = (LayoutInflater) m_context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
||||
|
|
|
@ -11,7 +11,6 @@ import android.content.SharedPreferences;
|
|||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.os.Environment;
|
||||
import android.util.DisplayMetrics;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuInflater;
|
||||
|
@ -38,6 +37,10 @@ public class MWMActivity extends NvEventQueueActivity implements LocationService
|
|||
{
|
||||
return mApplication.getLocationService();
|
||||
}
|
||||
private MapStorage getMapStorage()
|
||||
{
|
||||
return mApplication.getMapStorage();
|
||||
}
|
||||
|
||||
public void checkShouldStartLocationService()
|
||||
{
|
||||
|
@ -213,8 +216,7 @@ public class MWMActivity extends NvEventQueueActivity implements LocationService
|
|||
{
|
||||
m_needCheckUpdate = false;
|
||||
|
||||
final MapStorage s = MapStorage.getInstance();
|
||||
s.updateMaps(R.string.advise_update_maps, this, new MapStorage.UpdateFunctor()
|
||||
getMapStorage().updateMaps(R.string.advise_update_maps, this, new MapStorage.UpdateFunctor()
|
||||
{
|
||||
@Override
|
||||
public void doUpdate()
|
||||
|
@ -276,8 +278,7 @@ public class MWMActivity extends NvEventQueueActivity implements LocationService
|
|||
}
|
||||
else
|
||||
{
|
||||
final MapStorage s = MapStorage.getInstance();
|
||||
if (!s.updateMaps(R.string.search_update_maps, this, new MapStorage.UpdateFunctor()
|
||||
if (!getMapStorage().updateMaps(R.string.search_update_maps, this, new MapStorage.UpdateFunctor()
|
||||
{
|
||||
@Override
|
||||
public void doUpdate()
|
||||
|
@ -327,9 +328,18 @@ public class MWMActivity extends NvEventQueueActivity implements LocationService
|
|||
|
||||
mApplication = (MWMApplication)getApplication();
|
||||
|
||||
nativeSetString("country_status_added_to_queue", getString(R.string.country_status_added_to_queue));
|
||||
nativeSetString("country_status_downloading", getString(R.string.country_status_downloading));
|
||||
nativeSetString("country_status_download", getString(R.string.country_status_download));
|
||||
nativeSetString("country_status_download_failed", getString(R.string.country_status_download_failed));
|
||||
nativeSetString("try_again", getString(R.string.try_again));
|
||||
nativeSetString("not_enough_free_space_on_sdcard", getString(R.string.not_enough_free_space_on_sdcard));
|
||||
|
||||
nativeConnectDownloadButton();
|
||||
|
||||
// Get screen density
|
||||
DisplayMetrics metrics = new DisplayMetrics();
|
||||
getWindowManager().getDefaultDisplay().getMetrics(metrics);
|
||||
//DisplayMetrics metrics = new DisplayMetrics();
|
||||
//getWindowManager().getDefaultDisplay().getMetrics(metrics);
|
||||
|
||||
double k = metrics.density;
|
||||
|
||||
|
@ -382,15 +392,6 @@ public class MWMActivity extends NvEventQueueActivity implements LocationService
|
|||
SharedPreferences prefs = getSharedPreferences(mApplication.getPackageName(), MODE_PRIVATE);
|
||||
final boolean isMyPositionEnabled = prefs.getBoolean(PREFERENCES_MYPOSITION, false);
|
||||
findViewById(R.id.map_button_myposition).setSelected(isMyPositionEnabled);
|
||||
|
||||
nativeSetString("country_status_added_to_queue", getString(R.string.country_status_added_to_queue));
|
||||
nativeSetString("country_status_downloading", getString(R.string.country_status_downloading));
|
||||
nativeSetString("country_status_download", getString(R.string.country_status_download));
|
||||
nativeSetString("country_status_download_failed", getString(R.string.country_status_download_failed));
|
||||
nativeSetString("try_again", getString(R.string.try_again));
|
||||
nativeSetString("not_enough_free_space_on_sdcard", getString(R.string.not_enough_free_space_on_sdcard));
|
||||
|
||||
nativeConnectDownloadButton();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -13,18 +13,51 @@ import android.os.Environment;
|
|||
import android.os.PowerManager;
|
||||
import android.os.PowerManager.WakeLock;
|
||||
import android.util.Log;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.mapswithme.maps.MapStorage.Index;
|
||||
import com.mapswithme.maps.location.LocationService;
|
||||
import com.mapswithme.util.Utils;
|
||||
|
||||
public class MWMApplication extends android.app.Application
|
||||
|
||||
public class MWMApplication extends android.app.Application implements MapStorage.Listener
|
||||
{
|
||||
private final static String TAG = "MWMApplication";
|
||||
private LocationService mLocationService = null;
|
||||
|
||||
private LocationService m_location = null;
|
||||
private MapStorage m_storage = null;
|
||||
private int m_slotID = 0;
|
||||
|
||||
private boolean mIsProVersion = false;
|
||||
private String mProVersionCheckURL = "";
|
||||
|
||||
|
||||
private void showDownloadToast(int resID, Index idx)
|
||||
{
|
||||
String msg = String.format(getString(resID), m_storage.countryName(idx));
|
||||
Toast.makeText(this, msg, Toast.LENGTH_LONG).show();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCountryStatusChanged(Index idx)
|
||||
{
|
||||
switch (m_storage.countryStatus(idx))
|
||||
{
|
||||
case MapStorage.ON_DISK:
|
||||
showDownloadToast(R.string.download_country_success, idx);
|
||||
break;
|
||||
|
||||
case MapStorage.DOWNLOAD_FAILED:
|
||||
showDownloadToast(R.string.download_country_failed, idx);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCountryProgress(Index idx, long current, long total)
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate()
|
||||
{
|
||||
|
@ -66,16 +99,27 @@ public class MWMApplication extends android.app.Application
|
|||
// Changed path for settings to be the same as external storage
|
||||
extStoragePath, //getSettingsPath(),
|
||||
mIsProVersion);
|
||||
|
||||
m_slotID = getMapStorage().subscribe(this);
|
||||
}
|
||||
|
||||
public LocationService getLocationService()
|
||||
{
|
||||
if (mLocationService == null)
|
||||
mLocationService = new LocationService(this);
|
||||
if (m_location == null)
|
||||
m_location = new LocationService(this);
|
||||
|
||||
return mLocationService;
|
||||
return m_location;
|
||||
}
|
||||
|
||||
public MapStorage getMapStorage()
|
||||
{
|
||||
if (m_storage == null)
|
||||
m_storage = new MapStorage();
|
||||
|
||||
return m_storage;
|
||||
}
|
||||
|
||||
|
||||
public String getApkPath()
|
||||
{
|
||||
try
|
||||
|
|
|
@ -128,20 +128,10 @@ public class MapStorage
|
|||
private native String[] nativeGetMapsWithoutSearch();
|
||||
|
||||
|
||||
private MapStorage()
|
||||
public MapStorage()
|
||||
{
|
||||
}
|
||||
|
||||
private static MapStorage mInstance = null;
|
||||
|
||||
public static MapStorage getInstance()
|
||||
{
|
||||
if (mInstance == null)
|
||||
mInstance = new MapStorage();
|
||||
|
||||
return mInstance;
|
||||
}
|
||||
|
||||
private void runDownloadCountries(Index[] indexes)
|
||||
{
|
||||
for (int i = 0; i < indexes.length; ++i)
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
string const CountryStatusDisplay::displayName() const
|
||||
{
|
||||
if (!m_mapGroupName.empty())
|
||||
return m_mapName + "(" + m_mapGroupName + ")";
|
||||
return m_mapName + " (" + m_mapGroupName + ")";
|
||||
else
|
||||
return m_mapName;
|
||||
}
|
||||
|
|
48
strings.txt
48
strings.txt
|
@ -513,10 +513,10 @@
|
|||
ru = ^добавлено в очередь\nзагрузки.
|
||||
cs = ^přidáno do \nfronty stahování.
|
||||
[country_status_downloading]
|
||||
en = Downloading^(^%)
|
||||
en = Downloading^ (^%)
|
||||
comment = Message to display at the center of the screen when the country is downloading
|
||||
ru = Загружается^(^%)
|
||||
cs = Stahuji^(^%)
|
||||
ru = Загружается^ (^%)
|
||||
cs = Stahuji^ (^%)
|
||||
[country_status_download]
|
||||
en = Download^
|
||||
comment = Button text for the button at the center of the screen when the country is not downloaded
|
||||
|
@ -669,30 +669,46 @@
|
|||
ru = Обновить %@
|
||||
cs = Aktualizace %@
|
||||
[search_update_maps]
|
||||
comment = Show toast when we have countries without search index
|
||||
tags = android
|
||||
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:
|
||||
comment = Show toast on start when we have out-of-date maps
|
||||
tags = android
|
||||
en = Update available for these maps:
|
||||
ru = Доступно обновление для следующих карт:
|
||||
[suggest_uninstall_lite]
|
||||
comment = Show toast in Pro version that Lite can be deleted
|
||||
tags = android
|
||||
en = You don't need Maps With Me Lite any more, so you can uninstall it.
|
||||
ru = Maps With Me Lite больше не нужна. Рекомендуем ее удалить.
|
||||
[download_country_success]
|
||||
comment = Show toast when country has downloaded.
|
||||
tags = android
|
||||
en = %@ downloaded successfuly.
|
||||
ru = %@ успешно загружена.
|
||||
[download_country_failed]
|
||||
comment = Show toast when country downloading failed.
|
||||
tags = android
|
||||
en = Downloading of %@ failed.
|
||||
ru = Загрузка %@ провалилась.
|
||||
[add_new_set]
|
||||
en = Add New Set
|
||||
tags = ios
|
||||
comment = Add New Bookmark Set dialog title
|
||||
ru = Добавить группу
|
||||
en = Add New Set
|
||||
tags = ios
|
||||
comment = Add New Bookmark Set dialog title
|
||||
ru = Добавить группу
|
||||
[add_to_bookmarks]
|
||||
en = Add To Bookmarks
|
||||
tags = ios
|
||||
comment = Place Page - Add To Bookmarks button
|
||||
ru = Добавить в закладки
|
||||
en = Add To Bookmarks
|
||||
tags = ios
|
||||
comment = Place Page - Add To Bookmarks button
|
||||
ru = Добавить в закладки
|
||||
[bookmark_color]
|
||||
en = Bookmark Color
|
||||
tags = ios
|
||||
comment = Bookmark Color dialog title
|
||||
ru = Цвет закладки
|
||||
en = Bookmark Color
|
||||
tags = ios
|
||||
comment = Bookmark Color dialog title
|
||||
ru = Цвет закладки
|
||||
[bookmark_set_name]
|
||||
en = Bookmark Set Name
|
||||
tags = ios
|
||||
|
|
Loading…
Add table
Reference in a new issue