Boat navigation is enabled with Nautical plugin
This commit is contained in:
parent
14ac84f363
commit
5d646c7396
1 changed files with 3 additions and 2 deletions
|
@ -90,8 +90,9 @@ public class NauticalMapsPlugin extends OsmandPlugin {
|
||||||
|
|
||||||
public void addBoatProfile(boolean flag) {
|
public void addBoatProfile(boolean flag) {
|
||||||
Set<ApplicationMode> selectedProfiles = new LinkedHashSet<>(ApplicationMode.values(app.getSettings()));
|
Set<ApplicationMode> selectedProfiles = new LinkedHashSet<>(ApplicationMode.values(app.getSettings()));
|
||||||
if((!selectedProfiles.contains(ApplicationMode.BOAT) && flag) ||
|
boolean isBoatEnabled = selectedProfiles.contains(ApplicationMode.BOAT);
|
||||||
((selectedProfiles.contains(ApplicationMode.BOAT) && !flag))) {
|
if((!isBoatEnabled && flag) ||
|
||||||
|
((isBoatEnabled && !flag))) {
|
||||||
String s = app.getSettings().AVAILABLE_APP_MODES.get();
|
String s = app.getSettings().AVAILABLE_APP_MODES.get();
|
||||||
String currModes = flag ? s + ApplicationMode.BOAT.getStringKey() + ","
|
String currModes = flag ? s + ApplicationMode.BOAT.getStringKey() + ","
|
||||||
: s.replace(ApplicationMode.BOAT.getStringKey() + ",", "");
|
: s.replace(ApplicationMode.BOAT.getStringKey() + ",", "");
|
||||||
|
|
Loading…
Reference in a new issue