mirror of
https://github.com/sudoxnym/habitica-android.git
synced 2026-05-20 12:49:02 +00:00
Fix pet/mount display
This commit is contained in:
parent
d0b56baef5
commit
1a7ff616af
2 changed files with 6 additions and 2 deletions
|
|
@ -87,7 +87,7 @@ class StableRecyclerAdapter : androidx.recyclerview.widget.RecyclerView.Adapter<
|
|||
"Mount_Icon_" + item.key
|
||||
}
|
||||
this.ownedTextView.text = animal?.numberOwned?.toString()
|
||||
ownedTextView.visibility = View.GONE
|
||||
ownedTextView.visibility = if (animal?.numberOwned == 0) View.GONE else View.VISIBLE
|
||||
imageView.background = null
|
||||
DataBindingUtils.loadImage(imageName) {
|
||||
val drawable = BitmapDrawable(context?.resources, if (item.numberOwned > 0) it else it.extractAlpha())
|
||||
|
|
|
|||
|
|
@ -15,7 +15,11 @@ class OwnedMountListDeserializer : JsonDeserializer<List<OwnedMount>> {
|
|||
for (entry in entrySet) {
|
||||
val item = OwnedMount()
|
||||
item.key = entry.key
|
||||
item.owned = entry.value.asBoolean
|
||||
if (entry.value.isJsonNull) {
|
||||
item.owned = false
|
||||
} else {
|
||||
item.owned = entry.value.asBoolean
|
||||
}
|
||||
ownedItems.add(item)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue