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 listPref = (OsmandPreference) listPreferences.get(preference.getKey()); OsmandPreference editPref = editTextPreferences.get(preference.getKey()); - if(boolPref != null){ - boolPref.set((Boolean)newValue); + if (boolPref != null) { + boolPref.set((Boolean) newValue); if (boolPref.getId().equals(osmandSettings.NATIVE_RENDERING.getId())) { - if(((Boolean)newValue).booleanValue()) { + if (((Boolean) newValue).booleanValue()) { loadNativeLibrary(); } } @@ -546,12 +555,12 @@ public class SettingsActivity extends PreferenceActivity implements OnPreference Object obj = map.get(entry); final Object oldValue = listPref.get(); boolean changed = listPref.set(obj); - + // Specific actions after list preference changed if (changed) { if (listPref.getId().equals(osmandSettings.VOICE_PROVIDER.getId())) { if (MORE_VALUE.equals(newValue)) { - listPref.set(oldValue); //revert the change.. + listPref.set(oldValue); // revert the change.. final Intent intent = new Intent(this, DownloadIndexActivity.class); intent.putExtra(DownloadIndexActivity.FILTER_KEY, "voice"); startActivity(intent); @@ -559,7 +568,8 @@ public class SettingsActivity extends PreferenceActivity implements OnPreference getMyApplication().showDialogInitializingCommandPlayer(this, false); } } else if (listPref.getId().equals(osmandSettings.ROUTER_SERVICE.getId())) { - routerServicePreference.setSummary(getString(R.string.router_service_descr) + " [" + osmandSettings.ROUTER_SERVICE.get() + "]"); + routerServicePreference.setSummary(getString(R.string.router_service_descr) + " [" + + osmandSettings.ROUTER_SERVICE.get() + "]"); } else if (listPref.getId().equals(osmandSettings.APPLICATION_MODE.getId())) { updateAllSettings(); } else if (listPref.getId().equals(osmandSettings.PREFERRED_LOCALE.getId())) { @@ -569,41 +579,40 @@ public class SettingsActivity extends PreferenceActivity implements OnPreference finish(); startActivity(intent); } else if (listPref.getId().equals(osmandSettings.DAYNIGHT_MODE.getId())) { - dayNightModePreference.setSummary(getString(R.string.daynight_descr) + " [" + osmandSettings.DAYNIGHT_MODE.get().toHumanString(this) + "]"); + dayNightModePreference.setSummary(getString(R.string.daynight_descr) + " [" + + osmandSettings.DAYNIGHT_MODE.get().toHumanString(this) + "]"); } } if (listPref.getId().equals(osmandSettings.RENDERER.getId())) { - if(changed){ + if (changed) { AccessibleToast.makeText(this, R.string.renderer_load_sucess, Toast.LENGTH_SHORT).show(); } else { AccessibleToast.makeText(this, R.string.renderer_load_exception, Toast.LENGTH_SHORT).show(); } createCustomRenderingProperties(true); } - } else if(preference == applicationDir){ + } else if (preference == applicationDir) { warnAboutChangingStorage((String) newValue); return false; } return true; } - - private void warnAboutChangingStorage(final String newValue) { - final String newDir = newValue != null ? newValue.trim(): newValue; + final String newDir = newValue != null ? newValue.trim() : newValue; File path = new File(newDir); path.mkdirs(); - if(!path.canRead() || !path.exists()){ - AccessibleToast.makeText(this, R.string.specified_dir_doesnt_exist, Toast.LENGTH_LONG).show() ; + if (!path.canRead() || !path.exists()) { + AccessibleToast.makeText(this, R.string.specified_dir_doesnt_exist, Toast.LENGTH_LONG).show(); return; } - + Builder builder = new AlertDialog.Builder(this); builder.setMessage(getString(R.string.application_dir_change_warning)); builder.setPositiveButton(R.string.default_buttons_yes, new OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { - //edit the preference + // edit the preference osmandSettings.setExternalStorageDirectory(newDir); getMyApplication().getResourceManager().resetStoreDirectory(); reloadIndexes(); @@ -614,27 +623,27 @@ public class SettingsActivity extends PreferenceActivity implements OnPreference builder.show(); } - public void reloadIndexes(){ + public void reloadIndexes() { reloadVoiceListPreference(getPreferenceScreen()); progressDlg = ProgressDialog.show(this, getString(R.string.loading_data), getString(R.string.reading_indexes), true); final ProgressDialogImplementation impl = new ProgressDialogImplementation(progressDlg); - impl.setRunnable("Initializing app", new Runnable(){ //$NON-NLS-1$ - @Override - public void run() { - try { - showWarnings(getMyApplication().getResourceManager().reloadIndexes(impl)); - } finally { - if(progressDlg !=null){ - progressDlg.dismiss(); - progressDlg = null; + impl.setRunnable("Initializing app", new Runnable() { //$NON-NLS-1$ + @Override + public void run() { + try { + showWarnings(getMyApplication().getResourceManager().reloadIndexes(impl)); + } finally { + if (progressDlg != null) { + progressDlg.dismiss(); + progressDlg = null; + } + } } - } - } - }); + }); impl.run(); } - - public void loadNativeLibrary(){ + + public void loadNativeLibrary() { if (!NativeOsmandLibrary.isLoaded()) { final RenderingRulesStorage storage = getMyApplication().getRendererRegistry().getCurrentSelectedRenderer(); new AsyncTask() { @@ -660,25 +669,26 @@ public class SettingsActivity extends PreferenceActivity implements OnPreference }.execute(); } } - + private OsmandApplication getMyApplication() { - return (OsmandApplication)getApplication(); + return (OsmandApplication) getApplication(); } - + @Override protected void onStop() { - if(progressDlg !=null){ + if (progressDlg != null) { progressDlg.dismiss(); progressDlg = null; } super.onStop(); } + protected void showWarnings(List warnings) { if (!warnings.isEmpty()) { final StringBuilder b = new StringBuilder(); boolean f = true; for (String w : warnings) { - if(f){ + if (f) { f = false; } else { b.append('\n'); @@ -694,55 +704,53 @@ public class SettingsActivity extends PreferenceActivity implements OnPreference }); } } - - + @Override - public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen, - Preference preference) { - //customize the sub-preference title according the selected profile + public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen, Preference preference) { + // customize the sub-preference title according the selected profile String title = ""; - if (preference.getKey() != null && preference instanceof PreferenceScreen && - ((PreferenceCategory)findPreference("profile_dep_cat")).findPreference(preference.getKey()) != null) { - PreferenceScreen scr = (PreferenceScreen)preference; + if (preference.getKey() != null && preference instanceof PreferenceScreen + && ((PreferenceCategory) findPreference("profile_dep_cat")).findPreference(preference.getKey()) != null) { + PreferenceScreen scr = (PreferenceScreen) preference; title = scr.getTitle().toString(); - if(title.startsWith("-")){ + if (title.startsWith("-")) { title = title.substring(1); } scr.getDialog().setTitle(" " + title + " [" + osmandSettings.APPLICATION_MODE.get().toHumanString(this) + "]"); - } else if(preference instanceof PreferenceScreen){ - final PreferenceScreen scr = (PreferenceScreen)preference; + } else if (preference instanceof PreferenceScreen) { + final PreferenceScreen scr = (PreferenceScreen) preference; title = scr.getTitle().toString(); scr.getDialog().setTitle(" " + title); } - if(preference instanceof PreferenceScreen) { - final PreferenceScreen scr = (PreferenceScreen)preference; + if (preference instanceof PreferenceScreen) { + final PreferenceScreen scr = (PreferenceScreen) preference; CustomTitleBarView titleBar = new CustomTitleBarView(title, R.drawable.tab_settings_screen_icon, null) { @Override public void backPressed() { scr.getDialog().dismiss(); } }; - + View titleView = getLayoutInflater().inflate(titleBar.getTitleBarLayout(), null); titleBar.init(titleView); -// View decorView = scr.getDialog().getWindow().getDecorView(); -// LinearLayout ll = new LinearLayout(titleView.getContext()); -// scr.getDialog().getWindow().setContentView(ll); + // View decorView = scr.getDialog().getWindow().getDecorView(); + // LinearLayout ll = new LinearLayout(titleView.getContext()); + // scr.getDialog().getWindow().setContentView(ll); View dv = scr.getDialog().getWindow().getDecorView(); ListView ls = (ListView) dv.findViewById(android.R.id.list); - if(ls != null){ + if (ls != null) { ls.addFooterView(titleView); } - -// LayoutParams lp = new ViewGroup.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT); -// scr.getDialog().addContentView(titleView, lp); - -// ll.setOrientation(LinearLayout.VERTICAL); -// ll.addView(titleView); -// ll.addView(decorView); - + + // LayoutParams lp = new ViewGroup.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT); + // scr.getDialog().addContentView(titleView, lp); + + // ll.setOrientation(LinearLayout.VERTICAL); + // ll.addView(titleView); + // ll.addView(decorView); + } - + if (preference == applicationDir) { return true; } @@ -752,17 +760,17 @@ public class SettingsActivity extends PreferenceActivity implements OnPreference @SuppressWarnings("unchecked") @Override public boolean onPreferenceClick(Preference preference) { - if(preference.getKey().equals(OsmandSettings.LOCAL_INDEXES)){ - if(getMyApplication().getResourceManager().getIndexFileNames().isEmpty()) { + if (preference.getKey().equals(OsmandSettings.LOCAL_INDEXES)) { + if (getMyApplication().getResourceManager().getIndexFileNames().isEmpty()) { startActivity(new Intent(this, OsmandIntents.getDownloadIndexActivity())); } else { startActivity(new Intent(this, OsmandIntents.getLocalIndexActivity())); } return true; - } else if(preference == bidforfix){ + } else if (preference == bidforfix) { startActivity(new Intent(this, OsmandBidForFixActivity.class)); return true; - } else if(preference == plugins){ + } else if (preference == plugins) { startActivity(new Intent(this, PluginsActivity.class)); return true; } else if (preference == avoidRouting) { @@ -770,27 +778,26 @@ public class SettingsActivity extends PreferenceActivity implements OnPreference getString(R.string.avoid_unpaved) }, new OsmandPreference[] { osmandSettings.AVOID_TOLL_ROADS, osmandSettings.AVOID_FERRIES, osmandSettings.AVOID_UNPAVED_ROADS }); return true; - } else if(preference == showAlarms){ + } else if (preference == showAlarms) { showBooleanSettings(new String[] { getString(R.string.show_cameras), getString(R.string.show_speed_limits), - getString(R.string.show_lanes) }, - new OsmandPreference[] { osmandSettings.SHOW_CAMERAS, osmandSettings.SHOW_SPEED_LIMITS, - osmandSettings.SHOW_LANES}); + getString(R.string.show_lanes) }, new OsmandPreference[] { osmandSettings.SHOW_CAMERAS, + osmandSettings.SHOW_SPEED_LIMITS, osmandSettings.SHOW_LANES }); return true; - } else if(preference.getKey().equals("show_routing_alarms")){ + } else if (preference.getKey().equals("show_routing_alarms")) { startActivity(new Intent(this, PluginsActivity.class)); return true; } return false; } - + public void showBooleanSettings(String[] vals, final OsmandPreference[] prefs) { Builder bld = new AlertDialog.Builder(this); - boolean[] checkedItems = new boolean[prefs.length]; - for(int i=0; i result){ + public static void installMapLayers(final Activity activity, final ResultMatcher result) { final OsmandSettings settings = ((OsmandApplication) activity.getApplication()).getSettings(); final Map entriesMap = settings.getTileSourceEntries(); - if(!settings.isInternetConnectionAvailable(true)){ + if (!settings.isInternetConnectionAvailable(true)) { AccessibleToast.makeText(activity, R.string.internet_not_available, Toast.LENGTH_LONG).show(); return; } final List downloaded = TileSourceManager.downloadTileSourceTemplates(Version.getVersionAsURLParam(activity)); - if(downloaded == null || downloaded.isEmpty()){ + if (downloaded == null || downloaded.isEmpty()) { AccessibleToast.makeText(activity, R.string.error_io_error, Toast.LENGTH_SHORT).show(); return; } Builder builder = new AlertDialog.Builder(activity); String[] names = new String[downloaded.size()]; - for(int i=0; i toInstall = new ArrayList(); - for(int i=0; i vs = new ValueHolder(); vs.value = view.getSettings().SAVE_TRACK_INTERVAL.get(); li.showIntervalChooseDialog(view, view.getContext().getString(R.string.save_track_interval) + " : %s", - view.getContext().getString(R.string.save_track_to_gpx), OsmandBackgroundServicePlugin.SECONDS, OsmandBackgroundServicePlugin.MINUTES, + view.getContext().getString(R.string.save_track_to_gpx), SECONDS, MINUTES, vs, new OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { @@ -280,6 +287,34 @@ public class OsmandMonitoringPlugin extends OsmandPlugin implements LockInfoCont }); qa.addActionItem(bgServiceAction); + final ActionItem liveAction = new ActionItem(); + final boolean liveoff = !view.getSettings().LIVE_MONITORING.get(); + liveAction.setTitle(view.getResources().getString(liveoff? R.string.live_monitoring_mode_off : R.string.live_monitoring_mode_on)); + liveAction.setIcon(view.getResources().getDrawable(liveoff?R.drawable.monitoring_rec_big:R.drawable.monitoring_rec_inactive)); + liveAction.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + if (liveoff) { + final ValueHolder vs = new ValueHolder(); + vs.value = view.getSettings().LIVE_MONITORING_INTERVAL.get(); + li.showIntervalChooseDialog(view, view.getContext().getString(R.string.live_monitoring_interval) + " : %s", + view.getContext().getString(R.string.live_monitoring), SECONDS, MINUTES, + vs, new OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + view.getSettings().LIVE_MONITORING_INTERVAL.set(vs.value); + view.getSettings().LIVE_MONITORING.set(true); + } + }); + } else { + view.getSettings().LIVE_MONITORING.set(false); + } + qa.dismiss(); + } + }); + qa.addActionItem(liveAction); + + } } \ No newline at end of file diff --git a/OsmAnd/src/net/osmand/plus/views/LockInfoControl.java b/OsmAnd/src/net/osmand/plus/views/LockInfoControl.java index 389bdad344..9b5bcbe5f1 100644 --- a/OsmAnd/src/net/osmand/plus/views/LockInfoControl.java +++ b/OsmAnd/src/net/osmand/plus/views/LockInfoControl.java @@ -116,7 +116,7 @@ public class LockInfoControl { final ActionItem lockScreenAction = new ActionItem(); lockScreenAction.setTitle(view.getResources().getString( isScreenLocked ? R.string.bg_service_screen_unlock : R.string.bg_service_screen_lock)); - lockScreenAction.setIcon(view.getResources().getDrawable(isScreenLocked ? R.drawable.lock_enabled : R.drawable.lock_disabled)); + lockScreenAction.setIcon(view.getResources().getDrawable(isScreenLocked ? R.drawable.lock_disabled : R.drawable.lock_enabled)); lockScreenAction.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { @@ -144,10 +144,10 @@ public class LockInfoControl { } public void showIntervalChooseDialog(final OsmandMapTileView view, final String patternMsg, - String startText, final int[] seconds, final int[] minutes, final ValueHolder v, OnClickListener onclick){ + String title, final int[] seconds, final int[] minutes, final ValueHolder v, OnClickListener onclick){ final Context ctx = view.getContext(); Builder dlg = new AlertDialog.Builder(view.getContext()); - dlg.setTitle(startText); + dlg.setTitle(title); LinearLayout ll = new LinearLayout(view.getContext()); final TextView tv = new TextView(view.getContext()); tv.setPadding(7, 3, 7, 0); diff --git a/OsmAnd/src/net/osmand/plus/views/MapInfoControls.java b/OsmAnd/src/net/osmand/plus/views/MapInfoControls.java index 5559e14d8d..d315f0a0fd 100644 --- a/OsmAnd/src/net/osmand/plus/views/MapInfoControls.java +++ b/OsmAnd/src/net/osmand/plus/views/MapInfoControls.java @@ -9,6 +9,7 @@ import java.util.Set; import java.util.TreeSet; import net.osmand.plus.OsmandSettings; +import net.osmand.plus.OsmandSettings.CommonPreference; import net.osmand.plus.activities.ApplicationMode; import android.view.View; import android.view.ViewGroup; @@ -67,23 +68,14 @@ public class MapInfoControls { } public MapInfoControlRegInfo registerAppearanceWidget(int drawable, int messageId, String key, - EnumSet appDefaultModes) { + CommonPreference pref) { MapInfoControlRegInfo ii = new MapInfoControlRegInfo(); - ii.defaultModes = appDefaultModes.clone(); + ii.defaultModes = EnumSet.noneOf(ApplicationMode.class); ii.defaultCollapsible = null; ii.key = key; + ii.blPreference = pref; ii.visibleModes = EnumSet.noneOf(ApplicationMode.class); ii.visibleCollapsible = null; - for(ApplicationMode ms : ApplicationMode.values() ) { - boolean def = appDefaultModes.contains(ms); - Set set = visibleElements.get(ms); - if(set != null) { - def = set.contains(key); - } - if(def){ - ii.visibleModes.add(ms); - } - } ii.drawable = drawable; ii.messageId = messageId; this.appearanceWidgets.add(ii); @@ -281,18 +273,22 @@ public class MapInfoControls { private EnumSet defaultCollapsible; private EnumSet visibleModes; private EnumSet visibleCollapsible; + private CommonPreference blPreference = null; private Runnable stateChangeListener = null; public int priorityOrder; public boolean visibleCollapsed(ApplicationMode mode){ - return visibleCollapsible != null && visibleCollapsible.contains(mode); + return blPreference == null && visibleCollapsible != null && visibleCollapsible.contains(mode); } public boolean collapseEnabled(ApplicationMode mode){ - return visibleCollapsible != null; + return visibleCollapsible != null && blPreference == null; } public boolean visible(ApplicationMode mode){ + if(blPreference != null) { + return blPreference.getModeValue(mode); + } return visibleModes.contains(mode); } @@ -303,6 +299,10 @@ public class MapInfoControls { return this; } + public void setPreference(CommonPreference blPreference) { + this.blPreference = blPreference; + } + public void setStateChangeListener(Runnable stateChangeListener) { this.stateChangeListener = stateChangeListener; diff --git a/OsmAnd/src/net/osmand/plus/views/MapInfoLayer.java b/OsmAnd/src/net/osmand/plus/views/MapInfoLayer.java index 814e8eeed7..a09ccc355f 100644 --- a/OsmAnd/src/net/osmand/plus/views/MapInfoLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/MapInfoLayer.java @@ -233,7 +233,7 @@ public class MapInfoLayer extends OsmandMapLayer { private void registerAppearanceWidgets() { final MapInfoControlRegInfo showRuler = mapInfoControls.registerAppearanceWidget(0, R.string.map_widget_show_ruler, - "showRuler", EnumSet.allOf(ApplicationMode.class)); + "showRuler", view.getSettings().SHOW_RULER); showRuler.setStateChangeListener(new Runnable() { @Override public void run() { @@ -244,7 +244,7 @@ public class MapInfoLayer extends OsmandMapLayer { }); final MapInfoControlRegInfo displayViewDirections = mapInfoControls.registerAppearanceWidget(0, R.string.map_widget_view_direction, - "viewDirection", EnumSet.of(ApplicationMode.BICYCLE, ApplicationMode.PEDESTRIAN)); + "viewDirection", view.getSettings().SHOW_VIEW_ANGLE); displayViewDirections.setStateChangeListener(new Runnable() { @Override public void run() { diff --git a/config/logo/feature_graphics.png b/config/logo/feature_graphics.png new file mode 100644 index 0000000000..d975e4345f Binary files /dev/null and b/config/logo/feature_graphics.png differ diff --git a/config/logo/free/icon_480.png b/config/logo/free/icon_480.png new file mode 100644 index 0000000000..1d22dbae55 Binary files /dev/null and b/config/logo/free/icon_480.png differ diff --git a/config/logo/icon_480.png b/config/logo/icon_480.png new file mode 100644 index 0000000000..9327c0e50e Binary files /dev/null and b/config/logo/icon_480.png differ diff --git a/config/logo/osmand-feature-graphics.png b/config/logo/osmand-feature-graphics.png new file mode 100644 index 0000000000..d0045526ca Binary files /dev/null and b/config/logo/osmand-feature-graphics.png differ