diff --git a/OsmAnd/res/layout-port/menu.xml b/OsmAnd/res/layout-port/menu.xml
index df54b9602d..06dfe77598 100644
--- a/OsmAnd/res/layout-port/menu.xml
+++ b/OsmAnd/res/layout-port/menu.xml
@@ -14,9 +14,8 @@
android:background="@drawable/btn_orange"
android:textColor="#FFFFFF"
android:textStyle="bold"
- android:layout_width="140dip"
android:layout_height="90dip"
- android:drawableLeft="@drawable/map"/>
+ android:drawableLeft="@drawable/map" android:layout_width="150dip"/>
+ android:drawableLeft="@drawable/find" android:layout_width="150dip"/>
diff --git a/OsmAnd/res/values-ru-rRU/strings.xml b/OsmAnd/res/values-ru-rRU/strings.xml
new file mode 100644
index 0000000000..5807c4ab78
--- /dev/null
+++ b/OsmAnd/res/values-ru-rRU/strings.xml
@@ -0,0 +1,88 @@
+
+
+ Упраление слоем open street bugs, установка osm логина
+ Включение мониторинга, установка интервала сохранения
+ Настройка параметров поиска
+ Настройка источника, параметров карты, доступа в Интернет
+ Поиск
+ Osm
+ Автоматически измемять масштаб карты при изменении скорости
+ Масштаб
+ Дополнительные настройки
+ Выбор режима работы приложения
+ Режим работы
+ Настройки
+ Сохранить текущий путь на SD
+ Сохранить путь
+ Указать интервал между сохранениями пути
+ Интервал сохранения
+ Мониторинг
+ Сохранять путь в gpx формате в папку track
+ Мониторить
+ Перейти к
+ Обновить карту
+ Обновить часть карты
+ Указать имя пользователя для работы с OSM
+ Имя пользователя
+ Цель
+ Показывать слой Open Street Bugs
+ Open Street Bugs
+ Список избранных точек
+ Добавить к избранным
+ Использовать местные или английские названия
+ Английские названия
+ Настройки приложения
+ Искать адрес
+ Выберите здание
+ Выберите улицу
+ Выберите город
+ Выберите страну
+ Установить расположение текущей позиции на карте
+ Текущая позиция
+ Перейти к точке
+ Показывать угол обзора в соответствии с компасом
+ Угол обзора
+ Снять отметку
+ Отметить точку
+ Вклюсить 3D вид для карты
+ 3D вид
+ Вращать карту при изменении направления движения
+ Вращать карту
+ Показывать слой POI
+ POI
+ Загружать недостающие части карты из:
+ Источник данных
+ Источник карты
+ Интернет
+ Показать место
+ Карта
+ Настройки
+ Показать gps координаты на карте
+ Использовать Интернет для загрузки недостающих частей карты
+ Hello World, StartActivity!
+ OsmAnd
+
+Выход
+Карта
+Настройки
+Избранное
+Поиск
+#FF9030
+Поиск
+#FFFFFF
+#FF0000
+Choose poi
+Find more
+Search city incrementally. In order to find villages input more than 3 first symbols.
+Search street incrementally
+Search building incrementally
+Choose region
+Choose intersected street
+Closest amenities
+По умолчанию
+Автомобиль
+Велосипед
+Пешеход
+В центре
+Внизу
+
diff --git a/OsmAnd/res/values/strings.xml b/OsmAnd/res/values/strings.xml
index eb79359680..5b3a6a2ae1 100644
--- a/OsmAnd/res/values/strings.xml
+++ b/OsmAnd/res/values/strings.xml
@@ -79,4 +79,10 @@
Choose region
Choose intersected street
Closest amenities
+Default
+Car
+Bicycle
+Pedestrian
+Center
+Bottom
diff --git a/OsmAnd/res/xml/settings_pref.xml b/OsmAnd/res/xml/settings_pref.xml
index 0b7e89e3c5..83d8b6e121 100644
--- a/OsmAnd/res/xml/settings_pref.xml
+++ b/OsmAnd/res/xml/settings_pref.xml
@@ -7,11 +7,11 @@
-
+
-
+
diff --git a/OsmAnd/src/com/osmand/OsmandSettings.java b/OsmAnd/src/com/osmand/OsmandSettings.java
index 1bc7b08f54..030785b7eb 100644
--- a/OsmAnd/src/com/osmand/OsmandSettings.java
+++ b/OsmAnd/src/com/osmand/OsmandSettings.java
@@ -12,57 +12,66 @@ import com.osmand.map.TileSourceManager.TileSourceTemplate;
import com.osmand.osm.LatLon;
public class OsmandSettings {
-
+
public enum ApplicationMode {
- DEFAULT("Default"),
- CAR("Car"),
- BICYCLE("Bicycle"),
- PEDESTRIAN("Pedestrian");
-
- private final String name;
- ApplicationMode(String name){
- this.name = name;
+ /*
+ * DEFAULT("Default"), CAR("Car"), BICYCLE("Bicycle"), PEDESTRIAN("Pedestrian");
+ */
+
+ DEFAULT(R.string.app_mode_default),
+ CAR(R.string.app_mode_car),
+ BICYCLE(R.string.app_mode_bicycle),
+ PEDESTRIAN(R.string.app_mode_pedestrian);
+
+ private final int key;
+
+ ApplicationMode(int key) {
+ this.key = key;
}
- @Override
- public String toString() {
- return name;
+ public static String toHumanString(ApplicationMode m, Context ctx){
+ return ctx.getResources().getString(m.key);
}
+
}
-
+
// These settings are stored in SharedPreferences
public static final String SHARED_PREFERENCES_NAME = "com.osmand.settings";
-
+
public static final int CENTER_CONSTANT = 0;
public static final int BOTTOM_CONSTANT = 1;
- // this value string is synchronized with settings_pref.xml preference name
+ // this value string is synchronized with settings_pref.xml preference name
public static final String USE_INTERNET_TO_DOWNLOAD_TILES = "use_internet_to_download_tiles";
- public static boolean isUsingInternetToDownloadTiles(Context ctx){
+
+ public static boolean isUsingInternetToDownloadTiles(Context ctx) {
SharedPreferences prefs = ctx.getSharedPreferences(SHARED_PREFERENCES_NAME, Context.MODE_WORLD_READABLE);
return prefs.getBoolean(USE_INTERNET_TO_DOWNLOAD_TILES, true);
}
-
+
// this value string is synchronized with settings_pref.xml preference name
public static final String SHOW_POI_OVER_MAP = "show_poi_over_map";
- public static boolean isShowingPoiOverMap(Context ctx){
+
+ public static boolean isShowingPoiOverMap(Context ctx) {
SharedPreferences prefs = ctx.getSharedPreferences(SHARED_PREFERENCES_NAME, Context.MODE_WORLD_READABLE);
return prefs.getBoolean(SHOW_POI_OVER_MAP, false);
}
-
+
// this value string is synchronized with settings_pref.xml preference name
public static final String USER_NAME = "user_name";
- public static String getUserName(Context ctx){
+
+ public static String getUserName(Context ctx) {
SharedPreferences prefs = ctx.getSharedPreferences(SHARED_PREFERENCES_NAME, Context.MODE_WORLD_READABLE);
return prefs.getString(USER_NAME, "NoName");
}
-
- public static boolean setUserName(Context ctx, String name){
+
+ public static boolean setUserName(Context ctx, String name) {
SharedPreferences prefs = ctx.getSharedPreferences(SHARED_PREFERENCES_NAME, Context.MODE_WORLD_READABLE);
return prefs.edit().putString(USER_NAME, name).commit();
}
-
+
// this value string is synchronized with settings_pref.xml preference name
public static final String APPLICATION_MODE = "application_mode";
+
public static ApplicationMode getApplicationMode(Context ctx) {
SharedPreferences prefs = ctx.getSharedPreferences(SHARED_PREFERENCES_NAME, Context.MODE_WORLD_READABLE);
String s = prefs.getString(APPLICATION_MODE, ApplicationMode.DEFAULT.name());
@@ -72,105 +81,113 @@ public class OsmandSettings {
return ApplicationMode.DEFAULT;
}
}
-
- public static boolean setApplicationMode(Context ctx, ApplicationMode p){
+
+ public static boolean setApplicationMode(Context ctx, ApplicationMode p) {
SharedPreferences prefs = ctx.getSharedPreferences(SHARED_PREFERENCES_NAME, Context.MODE_WORLD_READABLE);
return prefs.edit().putString(APPLICATION_MODE, p.name()).commit();
}
-
+
// this value string is synchronized with settings_pref.xml preference name
public static final String SAVE_CURRENT_TRACK = "save_current_track";
-
+
// this value string is synchronized with settings_pref.xml preference name
public static final String SAVE_TRACK_TO_GPX = "save_track_to_gpx";
- public static boolean isSavingTrackToGpx(Context ctx){
+
+ public static boolean isSavingTrackToGpx(Context ctx) {
SharedPreferences prefs = ctx.getSharedPreferences(SHARED_PREFERENCES_NAME, Context.MODE_WORLD_READABLE);
return prefs.getBoolean(SAVE_TRACK_TO_GPX, false);
}
-
+
// this value string is synchronized with settings_pref.xml preference name
public static final String SAVE_TRACK_INTERVAL = "save_track_interval";
- public static int getSavingTrackInterval(Context ctx){
+
+ public static int getSavingTrackInterval(Context ctx) {
SharedPreferences prefs = ctx.getSharedPreferences(SHARED_PREFERENCES_NAME, Context.MODE_WORLD_READABLE);
return prefs.getInt(SAVE_TRACK_INTERVAL, 5);
}
-
-
+
// this value string is synchronized with settings_pref.xml preference name
public static final String SHOW_OSM_BUGS = "show_osm_bugs";
- public static boolean isShowingOsmBugs(Context ctx){
+
+ public static boolean isShowingOsmBugs(Context ctx) {
SharedPreferences prefs = ctx.getSharedPreferences(SHARED_PREFERENCES_NAME, Context.MODE_WORLD_READABLE);
return prefs.getBoolean(SHOW_OSM_BUGS, false);
}
-
+
// this value string is synchronized with settings_pref.xml preference name
public static final String SHOW_VIEW_ANGLE = "show_view_angle";
- public static boolean isShowingViewAngle(Context ctx){
+
+ public static boolean isShowingViewAngle(Context ctx) {
SharedPreferences prefs = ctx.getSharedPreferences(SHARED_PREFERENCES_NAME, Context.MODE_WORLD_READABLE);
return prefs.getBoolean(SHOW_VIEW_ANGLE, true);
}
-
+
// this value string is synchronized with settings_pref.xml preference name
public static final String AUTO_ZOOM_MAP = "auto_zoom_map";
- public static boolean isAutoZoomEnabled(Context ctx){
+
+ public static boolean isAutoZoomEnabled(Context ctx) {
SharedPreferences prefs = ctx.getSharedPreferences(SHARED_PREFERENCES_NAME, Context.MODE_WORLD_READABLE);
return prefs.getBoolean(AUTO_ZOOM_MAP, false);
}
-
+
// this value string is synchronized with settings_pref.xml preference name
public static final String ROTATE_MAP_TO_BEARING = "rotate_map_to_bearing";
- public static boolean isRotateMapToBearing(Context ctx){
+
+ public static boolean isRotateMapToBearing(Context ctx) {
SharedPreferences prefs = ctx.getSharedPreferences(SHARED_PREFERENCES_NAME, Context.MODE_WORLD_READABLE);
return prefs.getBoolean(ROTATE_MAP_TO_BEARING, false);
}
-
+
// this value string is synchronized with settings_pref.xml preference name
public static final String POSITION_ON_MAP = "position_on_map";
- public static int getPositionOnMap(Context ctx){
+
+ public static int getPositionOnMap(Context ctx) {
SharedPreferences prefs = ctx.getSharedPreferences(SHARED_PREFERENCES_NAME, Context.MODE_WORLD_READABLE);
return prefs.getInt(POSITION_ON_MAP, CENTER_CONSTANT);
}
-
+
// this value string is synchronized with settings_pref.xml preference name
public static final String MAP_VIEW_3D = "map_view_3d";
- public static boolean isMapView3D(Context ctx){
+
+ public static boolean isMapView3D(Context ctx) {
SharedPreferences prefs = ctx.getSharedPreferences(SHARED_PREFERENCES_NAME, Context.MODE_WORLD_READABLE);
return prefs.getBoolean(MAP_VIEW_3D, false);
}
-
+
// this value string is synchronized with settings_pref.xml preference name
public static final String USE_ENGLISH_NAMES = "use_english_names";
- public static boolean usingEnglishNames(Context ctx){
+
+ public static boolean usingEnglishNames(Context ctx) {
SharedPreferences prefs = ctx.getSharedPreferences(SHARED_PREFERENCES_NAME, Context.MODE_WORLD_READABLE);
return prefs.getBoolean(USE_ENGLISH_NAMES, false);
}
-
- public static boolean setUseEnglishNames(Context ctx, boolean useEnglishNames){
+
+ public static boolean setUseEnglishNames(Context ctx, boolean useEnglishNames) {
SharedPreferences prefs = ctx.getSharedPreferences(SHARED_PREFERENCES_NAME, Context.MODE_WORLD_READABLE);
return prefs.edit().putBoolean(USE_ENGLISH_NAMES, useEnglishNames).commit();
}
-
-
+
// this value string is synchronized with settings_pref.xml preference name
public static final String MAP_TILE_SOURCES = "map_tile_sources";
- public static ITileSource getMapTileSource(Context ctx){
+
+ public static ITileSource getMapTileSource(Context ctx) {
SharedPreferences prefs = ctx.getSharedPreferences(SHARED_PREFERENCES_NAME, Context.MODE_WORLD_READABLE);
String tileName = prefs.getString(MAP_TILE_SOURCES, null);
- if(tileName != null){
+ if (tileName != null) {
List list = TileSourceManager.getKnownSourceTemplates();
- for(TileSourceTemplate l : list){
- if(l.getName().equals(tileName)){
+ for (TileSourceTemplate l : list) {
+ if (l.getName().equals(tileName)) {
return l;
}
}
}
return TileSourceManager.getMapnikSource();
}
-
- public static String getMapTileSourceName(Context ctx){
+
+ public static String getMapTileSourceName(Context ctx) {
SharedPreferences prefs = ctx.getSharedPreferences(SHARED_PREFERENCES_NAME, Context.MODE_WORLD_READABLE);
String tileName = prefs.getString(MAP_TILE_SOURCES, null);
- if(tileName != null){
+ if (tileName != null) {
return tileName;
}
return TileSourceManager.getMapnikSource().getName();
@@ -181,14 +198,15 @@ public class OsmandSettings {
public static final String LAST_KNOWN_MAP_LON = "last_known_map_lon";
public static final String IS_MAP_SYNC_TO_GPS_LOCATION = "is_map_sync_to_gps_location";
public static final String LAST_KNOWN_MAP_ZOOM = "last_known_map_zoom";
- public static LatLon getLastKnownMapLocation(Context ctx){
+
+ public static LatLon getLastKnownMapLocation(Context ctx) {
SharedPreferences prefs = ctx.getSharedPreferences(SHARED_PREFERENCES_NAME, Context.MODE_WORLD_READABLE);
float lat = prefs.getFloat(LAST_KNOWN_MAP_LAT, 0);
float lon = prefs.getFloat(LAST_KNOWN_MAP_LON, 0);
return new LatLon(lat, lon);
}
-
- public static void setMapLocationToShow(Context ctx, double latitude, double longitude){
+
+ public static void setMapLocationToShow(Context ctx, double latitude, double longitude) {
SharedPreferences prefs = ctx.getSharedPreferences(SHARED_PREFERENCES_NAME, Context.MODE_WORLD_READABLE);
Editor edit = prefs.edit();
edit.putFloat(LAST_KNOWN_MAP_LAT, (float) latitude);
@@ -196,151 +214,151 @@ public class OsmandSettings {
edit.putBoolean(IS_MAP_SYNC_TO_GPS_LOCATION, false);
edit.commit();
}
-
- // Do not use that method if you want to show point on map. Use setMapLocationToShow
- public static void setLastKnownMapLocation(Context ctx, double latitude, double longitude){
+
+ // Do not use that method if you want to show point on map. Use setMapLocationToShow
+ public static void setLastKnownMapLocation(Context ctx, double latitude, double longitude) {
SharedPreferences prefs = ctx.getSharedPreferences(SHARED_PREFERENCES_NAME, Context.MODE_WORLD_READABLE);
Editor edit = prefs.edit();
edit.putFloat(LAST_KNOWN_MAP_LAT, (float) latitude);
edit.putFloat(LAST_KNOWN_MAP_LON, (float) longitude);
edit.commit();
}
-
- public static boolean setSyncMapToGpsLocation(Context ctx, boolean value){
+
+ public static boolean setSyncMapToGpsLocation(Context ctx, boolean value) {
SharedPreferences prefs = ctx.getSharedPreferences(SHARED_PREFERENCES_NAME, Context.MODE_WORLD_READABLE);
return prefs.edit().putBoolean(IS_MAP_SYNC_TO_GPS_LOCATION, value).commit();
}
- public static boolean isMapSyncToGpsLocation(Context ctx){
+
+ public static boolean isMapSyncToGpsLocation(Context ctx) {
SharedPreferences prefs = ctx.getSharedPreferences(SHARED_PREFERENCES_NAME, Context.MODE_WORLD_READABLE);
return prefs.getBoolean(IS_MAP_SYNC_TO_GPS_LOCATION, true);
}
-
- public static int getLastKnownMapZoom(Context ctx){
+
+ public static int getLastKnownMapZoom(Context ctx) {
SharedPreferences prefs = ctx.getSharedPreferences(SHARED_PREFERENCES_NAME, Context.MODE_WORLD_READABLE);
return prefs.getInt(LAST_KNOWN_MAP_ZOOM, 3);
}
-
- public static void setLastKnownMapZoom(Context ctx, int zoom){
+
+ public static void setLastKnownMapZoom(Context ctx, int zoom) {
SharedPreferences prefs = ctx.getSharedPreferences(SHARED_PREFERENCES_NAME, Context.MODE_WORLD_READABLE);
Editor edit = prefs.edit();
edit.putInt(LAST_KNOWN_MAP_ZOOM, zoom);
edit.commit();
}
-
-
+
public final static String POINT_NAVIGATE_LAT = "point_navigate_lat";
public final static String POINT_NAVIGATE_LON = "point_navigate_lon";
-
- public static LatLon getPointToNavigate(Context ctx){
+
+ public static LatLon getPointToNavigate(Context ctx) {
SharedPreferences prefs = ctx.getSharedPreferences(SHARED_PREFERENCES_NAME, Context.MODE_WORLD_READABLE);
float lat = prefs.getFloat(POINT_NAVIGATE_LAT, 0);
float lon = prefs.getFloat(POINT_NAVIGATE_LON, 0);
- if(lat == 0 && lon == 0){
+ if (lat == 0 && lon == 0) {
return null;
}
return new LatLon(lat, lon);
}
-
- public static boolean clearPointToNavigate(Context ctx){
+
+ public static boolean clearPointToNavigate(Context ctx) {
SharedPreferences prefs = ctx.getSharedPreferences(SHARED_PREFERENCES_NAME, Context.MODE_WORLD_READABLE);
return prefs.edit().remove(POINT_NAVIGATE_LAT).remove(POINT_NAVIGATE_LON).commit();
}
-
- public static boolean setPointToNavigate(Context ctx, double latitude, double longitude){
+
+ public static boolean setPointToNavigate(Context ctx, double latitude, double longitude) {
SharedPreferences prefs = ctx.getSharedPreferences(SHARED_PREFERENCES_NAME, Context.MODE_WORLD_READABLE);
return prefs.edit().putFloat(POINT_NAVIGATE_LAT, (float) latitude).putFloat(POINT_NAVIGATE_LON, (float) longitude).commit();
}
-
+
public static final String LAST_SEARCHED_REGION = "last_searched_region";
public static final String LAST_SEARCHED_CITY = "last_searched_city";
public static final String LAST_SEARCHED_STREET = "last_searched_street";
public static final String LAST_SEARCHED_BUILDING = "last_searched_building";
public static final String LAST_SEARCHED_INTERSECTED_STREET = "last_searched_intersected_street";
-
- public static String getLastSearchedRegion(Context ctx){
+
+ public static String getLastSearchedRegion(Context ctx) {
SharedPreferences prefs = ctx.getSharedPreferences(SHARED_PREFERENCES_NAME, Context.MODE_WORLD_READABLE);
return prefs.getString(LAST_SEARCHED_REGION, "");
}
-
+
public static boolean setLastSearchedRegion(Context ctx, String region) {
SharedPreferences prefs = ctx.getSharedPreferences(SHARED_PREFERENCES_NAME, Context.MODE_WORLD_READABLE);
- Editor edit = prefs.edit().putString(LAST_SEARCHED_REGION, region).putLong(LAST_SEARCHED_CITY, -1).
- putString(LAST_SEARCHED_STREET,"").putString(LAST_SEARCHED_BUILDING, "");
+ Editor edit = prefs.edit().putString(LAST_SEARCHED_REGION, region).putLong(LAST_SEARCHED_CITY, -1).putString(LAST_SEARCHED_STREET,
+ "").putString(LAST_SEARCHED_BUILDING, "");
if (prefs.contains(LAST_SEARCHED_INTERSECTED_STREET)) {
edit.putString(LAST_SEARCHED_INTERSECTED_STREET, "");
}
return edit.commit();
}
- public static Long getLastSearchedCity(Context ctx){
+ public static Long getLastSearchedCity(Context ctx) {
SharedPreferences prefs = ctx.getSharedPreferences(SHARED_PREFERENCES_NAME, Context.MODE_WORLD_READABLE);
return prefs.getLong(LAST_SEARCHED_CITY, -1);
}
-
- public static boolean setLastSearchedCity(Context ctx, Long cityId){
+
+ public static boolean setLastSearchedCity(Context ctx, Long cityId) {
SharedPreferences prefs = ctx.getSharedPreferences(SHARED_PREFERENCES_NAME, Context.MODE_WORLD_READABLE);
- Editor edit = prefs.edit().putLong(LAST_SEARCHED_CITY, cityId).putString(LAST_SEARCHED_STREET, "").
- putString(LAST_SEARCHED_BUILDING, "");
- if(prefs.contains(LAST_SEARCHED_INTERSECTED_STREET)){
+ Editor edit = prefs.edit().putLong(LAST_SEARCHED_CITY, cityId).putString(LAST_SEARCHED_STREET, "").putString(
+ LAST_SEARCHED_BUILDING, "");
+ if (prefs.contains(LAST_SEARCHED_INTERSECTED_STREET)) {
edit.putString(LAST_SEARCHED_INTERSECTED_STREET, "");
}
return edit.commit();
}
- public static String getLastSearchedStreet(Context ctx){
+ public static String getLastSearchedStreet(Context ctx) {
SharedPreferences prefs = ctx.getSharedPreferences(SHARED_PREFERENCES_NAME, Context.MODE_WORLD_READABLE);
return prefs.getString(LAST_SEARCHED_STREET, "");
}
-
- public static boolean setLastSearchedStreet(Context ctx, String street){
+
+ public static boolean setLastSearchedStreet(Context ctx, String street) {
SharedPreferences prefs = ctx.getSharedPreferences(SHARED_PREFERENCES_NAME, Context.MODE_WORLD_READABLE);
Editor edit = prefs.edit().putString(LAST_SEARCHED_STREET, street).putString(LAST_SEARCHED_BUILDING, "");
- if(prefs.contains(LAST_SEARCHED_INTERSECTED_STREET)){
+ if (prefs.contains(LAST_SEARCHED_INTERSECTED_STREET)) {
edit.putString(LAST_SEARCHED_INTERSECTED_STREET, "");
}
return edit.commit();
}
-
- public static String getLastSearchedBuilding(Context ctx){
+
+ public static String getLastSearchedBuilding(Context ctx) {
SharedPreferences prefs = ctx.getSharedPreferences(SHARED_PREFERENCES_NAME, Context.MODE_WORLD_READABLE);
return prefs.getString(LAST_SEARCHED_BUILDING, "");
}
-
- public static boolean setLastSearchedBuilding(Context ctx, String building){
+
+ public static boolean setLastSearchedBuilding(Context ctx, String building) {
SharedPreferences prefs = ctx.getSharedPreferences(SHARED_PREFERENCES_NAME, Context.MODE_WORLD_READABLE);
return prefs.edit().putString(LAST_SEARCHED_BUILDING, building).remove(LAST_SEARCHED_INTERSECTED_STREET).commit();
}
-
-
- public static String getLastSearchedIntersectedStreet(Context ctx){
+
+ public static String getLastSearchedIntersectedStreet(Context ctx) {
SharedPreferences prefs = ctx.getSharedPreferences(SHARED_PREFERENCES_NAME, Context.MODE_WORLD_READABLE);
- if(!prefs.contains(LAST_SEARCHED_INTERSECTED_STREET)){
+ if (!prefs.contains(LAST_SEARCHED_INTERSECTED_STREET)) {
return null;
}
return prefs.getString(LAST_SEARCHED_INTERSECTED_STREET, "");
}
-
- public static boolean setLastSearchedIntersectedStreet(Context ctx, String street){
+
+ public static boolean setLastSearchedIntersectedStreet(Context ctx, String street) {
SharedPreferences prefs = ctx.getSharedPreferences(SHARED_PREFERENCES_NAME, Context.MODE_WORLD_READABLE);
return prefs.edit().putString(LAST_SEARCHED_INTERSECTED_STREET, street).commit();
}
-
- public static boolean removeLastSearchedIntersectedStreet(Context ctx){
+
+ public static boolean removeLastSearchedIntersectedStreet(Context ctx) {
SharedPreferences prefs = ctx.getSharedPreferences(SHARED_PREFERENCES_NAME, Context.MODE_WORLD_READABLE);
return prefs.edit().remove(LAST_SEARCHED_INTERSECTED_STREET).commit();
}
public static final String SELECTED_POI_FILTER_FOR_MAP = "selected_poi_filter_for_map";
- public static boolean setPoiFilterForMap(Context ctx, String filterId){
+
+ public static boolean setPoiFilterForMap(Context ctx, String filterId) {
SharedPreferences prefs = ctx.getSharedPreferences(SHARED_PREFERENCES_NAME, Context.MODE_WORLD_READABLE);
return prefs.edit().putString(SELECTED_POI_FILTER_FOR_MAP, filterId).commit();
}
-
- public static PoiFilter getPoiFilterForMap(Context ctx){
+
+ public static PoiFilter getPoiFilterForMap(Context ctx) {
SharedPreferences prefs = ctx.getSharedPreferences(SHARED_PREFERENCES_NAME, Context.MODE_WORLD_READABLE);
String filterId = prefs.getString(SELECTED_POI_FILTER_FOR_MAP, null);
PoiFilter filter = PoiFiltersHelper.getFilterById(ctx, filterId);
- if(filter != null){
+ if (filter != null) {
return filter;
}
return new PoiFilter(null);
diff --git a/OsmAnd/src/com/osmand/activities/SettingsActivity.java b/OsmAnd/src/com/osmand/activities/SettingsActivity.java
index e3f6d9d0f4..4ae755a4de 100644
--- a/OsmAnd/src/com/osmand/activities/SettingsActivity.java
+++ b/OsmAnd/src/com/osmand/activities/SettingsActivity.java
@@ -5,6 +5,7 @@ import java.util.List;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
+import android.content.res.Resources;
import android.os.Bundle;
import android.preference.CheckBoxPreference;
import android.preference.EditTextPreference;
@@ -76,7 +77,6 @@ public class SettingsActivity extends PreferenceActivity implements OnPreference
tileSourcePreference =(ListPreference) screen.findPreference(OsmandSettings.MAP_TILE_SOURCES);
tileSourcePreference.setOnPreferenceChangeListener(this);
-
}
@Override
@@ -94,7 +94,9 @@ public class SettingsActivity extends PreferenceActivity implements OnPreference
saveTrackToGpx.setChecked(OsmandSettings.isSavingTrackToGpx(this));
useEnglishNames.setChecked(OsmandSettings.usingEnglishNames(this));
autoZoom.setChecked(OsmandSettings.isAutoZoomEnabled(this));
- String[] e = new String[] { "Center", "Bottom" };
+ Resources resources = this.getResources();
+ String[] e = new String[] {resources.getString(R.string.position_on_map_center),
+ resources.getString(R.string.position_on_map_bottom)};
positionOnMap.setEntryValues(e);
positionOnMap.setEntries(e);
positionOnMap.setValueIndex(OsmandSettings.getPositionOnMap(this));
@@ -108,7 +110,7 @@ public class SettingsActivity extends PreferenceActivity implements OnPreference
String[] values = new String[presets.length];
String[] valueEntries = new String[presets.length];
for(int i=0; i