I want to show a photo series with no gaps in-between the photos, where photos change in a regular interval. I realized Picasso initializes the ImageView before it starts downloading, and it always does that, no matter if I fetch() or not before calling into().
I fetch() to keep the gap between images small and also use .placeholder(R.color.black), but the gap is still visible, even when the image is loaded from memory.
My code looks like this
Picasso.with(getContext()).load(url).fetch();
then with a delay [which is currently fix and which I want to adjust dependent on network speed]
Picasso.with(getContext()).load(url).into(screenSurface);
I noticed that fetch() does not support any callback parameters and returns void, so it seems it's not possible for me to know when the cache is warmed.
Two questions:
- Can I get noticed when an image is cached?
- Is there maybe a different way to get rid of the breaks between the images and make them appear regularly.
[I know I could manually code this somehow, but if Picasso supports it, I'd like to use it.]
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…