I have found some image gallery demo on below link: http://www.androidauthority.com/how-to-build-an-image-gallery-app-718976/
But it's loading all the images together. How do I add OnScrollListeners to this project?
I have found some image gallery demo on below link: http://www.androidauthority.com/how-to-build-an-image-gallery-app-718976/
But it's loading all the images together. How do I add OnScrollListeners to this project?
You have to do code on your Adapter
OnBindViewHolder()
methodThis is your Code :
In the above code
onBindViewHolder(MyAdapter.ViewHolder viewHolder, int i)
hereint i
is the position of the image by gettingposition
you can perform action within OnBindViewHolder.Note : In RecyclerView
OnBindViewHolder
is calling in every row ,So what you have to do just code inside of the OnBindViewHolder.Its not setting images in a single time Recyclerview getting images by calling OnbindViewHolder for every row and setting the images.