mirror of
https://github.com/sudoxnym/habitica-android.git
synced 2026-05-19 12:18:59 +00:00
Fix task deserialization issue
This commit is contained in:
parent
fe90b25010
commit
f18943eabe
3 changed files with 10 additions and 5 deletions
|
|
@ -21,6 +21,10 @@ open class Task : RealmObject, Parcelable {
|
|||
@PrimaryKey
|
||||
@SerializedName("_id")
|
||||
var id: String? = null
|
||||
set(value) {
|
||||
field = value
|
||||
repeat?.taskId = value
|
||||
}
|
||||
var userId: String = ""
|
||||
var priority: Float = 0.0f
|
||||
var text: String = ""
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ public class SubscriptionPlan extends RealmObject {
|
|||
public Integer gemsBought;
|
||||
public Integer extraMonths;
|
||||
public Integer quantity;
|
||||
@Nullable
|
||||
public SubscriptionPlanConsecutive consecutive;
|
||||
|
||||
public int mysteryItemCount;
|
||||
|
|
@ -39,7 +40,7 @@ public class SubscriptionPlan extends RealmObject {
|
|||
}
|
||||
|
||||
public int totalNumberOfGems() {
|
||||
if (customerId == null) {
|
||||
if (customerId == null || consecutive == null) {
|
||||
return 0;
|
||||
}
|
||||
return 25 + consecutive.getGemCapExtra();
|
||||
|
|
|
|||
|
|
@ -75,13 +75,13 @@ class SubscriptionDetailsView : LinearLayout {
|
|||
|
||||
paymentProcessorTextView.text = plan.paymentMethod
|
||||
|
||||
if (plan.consecutive.count == 1) {
|
||||
if (plan.consecutive?.count == 1) {
|
||||
monthsSubscribedTextView.text = resources.getString(R.string.one_month)
|
||||
} else {
|
||||
monthsSubscribedTextView.text = resources.getString(R.string.months, plan.consecutive.count)
|
||||
monthsSubscribedTextView.text = resources.getString(R.string.months, plan.consecutive?.count ?: 0)
|
||||
}
|
||||
gemCapTextView.text = (plan.consecutive.gemCapExtra + 25).toString()
|
||||
currentHourglassesTextView.text = plan.consecutive.trinkets.toString()
|
||||
gemCapTextView.text = (plan.consecutive?.gemCapExtra ?: 0 + 25).toString()
|
||||
currentHourglassesTextView.text = plan.consecutive?.trinkets.toString()
|
||||
|
||||
if (plan.paymentMethod != null) {
|
||||
if (plan.paymentMethod == "Google") {
|
||||
|
|
|
|||
Loading…
Reference in a new issue