Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cancel a gilde request in recyclerview custom module #1373

Closed
TheReprator opened this issue Jul 28, 2016 · 4 comments
Closed

cancel a gilde request in recyclerview custom module #1373

TheReprator opened this issue Jul 28, 2016 · 4 comments

Comments

@TheReprator
Copy link

https://gist.github.com/TWiStErRob/08d5807e396740e52c90

This is the gist, which explains in an excellent manner how to update view on progress,
but i don't know how to cancel a single request in this scenario.

any help would be great.

@TWiStErRob
Copy link
Collaborator

TWiStErRob commented Jul 28, 2016

Normally it would be Glide.clear(imageView), but since there's a custom target it's different here:

class ProgressViewHolder {
...
    public void clear() {
        Glide.clear(target);
    }
}

You can add an onClickListener or similar to any view in the holder that calls this method.

@TheReprator
Copy link
Author

TheReprator commented Jul 28, 2016

It will delete the current request but
like i have 5 image loading in recycler view, then how can i delete a single request like no. 3. from that 5 loading image.

@TWiStErRob
Copy link
Collaborator

The same way you would do it if there was no Glide or fanciness involved. You get ahold of the model/ViewHolder for that position and do something with it. e.g. ((MyVH)RecyclerView.findViewHolderForAdapterPosition(2)).clear().

@stale
Copy link

stale bot commented Nov 12, 2017

This issue has been automatically marked as stale because it has not had activity in the last seven days. It will be closed if no further activity occurs within the next seven days. Thank you for your contributions.

@stale stale bot added the stale label Nov 12, 2017
@stale stale bot closed this as completed Nov 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants