Added warning for railways and pedestrian(not complete yet)

This commit is contained in:
Denis 2014-12-11 15:59:19 +02:00
parent fc74ed4359
commit af5c7e65fd
4 changed files with 28 additions and 15 deletions

View file

@ -13,6 +13,10 @@
<string name="rendering_value_default_name">Default</string>
<string name="rendering_value_orange_name">Orange</string>
<string name="rendering_value_germanRoadAtlas_name">German Road Atlas</string>
<string name="traffic_warning_railways">Railways</string>
<string name="traffic_waring_pedestrian">Pedestrian</string>
<string name="show_railway_warnings">Show railway warnings</string>
<string name="show_pedestrian_warnings">Show pedestrian warnings</string>
<string name="rendering_value_americanRoadAtlas_name">American Road Atlas</string>
<string name="routing_attr_no_new_routing_name">Do not use v1.9 routing</string>
<string name="routing_attr_no_new_routing_description">Do not use v1.9 routing</string>

View file

@ -822,6 +822,8 @@ public class OsmandSettings {
{
SHOW_LANES.setModeDefaultValue(ApplicationMode.DEFAULT, false);
}
public final CommonPreference<Boolean> SHOW_PEDESTRIAN = new BooleanPreference("show_pedastrian", true).makeProfile().cache();
public final CommonPreference<Boolean> SHOW_RAILWAYS = new BooleanPreference("show_railways", true).makeProfile().cache();
public final OsmandPreference<Boolean> SPEAK_TRAFFIC_WARNINGS = new BooleanPreference("speak_traffic_warnings", true).makeProfile().cache();
public final OsmandPreference<Boolean> SPEAK_STREET_NAMES = new BooleanPreference("speak_street_names", true).makeProfile().cache();

View file

@ -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),

View file

@ -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);
}