fix: Show the category color on removable chips
This commit is contained in:
parent
908bf293b0
commit
18325d87ad
|
@ -43,12 +43,17 @@ class CategoryChipAdapter(
|
|||
val category = categories[position]
|
||||
|
||||
if (holder is CategoryViewHolder) {
|
||||
// Regular category chip
|
||||
holder.textView.text = category.name
|
||||
holder.textView.backgroundTintList = ColorStateList.valueOf(category.color.toArgb())
|
||||
} else if (holder is RemovableCategoryViewHolder) {
|
||||
// Removable category chip
|
||||
holder.textView.text = category.name
|
||||
holder.textView.backgroundTintList = ColorStateList.valueOf(category.color.toArgb())
|
||||
|
||||
// Apply background tint to the LinearLayout (container)
|
||||
holder.itemView.backgroundTintList = ColorStateList.valueOf(category.color.toArgb())
|
||||
|
||||
// Set up the remove button's click listener
|
||||
holder.removeButton.setOnClickListener {
|
||||
onRemoveCategory?.invoke(category, position)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue