I was going through developer site of android and I found a class named ContentLoadingProgressBar. By seeing this class I come up with some questions in my mind
One note of using ContentLoadingProgressBar for recyclerview items. I have a scenario in which an arbitrary RV item can download something on clicked and shows indeterminate progress until completion. It appears to be impossible to use the benefits of CLPB in such case because of maintaining internal delays in CLPB when show()/hide() it: reused views may have inconsisted progress state (progress disappears or become infinite depending on reused holder view state). Thus i was forced to return to old good setVisibility:
public void onBindViewHolder(final RecyclerView.ViewHolder holder, int position)
...
if (item.isLoading()) {
//holder.progressBar.show();
holder.progressBar.setVisibility(View.VISIBLE);
} else {
//holder.progressBar.hide();
holder.progressBar.setVisibility(View.INVISIBLE);
}