From 66577cb82e1d7be8038ca2befa37d25aedb55a87 Mon Sep 17 00:00:00 2001 From: vshcherb Date: Mon, 24 Feb 2014 01:09:19 +0100 Subject: [PATCH 1/2] Fix bug with default selection navigation settings --- .../src/net/osmand/plus/activities/SettingsBaseActivity.java | 1 + .../net/osmand/plus/activities/actions/NavigateAction.java | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/activities/SettingsBaseActivity.java b/OsmAnd/src/net/osmand/plus/activities/SettingsBaseActivity.java index f7f95bf142..e2ba19169f 100644 --- a/OsmAnd/src/net/osmand/plus/activities/SettingsBaseActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/SettingsBaseActivity.java @@ -311,6 +311,7 @@ public abstract class SettingsBaseActivity extends SherlockPreferenceActivity im @Override public void onClick(View v) { if(selected.size() > 0) { + // test setSelectedAppMode(selected.iterator().next()); } if(profileDialog != null && profileDialog.isShowing()) { diff --git a/OsmAnd/src/net/osmand/plus/activities/actions/NavigateAction.java b/OsmAnd/src/net/osmand/plus/activities/actions/NavigateAction.java index cebabbb6b0..f6712b5f91 100644 --- a/OsmAnd/src/net/osmand/plus/activities/actions/NavigateAction.java +++ b/OsmAnd/src/net/osmand/plus/activities/actions/NavigateAction.java @@ -373,7 +373,9 @@ public class NavigateAction { if(!showDefault) { values.remove(ApplicationMode.DEFAULT); } - selected.add(settings.getApplicationMode()); + if (showDefault || settings.getApplicationMode() != ApplicationMode.DEFAULT) { + selected.add(settings.getApplicationMode()); + } return prepareAppModeView(a, values, selected, parent, singleSelection, onClickListener); } From 68faacec3f324d9778ef989b0bbabf338f6fd986 Mon Sep 17 00:00:00 2001 From: vshcherb Date: Mon, 24 Feb 2014 01:16:21 +0100 Subject: [PATCH 2/2] Fix loosing default profile after change --- OsmAnd/src/net/osmand/plus/ApplicationMode.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/ApplicationMode.java b/OsmAnd/src/net/osmand/plus/ApplicationMode.java index 989055834f..7aecd11413 100644 --- a/OsmAnd/src/net/osmand/plus/ApplicationMode.java +++ b/OsmAnd/src/net/osmand/plus/ApplicationMode.java @@ -174,7 +174,7 @@ public class ApplicationMode { } public static List allPossibleValues(OsmandSettings settings) { - return values; + return new ArrayList(values); }