mirror of
https://github.com/sudoxnym/habitica-android.git
synced 2026-07-14 10:11:58 +00:00
Improve display
This commit is contained in:
parent
04d73f262c
commit
071fb953f0
2 changed files with 8 additions and 3 deletions
|
|
@ -269,7 +269,7 @@ private fun AvatarEquipmentView(
|
||||||
}
|
}
|
||||||
.background(colorResource(id = R.color.window_background)),
|
.background(colorResource(id = R.color.window_background)),
|
||||||
) {
|
) {
|
||||||
if (item.key.isNullOrBlank() || item.key == "0" || item.key?.endsWith("_0") == true) {
|
if (item.key.isNullOrBlank() || item.key == "0" || item.key?.endsWith("_0") == true || item.key == "none") {
|
||||||
Image(painterResource(R.drawable.empty_slot), contentDescription = null, contentScale = ContentScale.None, modifier = Modifier.size(68.dp))
|
Image(painterResource(R.drawable.empty_slot), contentDescription = null, contentScale = ContentScale.None, modifier = Modifier.size(68.dp))
|
||||||
} else {
|
} else {
|
||||||
PixelArtView(
|
PixelArtView(
|
||||||
|
|
|
||||||
|
|
@ -75,8 +75,13 @@ class ShopItemViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView), Vi
|
||||||
val isLimited = item.isLimited || item.availableUntil != null
|
val isLimited = item.isLimited || item.availableUntil != null
|
||||||
if (numberOwned > 0) {
|
if (numberOwned > 0) {
|
||||||
binding.itemDetailIndicator.text = numberOwned.toString()
|
binding.itemDetailIndicator.text = numberOwned.toString()
|
||||||
binding.itemDetailIndicator.background =
|
if (isLimited) {
|
||||||
AppCompatResources.getDrawable(context, R.drawable.pill_bg_gray)
|
binding.itemDetailIndicator.background = AppCompatResources.getDrawable(context, R.drawable.pill_bg_purple_300)
|
||||||
|
binding.itemDetailIndicator.setTextColor(ContextCompat.getColor(context, R.color.white))
|
||||||
|
} else {
|
||||||
|
binding.itemDetailIndicator.background = AppCompatResources.getDrawable(context, R.drawable.pill_bg_gray)
|
||||||
|
binding.itemDetailIndicator.setTextColor(ContextCompat.getColor(context, R.color.text_quad))
|
||||||
|
}
|
||||||
binding.itemDetailIndicator.visibility = View.VISIBLE
|
binding.itemDetailIndicator.visibility = View.VISIBLE
|
||||||
} else if (item.locked) {
|
} else if (item.locked) {
|
||||||
binding.itemDetailIndicator.background =
|
binding.itemDetailIndicator.background =
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue