Improve display

This commit is contained in:
Phillip Thelen 2024-05-23 10:55:53 +02:00
parent 04d73f262c
commit 071fb953f0
2 changed files with 8 additions and 3 deletions

View file

@ -269,7 +269,7 @@ private fun AvatarEquipmentView(
}
.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))
} else {
PixelArtView(

View file

@ -75,8 +75,13 @@ class ShopItemViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView), Vi
val isLimited = item.isLimited || item.availableUntil != null
if (numberOwned > 0) {
binding.itemDetailIndicator.text = numberOwned.toString()
binding.itemDetailIndicator.background =
AppCompatResources.getDrawable(context, R.drawable.pill_bg_gray)
if (isLimited) {
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
} else if (item.locked) {
binding.itemDetailIndicator.background =