diff --git a/DataExtractionOSM/src/net/osmand/osm/hm-rendering_types.xml b/DataExtractionOSM/src/net/osmand/osm/hm-rendering_types.xml
deleted file mode 100755
index bbe9d18278..0000000000
--- a/DataExtractionOSM/src/net/osmand/osm/hm-rendering_types.xml
+++ /dev/null
@@ -1,627 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/DataExtractionOSM/src/net/osmand/render/default.render.xml b/DataExtractionOSM/src/net/osmand/render/default.render.xml
index 6a57abf918..700616285c 100644
--- a/DataExtractionOSM/src/net/osmand/render/default.render.xml
+++ b/DataExtractionOSM/src/net/osmand/render/default.render.xml
@@ -12,7 +12,7 @@
-
@@ -40,6 +40,7 @@
All-Purpose Renderer (by Hardy Mueller), v023:
- with ShowMoreMapDetails some roads already rendered at lower zooms (travel/orienteering)
- with ShowMoreMapDetails motorways shown blue and trunk roads red, aligned with conventional road atlas
+ (road color scheme intensified on 2012-08-10. Old values commented with PALE-SCHEME)
- with ShowMoreMapDetails map rendering is aligned to typical map use for all zoom levels (scales), to always give a complete and reliable map.
Typical zoom level use (zX) and alignment of features displayed:
- z7 = "Rough Region Level Overview": Shows motorways, trunks, primary roads and city names
@@ -1008,18 +1009,20 @@
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -1030,10 +1033,14 @@
-
-
-
-
+
+
+
+
+
+
+
+
@@ -1044,10 +1051,14 @@
-
-
-
-
+
+
+
+
+
+
+
+
@@ -1064,18 +1075,28 @@
-
+
+
-
+
+
+
+
+
+
+
+
+
+
@@ -1101,10 +1122,14 @@
-
+
+
-
+
+
+
+
diff --git a/OsmAnd/.project b/OsmAnd/.project
index 54da46b446..ad1b540a68 100644
--- a/OsmAnd/.project
+++ b/OsmAnd/.project
@@ -89,6 +89,11 @@
+
+ net.rim.ajde.internal.verifier
+
+
+
com.android.ide.eclipse.adt.AndroidNature
@@ -97,6 +102,7 @@
org.eclipse.cdt.core.ccnature
org.eclipse.cdt.managedbuilder.core.managedBuildNature
org.eclipse.cdt.managedbuilder.core.ScannerConfigNature
+ net.rim.ajde.BlackBerryAndroidNature
diff --git a/OsmAnd/build.xml b/OsmAnd/build.xml
index 1da730ca5a..fb6a33464b 100644
--- a/OsmAnd/build.xml
+++ b/OsmAnd/build.xml
@@ -128,6 +128,14 @@
+
+
+
+
+
+
+
+
@@ -137,6 +145,8 @@
+
+
diff --git a/OsmAnd/res/values/colors.xml b/OsmAnd/res/values/colors.xml
index 7ac556562f..b34115b70a 100644
--- a/OsmAnd/res/values/colors.xml
+++ b/OsmAnd/res/values/colors.xml
@@ -16,7 +16,8 @@
#B4A00AD7
- #B400FFFF
+
diff --git a/OsmAnd/res/values/no_translate.xml b/OsmAnd/res/values/no_translate.xml
index 58a2de04a3..4d7a143b5b 100644
--- a/OsmAnd/res/values/no_translate.xml
+++ b/OsmAnd/res/values/no_translate.xml
@@ -6,5 +6,5 @@
UA-28342846-2
10
true
-
+ +play_market +gps_status -parking_plugin -blackberry -free_version
\ No newline at end of file
diff --git a/OsmAnd/res/values/strings.xml b/OsmAnd/res/values/strings.xml
index fdcab21617..2197614ecd 100644
--- a/OsmAnd/res/values/strings.xml
+++ b/OsmAnd/res/values/strings.xml
@@ -9,6 +9,8 @@
1. All your modified/created strings are in the top of the file (to make easier find what's translated).
PLEASE: Have a look at http://code.google.com/p/osmand/wiki/UIConsistency, it may really improve your and our work :-) Thx - Hardy
-->
+ Live tracking
+ Stop Live tracking
Configure screen…
Show lanes
Avoid unpaved roads
@@ -203,7 +205,6 @@ You can enable (online or cached) tile map sources, tracking settings, and many
Support
Support new features
- Display ruler on the map
Display ruler
Info
@@ -401,7 +402,6 @@ You can enable (online or cached) tile map sources, tracking settings, and many
\n\t- Other small features
- Use transparent map controls
Transparent theme
Native library is not supported on this device.
@@ -991,10 +991,7 @@ You can enable (online or cached) tile map sources, tracking settings, and many
Choose street
Choose city
Choose country
- Choose location of position marker on the map
- Position marker
Set as destination
- Display viewing direction on the map
Display viewing direction
Clear destin.
Set as dest.
diff --git a/OsmAnd/res/xml/settings_pref.xml b/OsmAnd/res/xml/settings_pref.xml
index 1063c54407..1ece7a2c55 100644
--- a/OsmAnd/res/xml/settings_pref.xml
+++ b/OsmAnd/res/xml/settings_pref.xml
@@ -32,7 +32,7 @@
-
+
-
-
diff --git a/OsmAnd/src/net/osmand/Version.java b/OsmAnd/src/net/osmand/Version.java
index 712c9b6f06..75d6435821 100644
--- a/OsmAnd/src/net/osmand/Version.java
+++ b/OsmAnd/src/net/osmand/Version.java
@@ -12,6 +12,27 @@ public class Version {
private final String appName;
private final static String FREE_VERSION_NAME = "net.osmand";
+
+ public static boolean isGpsStatusEnabled(Context ctx) {
+ return ctx.getString(R.string.versionFeatures).contains("+gps_status");
+ }
+
+ public static boolean isBlackberry(Context ctx) {
+ return ctx.getString(R.string.versionFeatures).contains("+blackberry");
+ }
+
+ public static boolean isGooglePlayEnabled(Context ctx) {
+ return ctx.getString(R.string.versionFeatures).contains("+play_market");
+ }
+
+ public static boolean isFreeVersionEnabled(Context ctx) {
+ return ctx.getString(R.string.versionFeatures).contains("+free_version");
+ }
+
+ public static boolean isParkingPluginInlined(Context ctx) {
+ return ctx.getString(R.string.versionFeatures).contains("+parking_plugin");
+ }
+
private Version(Context ctx) {
appVersion = ctx.getString(R.string.app_version);
appName = ctx.getString(R.string.app_name);
@@ -54,7 +75,7 @@ public class Version {
}
public static boolean isFreeVersion(Context ctx){
- return ctx.getPackageName().equals(FREE_VERSION_NAME);
+ return ctx.getPackageName().equals(FREE_VERSION_NAME) || isFreeVersionEnabled(ctx);
}
diff --git a/OsmAnd/src/net/osmand/plus/OsmandApplication.java b/OsmAnd/src/net/osmand/plus/OsmandApplication.java
index 4f0c214803..127aa424f8 100644
--- a/OsmAnd/src/net/osmand/plus/OsmandApplication.java
+++ b/OsmAnd/src/net/osmand/plus/OsmandApplication.java
@@ -13,6 +13,7 @@ import java.util.Locale;
import net.osmand.Algoritms;
import net.osmand.FavouritePoint;
import net.osmand.GPXUtilities;
+import net.osmand.Version;
import net.osmand.GPXUtilities.GPXFile;
import net.osmand.GPXUtilities.WptPt;
import net.osmand.LogUtil;
@@ -391,19 +392,21 @@ public class OsmandApplication extends Application {
private void startApplicationBackground() {
List warnings = new ArrayList();
try {
- if(osmandSettings.NATIVE_RENDERING_FAILED.get()){
- osmandSettings.NATIVE_RENDERING.set(false);
- osmandSettings.NATIVE_RENDERING_FAILED.set(false);
- warnings.add(getString(R.string.native_library_not_supported));
- } else if (osmandSettings.NATIVE_RENDERING.get()) {
- osmandSettings.NATIVE_RENDERING_FAILED.set(true);
- startDialog.startTask(getString(R.string.init_native_library), -1);
- RenderingRulesStorage storage = rendererRegistry.getCurrentSelectedRenderer();
- boolean initialized = NativeOsmandLibrary.getLibrary(storage) != null;
- osmandSettings.NATIVE_RENDERING_FAILED.set(false);
- if (!initialized) {
- LOG.info("Native library could not loaded!");
+ if (!Version.isBlackberry(this)) {
+ if (osmandSettings.NATIVE_RENDERING_FAILED.get()) {
osmandSettings.NATIVE_RENDERING.set(false);
+ osmandSettings.NATIVE_RENDERING_FAILED.set(false);
+ warnings.add(getString(R.string.native_library_not_supported));
+ } else if (osmandSettings.NATIVE_RENDERING.get()) {
+ osmandSettings.NATIVE_RENDERING_FAILED.set(true);
+ startDialog.startTask(getString(R.string.init_native_library), -1);
+ RenderingRulesStorage storage = rendererRegistry.getCurrentSelectedRenderer();
+ boolean initialized = NativeOsmandLibrary.getLibrary(storage) != null;
+ osmandSettings.NATIVE_RENDERING_FAILED.set(false);
+ if (!initialized) {
+ LOG.info("Native library could not loaded!");
+ osmandSettings.NATIVE_RENDERING.set(false);
+ }
}
}
warnings.addAll(manager.reloadIndexes(startDialog));
diff --git a/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java b/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java
index 10d41ebba1..bc1ef65b2d 100644
--- a/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java
+++ b/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java
@@ -15,6 +15,7 @@ import net.osmand.FavouritePoint;
import net.osmand.GPXUtilities;
import net.osmand.GPXUtilities.GPXFile;
import net.osmand.LogUtil;
+import net.osmand.Version;
import net.osmand.access.AccessibleAlertBuilder;
import net.osmand.access.AccessibleToast;
import net.osmand.data.Amenity;
@@ -972,16 +973,20 @@ public class MapActivityActions implements DialogProvider {
return true;
}
});
- optionsMenuHelper.registerOptionsMenuItem(R.string.show_gps_status, R.string.show_gps_status, android.R.drawable.ic_menu_compass, new OnOptionsMenuClick() {
- @Override
- public void prepareOptionsMenu(Menu menu, MenuItem item) {
- }
- @Override
- public boolean onClick(MenuItem item) {
- startGpsStatusIntent();
- return false;
- }
- });
+ if (Version.isGpsStatusEnabled(mapActivity) && !Version.isBlackberry(mapActivity)) {
+ optionsMenuHelper.registerOptionsMenuItem(R.string.show_gps_status, R.string.show_gps_status,
+ android.R.drawable.ic_menu_compass, new OnOptionsMenuClick() {
+ @Override
+ public void prepareOptionsMenu(Menu menu, MenuItem item) {
+ }
+
+ @Override
+ public boolean onClick(MenuItem item) {
+ startGpsStatusIntent();
+ return false;
+ }
+ });
+ }
optionsMenuHelper.registerOptionsMenuItem(R.string.show_point_options, R.string.show_point_options, new OnOptionsMenuClick() {
@Override
public void prepareOptionsMenu(Menu menu, MenuItem item) {
@@ -1015,21 +1020,24 @@ public class MapActivityActions implements DialogProvider {
if (resolved != null) {
mapActivity.startActivity(intent);
} else {
- AlertDialog.Builder builder = new AccessibleAlertBuilder(mapActivity);
- builder.setMessage(getString(R.string.gps_status_app_not_found));
- builder.setPositiveButton(getString(R.string.default_buttons_yes), new DialogInterface.OnClickListener() {
- @Override
- public void onClick(DialogInterface dialog, int which) {
- Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("market://search?q=pname:" + GPS_STATUS_COMPONENT));
- try {
- mapActivity.startActivity(intent);
- } catch (ActivityNotFoundException e) {
+ if (Version.isGooglePlayEnabled(mapActivity)) {
+ AlertDialog.Builder builder = new AccessibleAlertBuilder(mapActivity);
+ builder.setMessage(getString(R.string.gps_status_app_not_found));
+ builder.setPositiveButton(getString(R.string.default_buttons_yes), new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialog, int which) {
+ Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("market://search?q=pname:" + GPS_STATUS_COMPONENT));
+ try {
+ mapActivity.startActivity(intent);
+ } catch (ActivityNotFoundException e) {
+ }
}
- }
- });
- builder.setNegativeButton(
- getString(R.string.default_buttons_no), null);
- builder.show();
+ });
+ builder.setNegativeButton(getString(R.string.default_buttons_no), null);
+ builder.show();
+ } else {
+ Toast.makeText(mapActivity, R.string.gps_status_app_not_found, Toast.LENGTH_LONG).show();
+ }
}
}
diff --git a/OsmAnd/src/net/osmand/plus/activities/SettingsActivity.java b/OsmAnd/src/net/osmand/plus/activities/SettingsActivity.java
index 7be9fa44de..faed71ffa8 100644
--- a/OsmAnd/src/net/osmand/plus/activities/SettingsActivity.java
+++ b/OsmAnd/src/net/osmand/plus/activities/SettingsActivity.java
@@ -57,17 +57,17 @@ import android.widget.ListView;
import android.widget.Toast;
public class SettingsActivity extends PreferenceActivity implements OnPreferenceChangeListener, OnPreferenceClickListener {
-
+
public static final String INTENT_KEY_SETTINGS_SCREEN = "INTENT_KEY_SETTINGS_SCREEN";
public static final int SCREEN_GENERAL_SETTINGS = 1;
public static final int SCREEN_NAVIGATION_SETTINGS = 2;
public static final int SCREEN_MONITORING_SETTINGS = 3;
-
+
public static final String SCREEN_ID_GENERAL_SETTINGS = "general_settings";
public static final String SCREEN_ID_NAVIGATION_SETTINGS = "routing_settings";
public static final String SCREEN_ID_MONITORING_SETTINGS = "monitor_settings";
public static final String MORE_VALUE = "MORE_VALUE";
-
+
private Preference bidforfix;
private Preference plugins;
private Preference avoidRouting;
@@ -80,26 +80,26 @@ public class SettingsActivity extends PreferenceActivity implements OnPreference
private ListPreference routerServicePreference;
public ProgressDialog progressDlg;
-
+
private OsmandSettings osmandSettings;
-
+
private Map screenPreferences = new LinkedHashMap();
private Map> booleanPreferences = new LinkedHashMap>();
private Map> listPreferences = new LinkedHashMap>();
private Map> editTextPreferences = new LinkedHashMap>();
private Map> seekBarPreferences = new LinkedHashMap>();
-
+
private Map> listPrefValues = new LinkedHashMap>();
-
- public CheckBoxPreference registerBooleanPreference(OsmandPreference b, PreferenceScreen screen){
+
+ public CheckBoxPreference registerBooleanPreference(OsmandPreference b, PreferenceScreen screen) {
CheckBoxPreference p = (CheckBoxPreference) screen.findPreference(b.getId());
p.setOnPreferenceChangeListener(this);
screenPreferences.put(b.getId(), p);
booleanPreferences.put(b.getId(), b);
return p;
}
-
- public CheckBoxPreference createCheckBoxPreference(OsmandPreference b, int title, int summary){
+
+ public CheckBoxPreference createCheckBoxPreference(OsmandPreference b, int title, int summary) {
CheckBoxPreference p = new CheckBoxPreference(this);
p.setTitle(title);
p.setKey(b.getId());
@@ -109,18 +109,18 @@ public class SettingsActivity extends PreferenceActivity implements OnPreference
booleanPreferences.put(b.getId(), b);
return p;
}
-
- public void registerSeekBarPreference(OsmandPreference b, PreferenceScreen screen){
+
+ public void registerSeekBarPreference(OsmandPreference b, PreferenceScreen screen) {
SeekBarPreference p = (SeekBarPreference) screen.findPreference(b.getId());
p.setOnPreferenceChangeListener(this);
screenPreferences.put(b.getId(), p);
seekBarPreferences.put(b.getId(), b);
}
-
+
public String getStringPropertyName(String propertyName, String defValue) {
try {
- Field f = R.string.class.getField("rendering_attr_"+propertyName+"_name");
- if(f != null) {
+ Field f = R.string.class.getField("rendering_attr_" + propertyName + "_name");
+ if (f != null) {
Integer in = (Integer) f.get(null);
return getString(in);
}
@@ -129,11 +129,11 @@ public class SettingsActivity extends PreferenceActivity implements OnPreference
}
return defValue;
}
-
+
public String getStringPropertyDescription(String propertyName, String defValue) {
try {
- Field f = R.string.class.getField("rendering_attr_"+propertyName+"_description");
- if(f != null) {
+ Field f = R.string.class.getField("rendering_attr_" + propertyName + "_description");
+ if (f != null) {
Integer in = (Integer) f.get(null);
return getString(in);
}
@@ -142,9 +142,9 @@ public class SettingsActivity extends PreferenceActivity implements OnPreference
}
return defValue;
}
-
- public SeekBarPreference createSeekBarPreference(OsmandPreference b, int title, int summary, int dialogTextId,
- int defValue, int maxValue){
+
+ public SeekBarPreference createSeekBarPreference(OsmandPreference b, int title, int summary, int dialogTextId, int defValue,
+ int maxValue) {
SeekBarPreference p = new SeekBarPreference(this, dialogTextId, defValue, maxValue);
p.setTitle(title);
p.setKey(b.getId());
@@ -154,13 +154,13 @@ public class SettingsActivity extends PreferenceActivity implements OnPreference
seekBarPreferences.put(b.getId(), b);
return p;
}
-
- public void registerListPreference(OsmandPreference b, PreferenceScreen screen, String[] names, T[] values){
+
+ public void registerListPreference(OsmandPreference b, PreferenceScreen screen, String[] names, T[] values) {
ListPreference p = (ListPreference) screen.findPreference(b.getId());
prepareListPreference(b, names, values, p);
}
-
- public ListPreference createListPreference(OsmandPreference b, String[] names, T[] values, int title, int summary){
+
+ public ListPreference createListPreference(OsmandPreference b, String[] names, T[] values, int title, int summary) {
ListPreference p = new ListPreference(this);
p.setTitle(title);
p.setKey(b.getId());
@@ -177,19 +177,19 @@ public class SettingsActivity extends PreferenceActivity implements OnPreference
listPreferences.put(b.getId(), b);
listPrefValues.put(b.getId(), vals);
assert names.length == values.length;
- for(int i=0; i b, PreferenceScreen screen){
+
+ public void registerEditTextPreference(OsmandPreference b, PreferenceScreen screen) {
EditTextPreference p = (EditTextPreference) screen.findPreference(b.getId());
p.setOnPreferenceChangeListener(this);
screenPreferences.put(b.getId(), p);
editTextPreferences.put(b.getId(), b);
}
-
- public EditTextPreference createEditTextPreference(OsmandPreference b, int title, int summary){
+
+ public EditTextPreference createEditTextPreference(OsmandPreference b, int title, int summary) {
EditTextPreference p = new EditTextPreference(this);
p.setTitle(title);
p.setKey(b.getId());
@@ -200,16 +200,16 @@ public class SettingsActivity extends PreferenceActivity implements OnPreference
editTextPreferences.put(b.getId(), b);
return p;
}
-
+
@Override
public void setContentView(View view) {
super.setContentView(view);
}
-
- public void registerTimeListPreference(OsmandPreference b, PreferenceScreen screen, int[] seconds, int[] minutes, int coeff){
- int minutesLength = minutes == null? 0 : minutes.length;
- int secondsLength = seconds == null? 0 : seconds.length;
- Integer[] ints = new Integer[secondsLength + minutesLength];
+
+ public void registerTimeListPreference(OsmandPreference b, PreferenceScreen screen, int[] seconds, int[] minutes, int coeff) {
+ int minutesLength = minutes == null ? 0 : minutes.length;
+ int secondsLength = seconds == null ? 0 : seconds.length;
+ Integer[] ints = new Integer[secondsLength + minutesLength];
String[] intDescriptions = new String[ints.length];
for (int i = 0; i < secondsLength; i++) {
ints[i] = seconds[i] * coeff;
@@ -221,11 +221,12 @@ public class SettingsActivity extends PreferenceActivity implements OnPreference
}
registerListPreference(b, screen, intDescriptions, ints);
}
-
- public ListPreference createTimeListPreference(OsmandPreference b, int[] seconds, int[] minutes, int coeff, int title, int summary){
- int minutesLength = minutes == null? 0 : minutes.length;
- int secondsLength = seconds == null? 0 : seconds.length;
- Integer[] ints = new Integer[secondsLength + minutesLength];
+
+ public ListPreference createTimeListPreference(OsmandPreference b, int[] seconds, int[] minutes, int coeff, int title,
+ int summary) {
+ int minutesLength = minutes == null ? 0 : minutes.length;
+ int secondsLength = seconds == null ? 0 : seconds.length;
+ Integer[] ints = new Integer[secondsLength + minutesLength];
String[] intDescriptions = new String[ints.length];
for (int i = 0; i < secondsLength; i++) {
ints[i] = seconds[i] * coeff;
@@ -237,8 +238,8 @@ public class SettingsActivity extends PreferenceActivity implements OnPreference
}
return createListPreference(b, intDescriptions, ints, title, summary);
}
-
- private Set getVoiceFiles(){
+
+ private Set getVoiceFiles() {
// read available voice data
File extStorage = osmandSettings.extendOsmandPath(ResourceManager.VOICE_PATH);
Set setFiles = new LinkedHashSet();
@@ -252,7 +253,7 @@ public class SettingsActivity extends PreferenceActivity implements OnPreference
return setFiles;
}
- @Override
+ @Override
public void onCreate(Bundle savedInstanceState) {
CustomTitleBar titleBar = new CustomTitleBar(this, R.string.settings_activity, R.drawable.tab_settings_screen_icon);
setTheme(R.style.CustomTitleTheme_Preference);
@@ -261,11 +262,30 @@ public class SettingsActivity extends PreferenceActivity implements OnPreference
titleBar.afterSetContentView();
+
String[] entries;
String[] entrieValues;
PreferenceScreen screen = getPreferenceScreen();
osmandSettings = getMyApplication().getSettings();
+
+ PreferenceCategory cat = (PreferenceCategory) screen.findPreference("global_app_settings");
+ if (!Version.isBlackberry(this)) {
+ CheckBoxPreference nativeCheckbox = createCheckBoxPreference(osmandSettings.NATIVE_RENDERING, R.string.native_rendering,
+ R.string.vector_maps_may_display_faster_on_some_devices);
+ // disable the checkbox if the library cannot be used
+ if ((NativeOsmandLibrary.isLoaded() && !NativeOsmandLibrary.isSupported()) || osmandSettings.NATIVE_RENDERING_FAILED.get()) {
+ nativeCheckbox.setEnabled(false);
+ }
+ cat.addPreference(nativeCheckbox);
+ applicationDir = new EditTextPreference(this);
+ applicationDir.setTitle(R.string.application_dir);
+ applicationDir.setKey("external_storage_dir");
+ applicationDir.setDialogTitle(R.string.application_dir);
+ applicationDir.setOnPreferenceChangeListener(this);
+ cat.addPreference(applicationDir);
+ }
+
// BidForFixHelper bidForFixHelper = getMyApplication().getBidForFix();
// bidForFixHelper.generatePreferenceList(screen, getString(R.string.support_new_features), this);
OsmandPlugin.onSettingsActivityCreate(this, screen);
@@ -276,17 +296,6 @@ public class SettingsActivity extends PreferenceActivity implements OnPreference
registerBooleanPreference(osmandSettings.USE_COMPASS_IN_NAVIGATION, screen);
registerBooleanPreference(osmandSettings.LEFT_SIDE_NAVIGATION, screen);
-// registerBooleanPreference(osmandSettings.SHOW_CAMERAS, screen);
-// registerBooleanPreference(osmandSettings.SHOW_SPEED_LIMITS, screen);
-// registerBooleanPreference(osmandSettings.AVOID_TOLL_ROADS, screen);
-
-
- CheckBoxPreference nativeCheckbox = registerBooleanPreference(osmandSettings.NATIVE_RENDERING,screen);
- //disable the checkbox if the library cannot be used
- if ((NativeOsmandLibrary.isLoaded() && !NativeOsmandLibrary.isSupported()) ||
- osmandSettings.NATIVE_RENDERING_FAILED.get()) {
- nativeCheckbox.setEnabled(false);
- }
// List preferences
registerListPreference(osmandSettings.ROTATE_MAP, screen,
@@ -372,8 +381,6 @@ public class SettingsActivity extends PreferenceActivity implements OnPreference
Preference localIndexes =(Preference) screen.findPreference(OsmandSettings.LOCAL_INDEXES);
localIndexes.setOnPreferenceClickListener(this);
- applicationDir = (EditTextPreference) screen.findPreference(OsmandSettings.EXTERNAL_STORAGE_DIR);
- applicationDir.setOnPreferenceChangeListener(this);
bidforfix = (Preference) screen.findPreference("bidforfix");
bidforfix.setOnPreferenceClickListener(this);
plugins = (Preference) screen.findPreference("plugins");
@@ -434,7 +441,7 @@ public class SettingsActivity extends PreferenceActivity implements OnPreference
}
}
}
-
+
}
private void reloadVoiceListPreference(PreferenceScreen screen) {
@@ -444,7 +451,7 @@ public class SettingsActivity extends PreferenceActivity implements OnPreference
entries = new String[voiceFiles.size() + 2];
entrieValues = new String[voiceFiles.size() + 2];
int k = 0;
-// entries[k++] = getString(R.string.voice_not_specified);
+ // entries[k++] = getString(R.string.voice_not_specified);
entrieValues[k] = OsmandSettings.VOICE_PROVIDER_NOT_USE;
entries[k++] = getString(R.string.voice_not_use);
for (String s : voiceFiles) {
@@ -458,68 +465,70 @@ public class SettingsActivity extends PreferenceActivity implements OnPreference
}
private void updateApplicationDirTextAndSummary() {
- String storageDir = osmandSettings.getExternalStorageDirectory().getAbsolutePath();
- applicationDir.setText(storageDir);
- applicationDir.setSummary(storageDir);
+ if(applicationDir != null) {
+ String storageDir = osmandSettings.getExternalStorageDirectory().getAbsolutePath();
+ applicationDir.setText(storageDir);
+ applicationDir.setSummary(storageDir);
+ }
}
-
- @Override
- protected void onResume() {
+
+ @Override
+ protected void onResume() {
super.onResume();
updateAllSettings();
}
-
- @Override
- protected void onDestroy() {
- OsmandPlugin.onSettingsActivityDestroy(this);
- super.onDestroy();
- }
-
- public void updateAllSettings(){
- for(OsmandPreference b : booleanPreferences.values()){
- CheckBoxPreference pref = (CheckBoxPreference) screenPreferences.get(b.getId());
- pref.setChecked(b.get());
- }
-
- for(OsmandPreference b : seekBarPreferences.values()){
- SeekBarPreference pref = (SeekBarPreference) screenPreferences.get(b.getId());
- pref.setValue(b.get());
- }
-
- reloadVoiceListPreference(getPreferenceScreen());
-
- for(OsmandPreference> p : listPreferences.values()){
- ListPreference listPref = (ListPreference) screenPreferences.get(p.getId());
- Map prefValues = listPrefValues.get(p.getId());
- String[] entryValues = new String[prefValues.size()];
- String[] entries = new String[prefValues.size()];
- int i = 0;
- for(Entry e : prefValues.entrySet()){
- entries[i] = e.getKey();
+
+ @Override
+ protected void onDestroy() {
+ OsmandPlugin.onSettingsActivityDestroy(this);
+ super.onDestroy();
+ }
+
+ public void updateAllSettings() {
+ for (OsmandPreference b : booleanPreferences.values()) {
+ CheckBoxPreference pref = (CheckBoxPreference) screenPreferences.get(b.getId());
+ pref.setChecked(b.get());
+ }
+
+ for (OsmandPreference b : seekBarPreferences.values()) {
+ SeekBarPreference pref = (SeekBarPreference) screenPreferences.get(b.getId());
+ pref.setValue(b.get());
+ }
+
+ reloadVoiceListPreference(getPreferenceScreen());
+
+ for (OsmandPreference> p : listPreferences.values()) {
+ ListPreference listPref = (ListPreference) screenPreferences.get(p.getId());
+ Map prefValues = listPrefValues.get(p.getId());
+ String[] entryValues = new String[prefValues.size()];
+ String[] entries = new String[prefValues.size()];
+ int i = 0;
+ for (Entry e : prefValues.entrySet()) {
+ entries[i] = e.getKey();
entryValues[i] = e.getValue() + ""; // case of null
- i++;
- }
- listPref.setEntries(entries);
- listPref.setEntryValues(entryValues);
+ i++;
+ }
+ listPref.setEntries(entries);
+ listPref.setEntryValues(entryValues);
listPref.setValue(p.get() + "");
- }
-
- for(OsmandPreference s : editTextPreferences.values()){
- EditTextPreference pref = (EditTextPreference) screenPreferences.get(s.getId());
- pref.setText(s.get());
- }
-
- OsmandPlugin.onSettingsActivityUpdate(this);
-
+ }
+
+ for (OsmandPreference s : editTextPreferences.values()) {
+ EditTextPreference pref = (EditTextPreference) screenPreferences.get(s.getId());
+ pref.setText(s.get());
+ }
+
+ OsmandPlugin.onSettingsActivityUpdate(this);
+
updateApplicationDirTextAndSummary();
- applicationModePreference.setTitle(getString(R.string.settings_preset) + " [" + osmandSettings.APPLICATION_MODE.get().toHumanString(this) + "]");
- dayNightModePreference.setSummary(getString(R.string.daynight_descr) + " [" + osmandSettings.DAYNIGHT_MODE.get().toHumanString(this) + "]");
+ applicationModePreference.setTitle(getString(R.string.settings_preset) + " ["
+ + osmandSettings.APPLICATION_MODE.get().toHumanString(this) + "]");
+ dayNightModePreference.setSummary(getString(R.string.daynight_descr) + " ["
+ + osmandSettings.DAYNIGHT_MODE.get().toHumanString(this) + "]");
routerServicePreference.setSummary(getString(R.string.router_service_descr) + " [" + osmandSettings.ROUTER_SERVICE.get() + "]");
- }
+ }
-
-
@SuppressWarnings("unchecked")
@Override
public boolean onPreferenceChange(Preference preference, Object newValue) {
@@ -528,10 +537,10 @@ public class SettingsActivity extends PreferenceActivity implements OnPreference
OsmandPreference seekPref = seekBarPreferences.get(preference.getKey());
OsmandPreference