Fixes of SettingsHelper

This commit is contained in:
max-klaus 2020-03-20 22:12:19 +03:00
parent a2c5624930
commit 1110dd5166
4 changed files with 428 additions and 437 deletions

File diff suppressed because it is too large Load diff

View file

@ -808,8 +808,8 @@ public class ImportHelper {
pluginIndependentItems.removeAll(pluginItems);
for (SettingsHelper.SettingsItem item : pluginItems) {
item.setShouldReplace(true);
if (item instanceof SettingsHelper.QuickActionSettingsItem) {
plugin.quickActions = ((SettingsHelper.QuickActionSettingsItem) item).getItems();
if (item instanceof SettingsHelper.QuickActionsSettingsItem) {
plugin.quickActions = ((SettingsHelper.QuickActionsSettingsItem) item).getItems();
}
if (item instanceof SettingsHelper.PoiUiFilterSettingsItem) {
plugin.poiUIFilters = ((SettingsHelper.PoiUiFilterSettingsItem) item).getItems();

View file

@ -299,7 +299,7 @@ public class ExportProfileBottomSheet extends BasePreferenceBottomSheet {
}
}
if (!quickActions.isEmpty()) {
settingsItems.add(new SettingsHelper.QuickActionSettingsItem(app, quickActions));
settingsItems.add(new SettingsHelper.QuickActionsSettingsItem(app, quickActions));
}
if (!poiUIFilters.isEmpty()) {
settingsItems.add(new SettingsHelper.PoiUiFilterSettingsItem(app, poiUIFilters));

View file

@ -328,7 +328,7 @@ public class ImportSettingsFragment extends BaseOsmAndFragment
}
}
if (!quickActions.isEmpty()) {
settingsItems.add(new SettingsHelper.QuickActionSettingsItem(app, quickActions));
settingsItems.add(new QuickActionsSettingsItem(app, quickActions));
}
if (!poiUIFilters.isEmpty()) {
settingsItems.add(new SettingsHelper.PoiUiFilterSettingsItem(app, poiUIFilters));
@ -355,9 +355,9 @@ public class ImportSettingsFragment extends BaseOsmAndFragment
for (SettingsItem item : settingsItems) {
if (item.getType().equals(SettingsItemType.PROFILE)) {
profiles.add(((ProfileSettingsItem) item).getModeBean());
} else if (item.getType().equals(SettingsItemType.QUICK_ACTION)) {
quickActions.addAll(((QuickActionSettingsItem) item).getItems());
quickActions.addAll(((QuickActionSettingsItem) item).getDuplicateItems());
} else if (item.getType().equals(SettingsItemType.QUICK_ACTIONS)) {
quickActions.addAll(((QuickActionsSettingsItem) item).getItems());
quickActions.addAll(((QuickActionsSettingsItem) item).getDuplicateItems());
} else if (item.getType().equals(SettingsItemType.POI_UI_FILTERS)) {
poiUIFilters.addAll(((PoiUiFilterSettingsItem) item).getItems());
poiUIFilters.addAll(((PoiUiFilterSettingsItem) item).getDuplicateItems());