I'm trying to use Glide within my RecyclerView, and I've got a question regarding the code they used in their documentation. Code is shown below:
public void onBindViewHolder(ViewHolder holder, int position) {
if (isImagePosition(position)) {
String url = urls.get(position);
Glide.with(fragment)
.load(url)
.into(holder.imageView);
} else {
Glide.with(fragment).clear(holder.imageView);
holder.imageView.setImageDrawable(specialDrawable);
}
}
what I don't get is "isImagePosition(position)". What is this? Is this a check to see if the same view is being loaded to the same position when the RecyclerView's data set is updated? If that was the case, how would I implement "isImagePosition(position)"?
My recycler view uses a List ImageUrl.