diff --git a/OsmAnd/src/net/osmand/plus/helpers/ImportHelper.java b/OsmAnd/src/net/osmand/plus/helpers/ImportHelper.java index acb174ad42..c82053bcae 100644 --- a/OsmAnd/src/net/osmand/plus/helpers/ImportHelper.java +++ b/OsmAnd/src/net/osmand/plus/helpers/ImportHelper.java @@ -788,7 +788,6 @@ public class ImportHelper { ExportImportProfileBottomSheet.showInstance( fragmentManager, ExportImportProfileBottomSheet.State.IMPORT, - file, items); } } else { diff --git a/OsmAnd/src/net/osmand/plus/profiles/ExportImportProfileBottomSheet.java b/OsmAnd/src/net/osmand/plus/profiles/ExportImportProfileBottomSheet.java index 456b8b94e5..0527197799 100644 --- a/OsmAnd/src/net/osmand/plus/profiles/ExportImportProfileBottomSheet.java +++ b/OsmAnd/src/net/osmand/plus/profiles/ExportImportProfileBottomSheet.java @@ -85,8 +85,6 @@ public class ExportImportProfileBottomSheet extends BasePreferenceBottomSheet { private List settingsItems; - private File file; - private SettingsHelper.ProfileSettingsItem profileSettingsItem; @Override @@ -191,11 +189,14 @@ public class ExportImportProfileBottomSheet extends BasePreferenceBottomSheet { List dataList = new ArrayList<>(); List quickActions = new ArrayList<>(); List poiUIFilters = new ArrayList<>(); + List mapSourceWrappers = new ArrayList<>(); for (SettingsHelper.SettingsItem item : settingsItems) { if (item.getType().equals(SettingsHelper.SettingsItemType.QUICK_ACTION_LIST)) { quickActions.addAll(((SettingsHelper.QuickActionSettingsItem) item).getQuickActions()); } else if (item.getType().equals(SettingsHelper.SettingsItemType.POI_UI_FILTERS_LIST)) { -// poiUIFilters.addAll() +// poiUIFilters.addAll(((SettingsHelper.PoiUiFilterSettingsItem) item).) + } else if (item.getType().equals(SettingsHelper.SettingsItemType.MAP_SOURCES_LIST)) { +// mapSourceWrappers.addAll(((SettingsHelper.MapSourcesSettingsItem) item).) } } if (!quickActions.isEmpty()) { @@ -208,6 +209,12 @@ public class ExportImportProfileBottomSheet extends BasePreferenceBottomSheet { AdditionalDataWrapper.Type.POI_TYPES, poiUIFilters)); } + if (!mapSourceWrappers.isEmpty()) { + dataList.add(new AdditionalDataWrapper( + AdditionalDataWrapper.Type.MAP_SOURCES, + mapSourceWrappers + )); + } for (AdditionalDataWrapper dataWrapper : dataList) { dataToOperate.addAll(dataWrapper.getItems()); } @@ -252,7 +259,7 @@ public class ExportImportProfileBottomSheet extends BasePreferenceBottomSheet { )); } - final LinkedHashMap entriesMap = new LinkedHashMap<>(settings.getTileSourceEntries()); + final LinkedHashMap entriesMap = new LinkedHashMap<>(settings.getTileSourceEntries(false)); List mapSourceWrapperList = new ArrayList<>(); for (Map.Entry entry : entriesMap.entrySet()) { mapSourceWrapperList.add(new MapSourceWrapper(entry.getKey(), entry.getValue())); @@ -403,7 +410,6 @@ public class ExportImportProfileBottomSheet extends BasePreferenceBottomSheet { public static boolean showInstance(@NonNull FragmentManager fragmentManager, State state, - File file, List items) { try { Bundle bundle = new Bundle(); @@ -411,7 +417,6 @@ public class ExportImportProfileBottomSheet extends BasePreferenceBottomSheet { ExportImportProfileBottomSheet fragment = new ExportImportProfileBottomSheet(); fragment.setArguments(bundle); fragment.setSettingsItems(items); - fragment.setFile(file); fragment.show(fragmentManager, TAG); return true; } catch (RuntimeException e) { @@ -419,14 +424,6 @@ public class ExportImportProfileBottomSheet extends BasePreferenceBottomSheet { } } - public File getFile() { - return file; - } - - public void setFile(File file) { - this.file = file; - } - public enum State { EXPORT, IMPORT