Merge pull request #1012 from Bars107/master

Railways and pedestrian warnings.
This commit is contained in:
vshcherb 2014-12-18 12:08:39 +01:00
commit 41e4aa472f
6 changed files with 13 additions and 5 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

View file

@ -11,12 +11,12 @@ public class AlarmInfo implements LocationPoint {
SPEED_CAMERA(1), SPEED_CAMERA(1),
SPEED_LIMIT(2), SPEED_LIMIT(2),
BORDER_CONTROL(3), BORDER_CONTROL(3),
TRAFFIC_CALMING(4), RAILWAY(4),
TOLL_BOOTH(5), TRAFFIC_CALMING(5),
STOP(6), TOLL_BOOTH(6),
MAXIMUM(7), STOP(7),
PEDESTRIAN(8), PEDESTRIAN(8),
RAILWAY(9); MAXIMUM(9);
private int priority; private int priority;
@ -118,6 +118,10 @@ public class AlarmInfo implements LocationPoint {
} }
} else if("traffic_calming".equals(ruleType.getTag())) { } else if("traffic_calming".equals(ruleType.getTag())) {
alarmInfo = new AlarmInfo(AlarmInfoType.TRAFFIC_CALMING, locInd); alarmInfo = new AlarmInfo(AlarmInfoType.TRAFFIC_CALMING, locInd);
} else if ("railway".equals(ruleType.getTag()) && "level_crossing".equals(ruleType.getValue())) {
alarmInfo = new AlarmInfo(AlarmInfoType.RAILWAY, locInd);
} else if ("crossing".equals(ruleType.getTag()) && "uncontrolled".equals(ruleType.getValue())){
alarmInfo = new AlarmInfo(AlarmInfoType.PEDESTRIAN, locInd);
} }
if(alarmInfo != null) { if(alarmInfo != null) {
alarmInfo.setLatLon(loc.getLatitude(), loc.getLongitude()); alarmInfo.setLatLon(loc.getLatitude(), loc.getLongitude());

View file

@ -743,6 +743,10 @@ public class RouteInfoWidgetsFactory {
locimgId = R.drawable.warnings_stop; locimgId = R.drawable.warnings_stop;
text = ""; text = "";
//text = "STOP"; //text = "STOP";
} else if(alarm.getType() == AlarmInfoType.RAILWAY) {
locimgId = R.drawable.warnings_railways;
} else if(alarm.getType() == AlarmInfoType.PEDESTRIAN) {
locimgId = R.drawable.warnings_pedestrian;
} }
visible = (text != null && text.length() > 0) || locimgId != 0; visible = (text != null && text.length() > 0) || locimgId != 0;
if (visible) { if (visible) {