Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is setAlpha() not working in RecyclerViews?

Tags:

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?