From 01662401f0798e6e6b83ccd6c3610f14a26c02da Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Tue, 6 Jul 2010 09:34:05 +0000 Subject: [PATCH] fix small issues git-svn-id: https://osmand.googlecode.com/svn/trunk@289 e29c36b1-1cfa-d876-8d93-3434fc2bb7b8 --- .../src/com/osmand/ToDoConstants.java | 4 +- OsmAnd/res/drawable/closed_poi.png | Bin 1038 -> 1742 bytes OsmAnd/src/com/osmand/OsmandSettings.java | 32 ++-- .../osmand/activities/SettingsActivity.java | 156 +++++++++--------- 4 files changed, 101 insertions(+), 91 deletions(-) diff --git a/DataExtractionOSM/src/com/osmand/ToDoConstants.java b/DataExtractionOSM/src/com/osmand/ToDoConstants.java index 69b9b99582..7cc98b20dd 100644 --- a/DataExtractionOSM/src/com/osmand/ToDoConstants.java +++ b/DataExtractionOSM/src/com/osmand/ToDoConstants.java @@ -40,8 +40,8 @@ public class ToDoConstants { // FIXME BUGS Android // double tap to zoom [done] // forbid rotate map to landscape [ done] - - // REFACTOR Settings activity ( for check box properties!) + // REFACTOR Settings activity ( for check box properties!) [partially done] + // show POI choose near by or last map selection. // Show poi direction (using sensor) // hide center point (enable only when trackball using) diff --git a/OsmAnd/res/drawable/closed_poi.png b/OsmAnd/res/drawable/closed_poi.png index e4e97be1b1c1a6105a5bdbc0e06fa966de926789..e1819ca1c1246444f8ec10158f586b92d5a685f7 100644 GIT binary patch delta 1737 zcmV;)1~&PQ2+j?V8Gi-<00374`G)`i00eVFNmK|32nc)#WQYI&010qNS#tmY1HAwM z1HAz*^kO~$000?uMObuGZ)S9NVRB^vcXxL#X>MzCV_|S*E^l&Yo9;Xs000I{NklAdo`{1PZ0(5<&^# zT|x-t6mlp8auif51?xpbR1jJP(bQUPZS`R6A?d%gZ+B)qyv%#EvopJ!q^-K}W8d5C zoB4ize|C0e!i+Ik^)WIcL9`u2yFs)IjBNsAH2^gL5&*%N8!+ZCXgvq5|AN-nFf?>~ zwOz9n1Dra=!GHO4;QU2!z7s?eLBj~7-OKdUa}NQ%|fa3Q0iw459>z* zFgVx=Ar3=`m%#ZZaL!w1#oMzFptWwDl~Rt~M4Dbentq9T{oca^7#utVA&x+ZP6#0& zgvf~JoL2%+N@XC@G+nZJr0J)q*MEAj00RSSA;epd@_zt?5Rg)WbDjaP5Y_;+AZ#b? z^vOmbO;aePkR%DxG)0nJM4Fz%=;*@g0ZyLW11XO}%8igxwmct#@N2*Y@M|C@z6p>Z zN$wy?KET-6^_2shII#~>z5^+1kW#kH0{9Vd>!1iAoBygMx-H(?B9i1IjE`SgKEUzg zyHTsX2Y)F$P^%RK*t1&)F#tFJt@mR9jYb1WavzPx8B9!E4#}jT`2POw;QS~!mpKo+ zf?W{zvkMyok2xW45}dz{{{CIn0Q&kifb(PEydx+)W@X}I5FyJ$2yp%e`uaM3xgw85 zuYsteRght?@SNxTVh*K{)*3_vrBpM484DIT=YPC)R!S{tSqGxm0i2CTpttu)5bX{Y zW)VazJ$%pmkt#}^P@hD5(A#@34A9e41JNtF=Xt21hm}Gh2ww-$%joIp$fpp|^B`K^ z8cAbTC6(Oqz^0H*51U%C)M=+o-kREKAUXix`*sAny9tavT}f~#yeoYQRY}t@$g}9~ zrhj$>7~27&wVC&rEOi{p6%!hj0j${jAsx;0dN8&Zz-0@tFDJe%m0}?7pymVEc3tsh zX%o`abj1E9Kv&lqbad>@jGk3s%4)%m$hHQQQaSM!Ae1U$(XPI&=<4DEjBNoxIpNER zNGu92fbabx&&R}P#}@))o5j-fFZ=G|(|=Y?D?b`;3R&^?J*Y~$_?FkURRGu+y&(qU zLKQ_J2H>YmQ6EK`fGy1k*rVzXi$E-ljRF8DrCN1RMR*l0&1>rffDO4nWGVCC%Rp>2 zq?E1S+ow=f;V~WAYeMAy;2)tMhZ^$**eF=>X_^*#vr1q2Yk~lzxtsn!2N!SwLVwdU z|61s~HTS!nX#wpT@b9V8cCj960>m0~uf+t!ChYbJWC83{(k`uptgPSswVMLQ+$r^D zRpBlGV+>k1SKI70|Gp|9MNu zRTAwk3&zZ*jsWeNCZ-v=MqrEo-5Q{<#BBZAY zqhZV(VP-}_>$x0lnfTD+l)KL9ue90EK12*A2GQ1c9Wyic#FB?D!k8VEJ?=xeqpSU0 zXg&~%LRm`1VJ-o7MrOA`k+v zA~+j`+tB(uE4w{fo<7}x)?Wu32^FkwW!{fP!L>4&=C!YI`g9`?002`{v(Wmt(v*pB zO!#a3S>ZltEDEtcwZ4j}sefNx$@#TWtv`p>+o83{rA$%kxKEqx+%>y4YQ?$2V-VRW z+=td*_;T~B)02~nQ0g-%m2Wf@_6M0lu~bs(K9o9x$;n&3+@cMRr%n+pM!l)3X>Iy;~-2xf|UFA;g;yV$(y~=w3vco#uf%E;~{4h8_03wmA0UsdyVwgaw zYf$Q2DD?w|ht*1CtU?^XJw`^>gJ>s+wt;9X7~2NMHUrQA5&#Vt(||Ga(E4|1eHB{& fiJ_rnwO#)MuLug~IZrFO00000NkvXXu0mjf5`HA& literal 1038 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA3?vioaBgK_U}gyL332@o1b6QIKYslGfdl_f zpZ;%U_21t9|Ah4miey*BrGC$WRpdjd!V0Y!3 zR}qJEHLtI@x5fQ))xq+)2h&Tq=PL8a*qhFjvo|cfdr+}{{RWnJsXS3l#|7NI(@%Y} z?}}k`mfXp-FIAvs1meRO!J+|BQ5S0>L>w$Dmr-<*;=YwV?kowR#*7#`FII+?-K)z4*}Q$iB}^-^|J diff --git a/OsmAnd/src/com/osmand/OsmandSettings.java b/OsmAnd/src/com/osmand/OsmandSettings.java index 48556cf7c8..27050c7618 100644 --- a/OsmAnd/src/com/osmand/OsmandSettings.java +++ b/OsmAnd/src/com/osmand/OsmandSettings.java @@ -45,19 +45,21 @@ public class OsmandSettings { // 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"; //$NON-NLS-1$ + public static final boolean USE_INTERNET_TO_DOWNLOAD_TILES_DEF = true; 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); + return prefs.getBoolean(USE_INTERNET_TO_DOWNLOAD_TILES, USE_INTERNET_TO_DOWNLOAD_TILES_DEF); } // this value string is synchronized with settings_pref.xml preference name public static final String SHOW_POI_OVER_MAP = "show_poi_over_map"; //$NON-NLS-1$ + public static final Boolean SHOW_POI_OVER_MAP_DEF = false; 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); + return prefs.getBoolean(SHOW_POI_OVER_MAP, SHOW_POI_OVER_MAP_DEF); } public static boolean setShowPoiOverMap(Context ctx, boolean val) { @@ -67,10 +69,11 @@ public class OsmandSettings { // this value string is synchronized with settings_pref.xml preference name public static final String SHOW_TRANSPORT_OVER_MAP = "show_transport_over_map"; //$NON-NLS-1$ + public static final boolean SHOW_TRANSPORT_OVER_MAP_DEF = false; public static boolean isShowingTransportOverMap(Context ctx) { SharedPreferences prefs = ctx.getSharedPreferences(SHARED_PREFERENCES_NAME, Context.MODE_WORLD_READABLE); - return prefs.getBoolean(SHOW_TRANSPORT_OVER_MAP, false); + return prefs.getBoolean(SHOW_TRANSPORT_OVER_MAP, SHOW_TRANSPORT_OVER_MAP_DEF); } public static boolean setShowTransortOverMap(Context ctx, boolean val) { @@ -145,10 +148,11 @@ public class OsmandSettings { // this value string is synchronized with settings_pref.xml preference name public static final String SAVE_TRACK_TO_GPX = "save_track_to_gpx"; //$NON-NLS-1$ + public static final boolean SAVE_TRACK_TO_GPX_DEF = false; 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); + return prefs.getBoolean(SAVE_TRACK_TO_GPX, SAVE_TRACK_TO_GPX_DEF); } // this value string is synchronized with settings_pref.xml preference name @@ -161,10 +165,11 @@ public class OsmandSettings { // this value string is synchronized with settings_pref.xml preference name public static final String SHOW_OSM_BUGS = "show_osm_bugs"; //$NON-NLS-1$ + public static final boolean SHOW_OSM_BUGS_DEF = false; public static boolean isShowingOsmBugs(Context ctx) { SharedPreferences prefs = ctx.getSharedPreferences(SHARED_PREFERENCES_NAME, Context.MODE_WORLD_READABLE); - return prefs.getBoolean(SHOW_OSM_BUGS, false); + return prefs.getBoolean(SHOW_OSM_BUGS, SHOW_OSM_BUGS_DEF); } // this value string is synchronized with settings_pref.xml preference name @@ -177,26 +182,29 @@ public class OsmandSettings { // this value string is synchronized with settings_pref.xml preference name public static final String SHOW_VIEW_ANGLE = "show_view_angle"; //$NON-NLS-1$ + public static final boolean SHOW_VIEW_ANGLE_DEF = false; public static boolean isShowingViewAngle(Context ctx) { SharedPreferences prefs = ctx.getSharedPreferences(SHARED_PREFERENCES_NAME, Context.MODE_WORLD_READABLE); - return prefs.getBoolean(SHOW_VIEW_ANGLE, false); + return prefs.getBoolean(SHOW_VIEW_ANGLE, SHOW_VIEW_ANGLE_DEF); } // this value string is synchronized with settings_pref.xml preference name public static final String AUTO_ZOOM_MAP = "auto_zoom_map"; //$NON-NLS-1$ + public static final boolean AUTO_ZOOM_MAP_DEF = false; public static boolean isAutoZoomEnabled(Context ctx) { SharedPreferences prefs = ctx.getSharedPreferences(SHARED_PREFERENCES_NAME, Context.MODE_WORLD_READABLE); - return prefs.getBoolean(AUTO_ZOOM_MAP, false); + return prefs.getBoolean(AUTO_ZOOM_MAP, AUTO_ZOOM_MAP_DEF); } // this value string is synchronized with settings_pref.xml preference name public static final String ROTATE_MAP_TO_BEARING = "rotate_map_to_bearing"; //$NON-NLS-1$ - + public static final boolean ROTATE_MAP_TO_BEARING_DEF = false; + 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); + return prefs.getBoolean(ROTATE_MAP_TO_BEARING, ROTATE_MAP_TO_BEARING_DEF); } // this value string is synchronized with settings_pref.xml preference name @@ -217,18 +225,20 @@ public class OsmandSettings { // this value string is synchronized with settings_pref.xml preference name public static final String MAP_VIEW_3D = "map_view_3d"; //$NON-NLS-1$ + public static final boolean MAP_VIEW_3D_DEF = false; public static boolean isMapView3D(Context ctx) { SharedPreferences prefs = ctx.getSharedPreferences(SHARED_PREFERENCES_NAME, Context.MODE_WORLD_READABLE); - return prefs.getBoolean(MAP_VIEW_3D, false); + return prefs.getBoolean(MAP_VIEW_3D, MAP_VIEW_3D_DEF); } // this value string is synchronized with settings_pref.xml preference name public static final String USE_ENGLISH_NAMES = "use_english_names"; //$NON-NLS-1$ + public static final boolean USE_ENGLISH_NAMES_DEF = false; public static boolean usingEnglishNames(Context ctx) { SharedPreferences prefs = ctx.getSharedPreferences(SHARED_PREFERENCES_NAME, Context.MODE_WORLD_READABLE); - return prefs.getBoolean(USE_ENGLISH_NAMES, false); + return prefs.getBoolean(USE_ENGLISH_NAMES, USE_ENGLISH_NAMES_DEF); } public static boolean setUseEnglishNames(Context ctx, boolean useEnglishNames) { diff --git a/OsmAnd/src/com/osmand/activities/SettingsActivity.java b/OsmAnd/src/com/osmand/activities/SettingsActivity.java index 729badcb85..57d9c35a54 100644 --- a/OsmAnd/src/com/osmand/activities/SettingsActivity.java +++ b/OsmAnd/src/com/osmand/activities/SettingsActivity.java @@ -32,28 +32,61 @@ import com.osmand.map.TileSourceManager.TileSourceTemplate; public class SettingsActivity extends PreferenceActivity implements OnPreferenceChangeListener, OnPreferenceClickListener { - private CheckBoxPreference showPoiOnMap; - private CheckBoxPreference useInternetToDownloadTiles; - private ListPreference tileSourcePreference; - private CheckBoxPreference rotateMapToBearing; - private CheckBoxPreference showViewAngle; - private ListPreference positionOnMap; - private CheckBoxPreference useEnglishNames; - private CheckBoxPreference showOsmBugs; - private EditTextPreference userName; - private CheckBoxPreference saveTrackToGpx; - private ListPreference saveTrackInterval; - private Preference saveCurrentTrack; - private ListPreference applicationMode; - private CheckBoxPreference autoZoom; + private class BooleanPreference { + private final boolean defValue; + private final String id; + private CheckBoxPreference pref; + + public BooleanPreference(String id, boolean defValue){ + this.id = id; + this.defValue = defValue; + } + + public String getId() { + return id; + } + + public boolean getDefValue() { + return defValue; + } + + public void setPref(CheckBoxPreference pref) { + this.pref = pref; + } + public CheckBoxPreference getPref() { + return pref; + } + } + private EditTextPreference userPassword; + private EditTextPreference userName; + + private Preference saveCurrentTrack; private Preference reloadIndexes; private Preference downloadIndexes; + + private ListPreference applicationMode; + private ListPreference saveTrackInterval; + private ListPreference tileSourcePreference; + private ListPreference positionOnMap; private ListPreference routerPreference; private ListPreference maxLevelToDownload; - private CheckBoxPreference showTransport; private ListPreference mapScreenOrientation; + + + private BooleanPreference[] booleanPreferences = new BooleanPreference[]{ + new BooleanPreference(OsmandSettings.SHOW_POI_OVER_MAP, OsmandSettings.SHOW_POI_OVER_MAP_DEF ), + new BooleanPreference(OsmandSettings.USE_INTERNET_TO_DOWNLOAD_TILES, OsmandSettings.USE_INTERNET_TO_DOWNLOAD_TILES_DEF), + new BooleanPreference(OsmandSettings.ROTATE_MAP_TO_BEARING, OsmandSettings.ROTATE_MAP_TO_BEARING_DEF), + new BooleanPreference(OsmandSettings.SHOW_VIEW_ANGLE, OsmandSettings.SHOW_VIEW_ANGLE_DEF), + new BooleanPreference(OsmandSettings.USE_ENGLISH_NAMES, OsmandSettings.USE_ENGLISH_NAMES_DEF), + new BooleanPreference(OsmandSettings.SHOW_OSM_BUGS, OsmandSettings.SHOW_OSM_BUGS_DEF), + new BooleanPreference(OsmandSettings.AUTO_ZOOM_MAP, OsmandSettings.AUTO_ZOOM_MAP_DEF), + new BooleanPreference(OsmandSettings.SHOW_TRANSPORT_OVER_MAP, OsmandSettings.SHOW_TRANSPORT_OVER_MAP_DEF), + new BooleanPreference(OsmandSettings.SAVE_TRACK_TO_GPX, OsmandSettings.SAVE_TRACK_TO_GPX_DEF), + }; + @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); @@ -63,41 +96,27 @@ public class SettingsActivity extends PreferenceActivity implements OnPreference applicationMode =(ListPreference) screen.findPreference(OsmandSettings.APPLICATION_MODE); applicationMode.setOnPreferenceChangeListener(this); - useInternetToDownloadTiles = (CheckBoxPreference) screen.findPreference(OsmandSettings.USE_INTERNET_TO_DOWNLOAD_TILES); - useInternetToDownloadTiles.setOnPreferenceChangeListener(this); - showPoiOnMap =(CheckBoxPreference) screen.findPreference(OsmandSettings.SHOW_POI_OVER_MAP); - showPoiOnMap.setOnPreferenceChangeListener(this); - rotateMapToBearing =(CheckBoxPreference) screen.findPreference(OsmandSettings.ROTATE_MAP_TO_BEARING); - rotateMapToBearing.setOnPreferenceChangeListener(this); - showViewAngle =(CheckBoxPreference) screen.findPreference(OsmandSettings.SHOW_VIEW_ANGLE); - showViewAngle.setOnPreferenceChangeListener(this); - autoZoom =(CheckBoxPreference) screen.findPreference(OsmandSettings.AUTO_ZOOM_MAP); - autoZoom.setOnPreferenceChangeListener(this); - showOsmBugs =(CheckBoxPreference) screen.findPreference(OsmandSettings.SHOW_OSM_BUGS); - showOsmBugs.setOnPreferenceChangeListener(this); - showTransport =(CheckBoxPreference) screen.findPreference(OsmandSettings.SHOW_TRANSPORT_OVER_MAP); - showTransport.setOnPreferenceChangeListener(this); + for(BooleanPreference b : booleanPreferences){ + CheckBoxPreference p = (CheckBoxPreference) screen.findPreference(b.getId()); + p.setOnPreferenceChangeListener(this); + b.setPref(p); + } - useEnglishNames =(CheckBoxPreference) screen.findPreference(OsmandSettings.USE_ENGLISH_NAMES); - useEnglishNames.setOnPreferenceChangeListener(this); reloadIndexes =(Preference) screen.findPreference(OsmandSettings.RELOAD_INDEXES); reloadIndexes.setOnPreferenceClickListener(this); downloadIndexes =(Preference) screen.findPreference(OsmandSettings.DOWNLOAD_INDEXES); downloadIndexes.setOnPreferenceClickListener(this); + saveCurrentTrack =(Preference) screen.findPreference(OsmandSettings.SAVE_CURRENT_TRACK); + saveCurrentTrack.setOnPreferenceClickListener(this); userName = (EditTextPreference) screen.findPreference(OsmandSettings.USER_NAME); userName.setOnPreferenceChangeListener(this); userPassword = (EditTextPreference) screen.findPreference(OsmandSettings.USER_PASSWORD); userPassword.setOnPreferenceChangeListener(this); - saveTrackToGpx =(CheckBoxPreference) screen.findPreference(OsmandSettings.SAVE_TRACK_TO_GPX); - saveTrackToGpx.setOnPreferenceChangeListener(this); + saveTrackInterval =(ListPreference) screen.findPreference(OsmandSettings.SAVE_TRACK_INTERVAL); saveTrackInterval.setOnPreferenceChangeListener(this); - saveCurrentTrack =(Preference) screen.findPreference(OsmandSettings.SAVE_CURRENT_TRACK); - saveCurrentTrack.setOnPreferenceClickListener(this); - - positionOnMap =(ListPreference) screen.findPreference(OsmandSettings.POSITION_ON_MAP); positionOnMap.setOnPreferenceChangeListener(this); mapScreenOrientation =(ListPreference) screen.findPreference(OsmandSettings.MAP_SCREEN_ORIENTATION); @@ -118,15 +137,10 @@ public class SettingsActivity extends PreferenceActivity implements OnPreference } public void updateAllSettings(){ - useInternetToDownloadTiles.setChecked(OsmandSettings.isUsingInternetToDownloadTiles(this)); - showPoiOnMap.setChecked(OsmandSettings.isShowingPoiOverMap(this)); - rotateMapToBearing.setChecked(OsmandSettings.isRotateMapToBearing(this)); - showViewAngle.setChecked(OsmandSettings.isShowingViewAngle(this)); - showOsmBugs.setChecked(OsmandSettings.isShowingOsmBugs(this)); - showTransport.setChecked(OsmandSettings.isShowingTransportOverMap(this)); - saveTrackToGpx.setChecked(OsmandSettings.isSavingTrackToGpx(this)); - useEnglishNames.setChecked(OsmandSettings.usingEnglishNames(this)); - autoZoom.setChecked(OsmandSettings.isAutoZoomEnabled(this)); + SharedPreferences prefs = getSharedPreferences(OsmandSettings.SHARED_PREFERENCES_NAME, Context.MODE_WORLD_READABLE); + for(BooleanPreference b : booleanPreferences){ + b.getPref().setChecked(prefs.getBoolean(b.getId(), b.getDefValue())); + } userName.setText(OsmandSettings.getUserName(this)); userPassword.setText(OsmandSettings.getUserPassword(this)); @@ -214,35 +228,27 @@ public class SettingsActivity extends PreferenceActivity implements OnPreference public boolean onPreferenceChange(Preference preference, Object newValue) { SharedPreferences prefs = getSharedPreferences(OsmandSettings.SHARED_PREFERENCES_NAME, Context.MODE_WORLD_READABLE); Editor edit = prefs.edit(); - if(preference == applicationMode){ + // handle boolean prefences + BooleanPreference p = null; + for(BooleanPreference b : booleanPreferences){ + if(b.getPref() == preference){ + p = b; + break; + } + } + if(p != null){ + edit.putBoolean(p.getId(), (Boolean)newValue); + if(p.getId() == OsmandSettings.SHOW_POI_OVER_MAP && ((Boolean) newValue)){ + edit.putString(OsmandSettings.SELECTED_POI_FILTER_FOR_MAP, PoiFiltersHelper.getOsmDefinedFilterId(null)); + } + + edit.commit(); + + } else if(preference == applicationMode){ edit.putString(OsmandSettings.APPLICATION_MODE, (String) newValue); setAppMode(ApplicationMode.valueOf(newValue.toString()), edit); edit.commit(); updateAllSettings(); - } else if(preference == autoZoom){ - edit.putBoolean(OsmandSettings.AUTO_ZOOM_MAP, (Boolean) newValue); - edit.commit(); - } else if(preference == showTransport){ - edit.putBoolean(OsmandSettings.SHOW_TRANSPORT_OVER_MAP, (Boolean) newValue); - edit.commit(); - } else if(preference == showPoiOnMap){ - edit.putBoolean(OsmandSettings.SHOW_POI_OVER_MAP, (Boolean) newValue); - if((Boolean)newValue){ - edit.putString(OsmandSettings.SELECTED_POI_FILTER_FOR_MAP, PoiFiltersHelper.getOsmDefinedFilterId(null)); - } - edit.commit(); - } else if(preference == useInternetToDownloadTiles){ - edit.putBoolean(OsmandSettings.USE_INTERNET_TO_DOWNLOAD_TILES, (Boolean) newValue); - edit.commit(); - } else if(preference == rotateMapToBearing){ - edit.putBoolean(OsmandSettings.ROTATE_MAP_TO_BEARING, (Boolean) newValue); - edit.commit(); - } else if(preference == useEnglishNames){ - edit.putBoolean(OsmandSettings.USE_ENGLISH_NAMES, (Boolean) newValue); - edit.commit(); - } else if(preference == saveTrackToGpx){ - edit.putBoolean(OsmandSettings.SAVE_TRACK_TO_GPX, (Boolean) newValue); - edit.commit(); } else if(preference == mapScreenOrientation){ edit.putInt(OsmandSettings.MAP_SCREEN_ORIENTATION, Integer.parseInt(newValue.toString())); edit.commit(); @@ -255,12 +261,7 @@ public class SettingsActivity extends PreferenceActivity implements OnPreference } else if(preference == userName){ edit.putString(OsmandSettings.USER_NAME, (String) newValue); edit.commit(); - } else if(preference == showViewAngle){ - edit.putBoolean(OsmandSettings.SHOW_VIEW_ANGLE, (Boolean) newValue); - edit.commit(); - } else if(preference == showOsmBugs){ - edit.putBoolean(OsmandSettings.SHOW_OSM_BUGS, (Boolean) newValue); - edit.commit(); + } else if(preference == positionOnMap){ edit.putInt(OsmandSettings.POSITION_ON_MAP, positionOnMap.findIndexOfValue((String) newValue)); edit.commit(); @@ -406,5 +407,4 @@ public class SettingsActivity extends PreferenceActivity implements OnPreference } return false; } - }