Merge pull request #8963 from osmandapp/AddBrowseMap

add "Browse Map" to profiles list
This commit is contained in:
vshcherb 2020-05-14 14:15:42 +02:00 committed by GitHub
commit d7a6fa6606
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View file

@ -56,7 +56,7 @@ public class SelectMultipleProfilesBottomSheet extends BasePreferenceBottomSheet
private void refreshProfiles(OsmandApplication app) {
profiles.clear();
profiles.addAll(NavigationFragment.getBaseProfiles(app));
profiles.addAll(NavigationFragment.getBaseProfiles(app, true));
for (ProfileDataObject profile : profiles) {
String key = profile.getStringKey();
profile.setSelected(selectedProfiles.contains(key));

View file

@ -251,9 +251,13 @@ public class NavigationFragment extends BaseSettingsFragment {
}
public static List<ProfileDataObject> getBaseProfiles(OsmandApplication app) {
return getBaseProfiles(app, false);
}
public static List<ProfileDataObject> getBaseProfiles(OsmandApplication app, boolean includeBrowseMap) {
List<ProfileDataObject> profiles = new ArrayList<>();
for (ApplicationMode mode : ApplicationMode.allPossibleValues()) {
if (mode != ApplicationMode.DEFAULT) {
if (mode != ApplicationMode.DEFAULT || includeBrowseMap) {
String description = mode.getDescription();
if (Algorithms.isEmpty(description)) {
description = getAppModeDescription(app, mode);