diff --git a/Habitica/assets/migrations/Habitica/7.sql b/Habitica/assets/migrations/Habitica/7.sql new file mode 100644 index 000000000..1617262ac --- /dev/null +++ b/Habitica/assets/migrations/Habitica/7.sql @@ -0,0 +1 @@ +ALTER TABLE Customization ADD COLUMN customizationSetName varchar(255); \ No newline at end of file diff --git a/Habitica/res/layout/avatar_with_bars.xml b/Habitica/res/layout/avatar_with_bars.xml index 047b1d0d1..4f8dceb32 100644 --- a/Habitica/res/layout/avatar_with_bars.xml +++ b/Habitica/res/layout/avatar_with_bars.xml @@ -31,6 +31,7 @@ (); CustomizationSet lastSet = new CustomizationSet(); for (Customization customization : newCustomizationList) { - if (customization.getCustomizationSet() != null && !customization.getCustomizationSet().equals(lastSet.text)) { + if (customization.getCustomizationSet() != null && !customization.getCustomizationSet().equals(lastSet.identifier)) { CustomizationSet set = new CustomizationSet(); - set.text = customization.getCustomizationSet(); + set.identifier = customization.getCustomizationSet(); + set.text = customization.getCustomizationSetName(); set.price = customization.getSetPrice(); set.hasPurchasable = !customization.isUsable(); lastSet = set; @@ -250,8 +251,7 @@ public class CustomizationRecyclerViewAdapter extends RecyclerView.Adapter customizations = select.queryList(); adapter.setCustomizationList(customizations); diff --git a/Habitica/src/com/magicmicky/habitrpgwrapper/lib/models/Customization.java b/Habitica/src/com/magicmicky/habitrpgwrapper/lib/models/Customization.java index 01c219185..0a1ea008a 100644 --- a/Habitica/src/com/magicmicky/habitrpgwrapper/lib/models/Customization.java +++ b/Habitica/src/com/magicmicky/habitrpgwrapper/lib/models/Customization.java @@ -16,7 +16,7 @@ public class Customization extends BaseModel { private String id; @Column - private String identifier, category, type, notes, customizationSet, text; + private String identifier, category, type, notes, customizationSet, customizationSetName, text; @Column private boolean purchased; @@ -49,6 +49,7 @@ public class Customization extends BaseModel { public void setId(String id) {this.id = id;} public void setNotes(String notes) {this.notes = notes;} public void setCustomizationSet(String customizationSet) {this.customizationSet = customizationSet;} + public void setCustomizationSetName(String customizationSetName) {this.customizationSetName = customizationSetName;} public void setText(String text) {this.text = text;} public void setPurchased(boolean purchased) {this.purchased = purchased;} public void setPrice(Integer price) {this.price = price;} @@ -62,6 +63,7 @@ public class Customization extends BaseModel { public String getType() { return this.type; } public String getNotes() { return this.notes; } public String getCustomizationSet() { return this.customizationSet; } + public String getCustomizationSetName() { return this.customizationSetName; } public String getText() { return this.text; } @SuppressWarnings("RedundantIfStatement") diff --git a/Habitica/src/com/magicmicky/habitrpgwrapper/lib/models/CustomizationSet.java b/Habitica/src/com/magicmicky/habitrpgwrapper/lib/models/CustomizationSet.java index b0efb74ba..07443ddba 100644 --- a/Habitica/src/com/magicmicky/habitrpgwrapper/lib/models/CustomizationSet.java +++ b/Habitica/src/com/magicmicky/habitrpgwrapper/lib/models/CustomizationSet.java @@ -6,6 +6,7 @@ package com.magicmicky.habitrpgwrapper.lib.models; public class CustomizationSet { public String text; + public String identifier; public Integer price; public boolean hasPurchasable; diff --git a/Habitica/src/com/magicmicky/habitrpgwrapper/lib/utils/CustomizationDeserializer.java b/Habitica/src/com/magicmicky/habitrpgwrapper/lib/utils/CustomizationDeserializer.java index 51c70883f..99fa5e915 100644 --- a/Habitica/src/com/magicmicky/habitrpgwrapper/lib/utils/CustomizationDeserializer.java +++ b/Habitica/src/com/magicmicky/habitrpgwrapper/lib/utils/CustomizationDeserializer.java @@ -128,6 +128,7 @@ public class CustomizationDeserializer implements JsonDeserializer