change
therefore, apparently, the guys in the square are just starting to move forward with their things. https://github.com/square/picasso/pull/665
therefore, Lucasr took over and re-organized part of the code. Now pause / resume can be performed in groups, all requests have DEFAULT_GROUP , and, apparently, the idea of ββScrollListener has been crossed out because there is too much simple implementation for them, but this is the same code @ a.bertucci.
public class SampleScrollListener implements AbsListView.OnScrollListener { private final Context context; private static final Object scrollTag = new Object();
This implementation comes with the idea that you tag your requests with context, but you can also easily tag your own tags by default.
original answer:
There is already a PullRequest for Picasso for this feature: https://github.com/square/picasso/pull/561
This is a little different than what you suggested, but it works fine (I use in my application). You have the option to pause / resume sending images to ImageViews and use onScrollListener to pause its resumption.
The code for it is simple:
listView.setOnScrollListener(new PicassoScrollListener(context));
I agree that forks are annoying because they can become obsolete, but they can develop it themselves and keep it in the know until it is drained into Picasso.
- Picasso original fork
- add this as a remote https://github.com/sockeqwe/picasso and select it
- create your picasso / master branch and cherry, pick these 10 commits from sockeqwe / picasso.
- pull a picasso / master as often as you want
This is not perfect, but the programming is done for you, and it works very well.
Alternatively, you can use my compile 'com.eyeem.picasso:picasso:2.3.3-SNAPSHOT' application fork compile 'com.eyeem.picasso:picasso:2.3.3-SNAPSHOT' and keep an eye on this tensile request until it is merged and you return.
Budius
source share