Fix alarm info
This commit is contained in:
parent
b773c0e260
commit
b44e688c0b
2 changed files with 27 additions and 1 deletions
|
@ -9,6 +9,13 @@
|
|||
3. 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
|
||||
-->
|
||||
<string name="traffic_warning_speed_limit">Speed limit</string>
|
||||
<string name="traffic_warning_border_control">Border control</string>
|
||||
<string name="traffic_warning_payment">Toll booth</string>
|
||||
<string name="traffic_warning_stop">Stop</string>
|
||||
<string name="traffic_warning_calming">Traffic calming</string>
|
||||
<string name="traffic_warning_speed_camera">Speed camera</string>
|
||||
<string name="traffic_warning">Traffic warning</string>
|
||||
<string name="speak_favorites">Announce nearby Favorites</string>
|
||||
<string name="speak_poi">Announce nearby POI</string>
|
||||
<string name="way_alarms">Traffic warnings</string>
|
||||
|
|
|
@ -4,6 +4,7 @@ import android.content.Context;
|
|||
import net.osmand.Location;
|
||||
import net.osmand.binary.BinaryMapRouteReaderAdapter.RouteTypeRule;
|
||||
import net.osmand.data.LocationPoint;
|
||||
import net.osmand.plus.R;
|
||||
|
||||
public class AlarmInfo implements LocationPoint {
|
||||
public enum AlarmInfoType {
|
||||
|
@ -25,6 +26,24 @@ public class AlarmInfo implements LocationPoint {
|
|||
return priority;
|
||||
}
|
||||
|
||||
|
||||
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);
|
||||
}
|
||||
return ctx.getString(R.string.traffic_warning);
|
||||
}
|
||||
}
|
||||
|
||||
private AlarmInfoType type;
|
||||
|
@ -120,7 +139,7 @@ public class AlarmInfo implements LocationPoint {
|
|||
|
||||
@Override
|
||||
public String getName(Context ctx) {
|
||||
return type.name();
|
||||
return type.getVisualName(ctx);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in a new issue