I am trying to change the transparency of item-views in a RecyclerView according to certain user inputs.
if (quantity>0) {
holder.itemView.setAlpha((float) 1);
} else {
holder.itemView.setAlpha((float) 0.65);
}
Changing alpha from 0.65 to 1 works fine when quantity > 0. But the reverse is not working on the other case. When debugging, it clearly shows going through the line holder.itemView.setAlpha((float) 0.65);
However, alpha is not reduced. Any clue about what's going on?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With