Z
Z
Zestxx2017-05-24 12:24:24
Android
Zestxx, 2017-05-24 12:24:24

How to display loading progress bar inside ViewHolder?

Friends, the crux of the matter is this. There is a list of downloads displayed in the RecyclerView, and in each element of the list there is a progress bar. It is necessary to display in each element the current state of the progress of uploading to the server.
How would it be better to implement it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Denis Zagaevsky, 2017-05-24
@Zestxx

When updating each value (% loaded), change it in the list you set to the adapter and call notifyItemChanged on the adapter. You can also do the latter with DiffUtil.
In onBindViewHolder set the value of the progress bar.
I forgot to add - it is necessary to notify with payload (any). Then for the corresponding holder, bind will simply be called again

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question