Boat navigation is enabled with Nautical plugin

This commit is contained in:
PaulStets 2018-01-26 13:43:11 +02:00
parent 14ac84f363
commit 5d646c7396

View file

@ -90,8 +90,9 @@ public class NauticalMapsPlugin extends OsmandPlugin {
public void addBoatProfile(boolean flag) {
Set<ApplicationMode> selectedProfiles = new LinkedHashSet<>(ApplicationMode.values(app.getSettings()));
if((!selectedProfiles.contains(ApplicationMode.BOAT) && flag) ||
((selectedProfiles.contains(ApplicationMode.BOAT) && !flag))) {
boolean isBoatEnabled = selectedProfiles.contains(ApplicationMode.BOAT);
if((!isBoatEnabled && flag) ||
((isBoatEnabled && !flag))) {
String s = app.getSettings().AVAILABLE_APP_MODES.get();
String currModes = flag ? s + ApplicationMode.BOAT.getStringKey() + ","
: s.replace(ApplicationMode.BOAT.getStringKey() + ",", "");