Fix settings import
This commit is contained in:
parent
912c88cc43
commit
8aa6fb1eb2
1 changed files with 14 additions and 2 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue