Fix settings import

This commit is contained in:
max-klaus 2020-03-21 12:06:17 +03:00
parent 912c88cc43
commit 8aa6fb1eb2

View file

@ -140,14 +140,20 @@ public class SettingsHelper {
boolean shouldReplace = false;
SettingsItem(@NonNull SettingsItemType type) {
init();
this.type = type;
}
SettingsItem(@NonNull SettingsItemType type, @NonNull JSONObject json) throws JSONException {
init();
this.type = type;
readFromJson(json);
}
protected void init() {
// override
}
@NonNull
public SettingsItemType getType() {
return type;
@ -349,10 +355,16 @@ public class SettingsHelper {
public abstract static class CollectionSettingsItem<T> extends SettingsItem {
protected List<T> items = new ArrayList<>();
protected List<T> duplicateItems = new ArrayList<>();
protected List<T> items;
protected List<T> duplicateItems;
protected List<T> existingItems;
@Override
protected void init() {
items = new ArrayList<>();
duplicateItems = new ArrayList<>();
}
CollectionSettingsItem(@NonNull SettingsItemType type, @NonNull List<T> items) {
super(type);
this.items = items;