From af5c7e65fd158362b47c839a0464295061eaf31b Mon Sep 17 00:00:00 2001 From: Denis Date: Thu, 11 Dec 2014 15:59:19 +0200 Subject: [PATCH] Added warning for railways and pedestrian(not complete yet) --- OsmAnd/res/values/strings.xml | 4 +++ .../src/net/osmand/plus/OsmandSettings.java | 2 ++ .../SettingsNavigationActivity.java | 5 +-- .../net/osmand/plus/routing/AlarmInfo.java | 32 +++++++++++-------- 4 files changed, 28 insertions(+), 15 deletions(-) diff --git a/OsmAnd/res/values/strings.xml b/OsmAnd/res/values/strings.xml index a8274f7095..1dad1254d2 100644 --- a/OsmAnd/res/values/strings.xml +++ b/OsmAnd/res/values/strings.xml @@ -13,6 +13,10 @@ Default Orange German Road Atlas + Railways + Pedestrian + Show railway warnings + Show pedestrian warnings American Road Atlas Do not use v1.9 routing Do not use v1.9 routing diff --git a/OsmAnd/src/net/osmand/plus/OsmandSettings.java b/OsmAnd/src/net/osmand/plus/OsmandSettings.java index ef2051da37..9e38b5ea85 100644 --- a/OsmAnd/src/net/osmand/plus/OsmandSettings.java +++ b/OsmAnd/src/net/osmand/plus/OsmandSettings.java @@ -822,6 +822,8 @@ public class OsmandSettings { { SHOW_LANES.setModeDefaultValue(ApplicationMode.DEFAULT, false); } + public final CommonPreference SHOW_PEDESTRIAN = new BooleanPreference("show_pedastrian", true).makeProfile().cache(); + public final CommonPreference SHOW_RAILWAYS = new BooleanPreference("show_railways", true).makeProfile().cache(); public final OsmandPreference SPEAK_TRAFFIC_WARNINGS = new BooleanPreference("speak_traffic_warnings", true).makeProfile().cache(); public final OsmandPreference SPEAK_STREET_NAMES = new BooleanPreference("speak_street_names", true).makeProfile().cache(); diff --git a/OsmAnd/src/net/osmand/plus/activities/SettingsNavigationActivity.java b/OsmAnd/src/net/osmand/plus/activities/SettingsNavigationActivity.java index 5fb603a050..116c9bb9a5 100644 --- a/OsmAnd/src/net/osmand/plus/activities/SettingsNavigationActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/SettingsNavigationActivity.java @@ -329,8 +329,9 @@ public class SettingsNavigationActivity extends SettingsBaseActivity { return true; } else if (preference == showAlarms) { showBooleanSettings(new String[] { getString(R.string.show_traffic_warnings), getString(R.string.show_cameras), - getString(R.string.show_lanes) }, new OsmandPreference[] { settings.SHOW_TRAFFIC_WARNINGS, - settings.SHOW_CAMERAS, settings.SHOW_LANES }, preference.getTitle()); + getString(R.string.show_lanes) ,getString(R.string.show_pedestrian_warnings) , + getString(R.string.show_railway_warnings) }, new OsmandPreference[] { settings.SHOW_TRAFFIC_WARNINGS, + settings.SHOW_CAMERAS, settings.SHOW_LANES, settings.SHOW_PEDESTRIAN, settings.SHOW_RAILWAYS }, preference.getTitle()); return true; } else if (preference == speakAlarms) { showBooleanSettings(new String[] { getString(R.string.speak_street_names), getString(R.string.speak_traffic_warnings), diff --git a/OsmAnd/src/net/osmand/plus/routing/AlarmInfo.java b/OsmAnd/src/net/osmand/plus/routing/AlarmInfo.java index 7fe42e48c0..9ce305ac8b 100644 --- a/OsmAnd/src/net/osmand/plus/routing/AlarmInfo.java +++ b/OsmAnd/src/net/osmand/plus/routing/AlarmInfo.java @@ -14,7 +14,9 @@ public class AlarmInfo implements LocationPoint { TRAFFIC_CALMING(4), TOLL_BOOTH(5), STOP(6), - MAXIMUM(7); + MAXIMUM(7), + PEDESTRIAN(8), + RAILWAY(9); private int priority; @@ -29,18 +31,22 @@ public class AlarmInfo implements LocationPoint { public String getVisualName(Context ctx) { switch (priority) { - case 1: - return ctx.getString(R.string.traffic_warning_speed_camera); - case 2: - return ctx.getString(R.string.traffic_warning_speed_limit); - case 3: - return ctx.getString(R.string.traffic_warning_border_control); - case 4: - return ctx.getString(R.string.traffic_warning_calming); - case 5: - return ctx.getString(R.string.traffic_warning_payment); - case 6: - return ctx.getString(R.string.traffic_warning_stop); + case 1: + return ctx.getString(R.string.traffic_warning_speed_camera); + case 2: + return ctx.getString(R.string.traffic_warning_speed_limit); + case 3: + return ctx.getString(R.string.traffic_warning_border_control); + case 4: + return ctx.getString(R.string.traffic_warning_calming); + case 5: + return ctx.getString(R.string.traffic_warning_payment); + case 6: + return ctx.getString(R.string.traffic_warning_stop); + case 8: + return ctx.getString(R.string.traffic_waring_pedestrian); + case 9: + return ctx.getString(R.string.traffic_warning_railways); } return ctx.getString(R.string.traffic_warning); }