public interface CurationsImageLoader
| Modifier and Type | Method and Description |
|---|---|
void |
cancel(java.lang.Object tag)
Use this to cancel in flight requests.
|
java.lang.Object |
getTag(android.widget.ImageView imageView)
Use this to get a tag from an
ImageView which you should
set while implementing loadInto(ImageView, String, int, int). |
void |
loadInto(android.widget.ImageView imageView,
java.lang.String imageUrl,
int widthPixels,
int heightPixels)
Use this to manage loading the provided imageUrl into the provided
imageView.
|
void cancel(java.lang.Object tag)
getTag(ImageView). This method will be
called when the view is unbound from the imageurl. The request
may or may not have completed already.
picasso.cancelTag(tag);tag - Object used to identify the request in flightvoid loadInto(android.widget.ImageView imageView,
java.lang.String imageUrl,
int widthPixels,
int heightPixels)
com.bazaarvoice.bvandroidsdk.CurationsFeedItem with the width
and height of the image at imageUrl of widthPixels and heightPixels
imageView.setTag(imageUrl);
picasso.load(imageUrl)
.tag(imageUrl)
.centerCrop()
.resize(imageSize.getWidthPixels(), imageSize.getHeightPixels())
.into(imageView);imageView - ImageView to load the image intoimageUrl - Url to fetch the image fromwidthPixels - Width in pixels of the hosted image. Optimized to container dimensionsheightPixels - Height in pixels of the hosted image. Optimized to container dimensions@Nullable java.lang.Object getTag(android.widget.ImageView imageView)
ImageView which you should
set while implementing loadInto(ImageView, String, int, int).
Although this is optional, it is encouraged to improve performance
when scrolling on a cold load.
View.setTag(Object tag)
setting the tag to be the imageUrl
return (String) imageView.getTag();imageView - The ImageView to obtain a
tag from.