mirror of
https://github.com/sudoxnym/habitica-android.git
synced 2026-05-19 04:09:03 +00:00
Improve stable display
This commit is contained in:
parent
94b70d739c
commit
21f52e89e9
4 changed files with 16 additions and 3 deletions
|
|
@ -340,7 +340,7 @@
|
|||
<string name="sectiondrop">Standard</string>
|
||||
<string name="sectionpremium">Magic Potion</string>
|
||||
<string name="sectionquest">Quest</string>
|
||||
<string name="sectionspecial">Rare</string>
|
||||
<string name="sectionspecial">Special</string>
|
||||
<string name="sectionwacky">Wacky</string>
|
||||
<string name="world_quest">World Quest</string>
|
||||
<string name="inn_description">Need a break? Check into Daniel’s Inn to pause some of Habitica’s more difficult game mechanics:\n\n
|
||||
|
|
@ -894,4 +894,5 @@
|
|||
<string name="guild_description">Guild Description</string>
|
||||
<string name="invite_to_guild">Invite to Guild</string>
|
||||
<string name="join_guild">Join Guild</string>
|
||||
<string name="garden">Garden</string>
|
||||
</resources>
|
||||
|
|
|
|||
|
|
@ -96,7 +96,11 @@ class PetDetailRecyclerAdapter(data: OrderedRealmCollection<Pet>?, autoUpdate: B
|
|||
fun bind(item: Pet, ownedPet: OwnedPet?) {
|
||||
this.animal = item
|
||||
this.ownedPet = ownedPet
|
||||
this.titleView.text = item.color
|
||||
if (item.color == "Veggie") {
|
||||
this.titleView.text = context?.getString(R.string.garden)
|
||||
} else {
|
||||
this.titleView.text = item.color
|
||||
}
|
||||
this.imageView.alpha = 1.0f
|
||||
val imageName = "Pet-$itemType-${item.color}"
|
||||
if (this.ownedPet?.trained ?: 0 > 0) {
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ class StableRecyclerAdapter : androidx.recyclerview.widget.RecyclerView.Adapter<
|
|||
"Mount_Icon_" + item.key
|
||||
}
|
||||
this.ownedTextView.text = animal?.numberOwned?.toString()
|
||||
ownedTextView.visibility = if (animal?.numberOwned == 0) View.GONE else View.VISIBLE
|
||||
ownedTextView.visibility = if (animal?.numberOwned == 0 || animal?.type == "special") View.GONE else View.VISIBLE
|
||||
imageView.background = null
|
||||
DataBindingUtils.loadImage(imageName) {
|
||||
val drawable = BitmapDrawable(context?.resources, if (item.numberOwned > 0) it else it.extractAlpha())
|
||||
|
|
|
|||
|
|
@ -69,6 +69,10 @@ class ContentDeserializer : JsonDeserializer<ContentResult> {
|
|||
pet.key = petObj.getAsString("key")
|
||||
pet.text = petObj.getAsString("text")
|
||||
pet.type = petObj.getAsString("type")
|
||||
if (pet.type == "special") {
|
||||
pet.animal = pet.key.split("-")[0]
|
||||
pet.color = pet.key.split("-")[1]
|
||||
}
|
||||
if (pet.type == "premium") {
|
||||
pet.premium = true
|
||||
}
|
||||
|
|
@ -84,6 +88,10 @@ class ContentDeserializer : JsonDeserializer<ContentResult> {
|
|||
mount.color = mountObj.getAsString("potion")
|
||||
mount.key = mountObj.getAsString("key")
|
||||
mount.type = mountObj.getAsString("type")
|
||||
if (mount.type == "special") {
|
||||
mount.animal = mount.key.split("-")[0]
|
||||
mount.color = mount.key.split("-")[1]
|
||||
}
|
||||
if (mount.type == "premium") {
|
||||
mount.premium = true
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue