public class RequestCreator
extends java.lang.Object
| Modifier and Type | Method and Description | 
|---|---|
| RequestCreator | centerCrop()Crops an image inside of the bounds specified by  resize(int, int)rather than
 distorting the aspect ratio. | 
| RequestCreator | centerCrop(int alignGravity)Crops an image inside of the bounds specified by  resize(int, int)rather than
 distorting the aspect ratio. | 
| RequestCreator | centerInside()Centers an image inside of the bounds specified by  resize(int, int). | 
| RequestCreator | config(android.graphics.Bitmap.Config config)Attempt to decode the image using the specified config. | 
| RequestCreator | error(android.graphics.drawable.Drawable errorDrawable)An error drawable to be used if the request image could not be loaded. | 
| RequestCreator | error(int errorResId)An error drawable to be used if the request image could not be loaded. | 
| void | fetch()Asynchronously fulfills the request without a  ImageVieworTarget. | 
| void | fetch(Callback callback) | 
| RequestCreator | fit()Attempt to resize the image to fit exactly into the target  ImageView's bounds. | 
| android.graphics.Bitmap | get()Synchronously fulfill this request. | 
| void | into(android.widget.ImageView target)Asynchronously fulfills the request into the specified  ImageView. | 
| void | into(android.widget.ImageView target,
    Callback callback)Asynchronously fulfills the request into the specified  ImageViewand invokes the
 targetCallbackif it's notnull. | 
| void | into(android.widget.RemoteViews remoteViews,
    int viewId,
    int[] appWidgetIds)Asynchronously fulfills the request into the specified  RemoteViewsobject with the
 givenviewId. | 
| void | into(android.widget.RemoteViews remoteViews,
    int viewId,
    int[] appWidgetIds,
    Callback callback)Asynchronously fulfills the request into the specified  RemoteViewsobject with the
 givenviewId. | 
| void | into(android.widget.RemoteViews remoteViews,
    int viewId,
    int notificationId,
    android.app.Notification notification)Asynchronously fulfills the request into the specified  RemoteViewsobject with the
 givenviewId. | 
| void | into(android.widget.RemoteViews remoteViews,
    int viewId,
    int notificationId,
    android.app.Notification notification,
    java.lang.String notificationTag)Asynchronously fulfills the request into the specified  RemoteViewsobject with the
 givenviewId. | 
| void | into(android.widget.RemoteViews remoteViews,
    int viewId,
    int notificationId,
    android.app.Notification notification,
    java.lang.String notificationTag,
    Callback callback)Asynchronously fulfills the request into the specified  RemoteViewsobject with the
 givenviewId. | 
| void | into(Target target)Asynchronously fulfills the request into the specified  Target. | 
| RequestCreator | memoryPolicy(MemoryPolicy policy,
            MemoryPolicy... additional)Specifies the  MemoryPolicyto use for this request. | 
| RequestCreator | networkPolicy(NetworkPolicy policy,
             NetworkPolicy... additional)Specifies the  NetworkPolicyto use for this request. | 
| RequestCreator | noFade()Disable brief fade in of images loaded from the disk cache or network. | 
| RequestCreator | noPlaceholder()Explicitly opt-out to having a placeholder set when calling  into. | 
| RequestCreator | onlyScaleDown()Only resize an image if the original image size is bigger than the target size
 specified by  resize(int, int). | 
| RequestCreator | placeholder(android.graphics.drawable.Drawable placeholderDrawable)A placeholder drawable to be used while the image is being loaded. | 
| RequestCreator | placeholder(int placeholderResId)A placeholder drawable to be used while the image is being loaded. | 
| RequestCreator | priority(Picasso.Priority priority)Set the priority of this request. | 
| RequestCreator | purgeable()Set inPurgeable and inInputShareable when decoding. | 
| RequestCreator | resize(int targetWidth,
      int targetHeight)Resize the image to the specified size in pixels. | 
| RequestCreator | resizeDimen(int targetWidthResId,
           int targetHeightResId)Resize the image to the specified dimension size. | 
| RequestCreator | rotate(float degrees)Rotate the image by the specified degrees. | 
| RequestCreator | rotate(float degrees,
      float pivotX,
      float pivotY)Rotate the image by the specified degrees around a pivot point. | 
| RequestCreator | stableKey(java.lang.String stableKey)Sets the stable key for this request to be used instead of the URI or resource ID when
 caching. | 
| RequestCreator | tag(java.lang.Object tag)Assign a tag to this request. | 
| RequestCreator | transform(java.util.List<? extends Transformation> transformations)Add a list of custom transformations to be applied to the image. | 
| RequestCreator | transform(Transformation transformation)Add a custom transformation to be applied to the image. | 
public RequestCreator noPlaceholder()
into.
 
 By default, Picasso will either set a supplied placeholder or clear the target
 ImageView in order to ensure behavior in situations where views are recycled. This
 method will prevent that behavior and retain any already set image.
public RequestCreator placeholder(int placeholderResId)
ImageView.public RequestCreator placeholder(android.graphics.drawable.Drawable placeholderDrawable)
ImageView.
 
 If you are not using a placeholder image but want to clear an existing image (such as when
 used in an adapter), pass in null.
public RequestCreator error(int errorResId)
public RequestCreator error(android.graphics.drawable.Drawable errorDrawable)
public RequestCreator tag(java.lang.Object tag)
 You can either use simple String tags or objects that naturally
 define the scope of your requests within your app such as a
 Context, an Activity, or a
 Fragment.
 WARNING:: Picasso will keep a reference to the tag for
 as long as this tag is paused and/or has active requests. Look out for
 potential leaks.
public RequestCreator fit()
ImageView's bounds. This
 will result in delayed execution of the request until the ImageView has been laid out.
 
 Note: This method works only when your target is an ImageView.
public RequestCreator resizeDimen(int targetWidthResId, int targetHeightResId)
public RequestCreator resize(int targetWidth, int targetHeight)
public RequestCreator centerCrop()
resize(int, int) rather than
 distorting the aspect ratio. This cropping technique scales the image so that it fills the
 requested bounds and then crops the extra.public RequestCreator centerCrop(int alignGravity)
resize(int, int) rather than
 distorting the aspect ratio. This cropping technique scales the image so that it fills the
 requested bounds and then crops the extra, preferring the contents at alignGravity.public RequestCreator centerInside()
resize(int, int). This scales
 the image so that both dimensions are equal to or less than the requested bounds.public RequestCreator onlyScaleDown()
resize(int, int).public RequestCreator rotate(float degrees)
public RequestCreator rotate(float degrees, float pivotX, float pivotY)
public RequestCreator config(android.graphics.Bitmap.Config config)
 Note: This value may be ignored by BitmapFactory. See
 its documentation for more details.
public RequestCreator stableKey(java.lang.String stableKey)
public RequestCreator priority(Picasso.Priority priority)
 This will affect the order in which the requests execute but does not guarantee it.
 By default, all requests have Picasso.Priority.NORMAL priority, except for
 fetch() requests, which have Picasso.Priority.LOW priority by default.
public RequestCreator transform(Transformation transformation)
Custom transformations will always be run after the built-in transformations.
public RequestCreator transform(java.util.List<? extends Transformation> transformations)
Custom transformations will always be run after the built-in transformations.
public RequestCreator memoryPolicy(MemoryPolicy policy, MemoryPolicy... additional)
MemoryPolicy to use for this request. You may specify additional policy
 options using the varargs parameter.public RequestCreator networkPolicy(NetworkPolicy policy, NetworkPolicy... additional)
NetworkPolicy to use for this request. You may specify additional policy
 options using the varargs parameter.public RequestCreator purgeable()
Note: as of API level 21 (Lollipop), the inPurgeable field is deprecated and will be ignored.
public RequestCreator noFade()
public android.graphics.Bitmap get()
                            throws java.io.IOException
 Note: The result of this operation is not cached in memory because the underlying
 Cache implementation is not guaranteed to be thread-safe.
java.io.IOExceptionpublic void fetch()
ImageView or Target. This is
 useful when you want to warm up the cache with an image.
 Note: It is safe to invoke this method from any thread.
public void fetch(Callback callback)
ImageView or Target,
 and invokes the target Callback with the result. This is useful when you want to warm
 up the cache with an image.
 
 Note: The Callback param is a strong reference and will prevent your
 Activity or Fragment from being garbage collected
 until the request is completed.
public void into(Target target)
Target. In most cases, you
 should use this when you are dealing with a custom View or view
 holder which should implement the Target interface.
 
 Implementing on a View:
 
 public class ProfileView extends FrameLayout implements Target {
    @Override public void onBitmapLoaded(Bitmap bitmap, LoadedFrom from) {
     setBackgroundDrawable(new BitmapDrawable(bitmap));
   }
    @Override public void onBitmapFailed(Exception e, Drawable errorDrawable) {
     setBackgroundDrawable(errorDrawable);
   }
    @Override public void onPrepareLoad(Drawable placeHolderDrawable) {
     setBackgroundDrawable(placeHolderDrawable);
   }
 }
 
 public class ViewHolder implements Target {
   public FrameLayout frame;
   public TextView name;
    @Override public void onBitmapLoaded(Bitmap bitmap, LoadedFrom from) {
     frame.setBackgroundDrawable(new BitmapDrawable(bitmap));
   }
    @Override public void onBitmapFailed(Exception e, Drawable errorDrawable) {
     frame.setBackgroundDrawable(errorDrawable);
   }
    @Override public void onPrepareLoad(Drawable placeHolderDrawable) {
     frame.setBackgroundDrawable(placeHolderDrawable);
   }
 }
 
 Note: This method keeps a weak reference to the Target instance and will be
 garbage collected if you do not keep a strong reference to it. To receive callbacks when an
 image is loaded use into(android.widget.ImageView, Callback).
public void into(android.widget.RemoteViews remoteViews,
                 int viewId,
                 int notificationId,
                 android.app.Notification notification)
RemoteViews object with the
 given viewId. This is used for loading bitmaps into a Notification.public void into(android.widget.RemoteViews remoteViews,
                 int viewId,
                 int notificationId,
                 android.app.Notification notification,
                 java.lang.String notificationTag)
RemoteViews object with the
 given viewId. This is used for loading bitmaps into a Notification.public void into(android.widget.RemoteViews remoteViews,
                 int viewId,
                 int notificationId,
                 android.app.Notification notification,
                 java.lang.String notificationTag,
                 Callback callback)
RemoteViews object with the
 given viewId. This is used for loading bitmaps into a Notification.public void into(android.widget.RemoteViews remoteViews,
                 int viewId,
                 int[] appWidgetIds)
RemoteViews object with the
 given viewId. This is used for loading bitmaps into all instances of a widget.public void into(android.widget.RemoteViews remoteViews,
                 int viewId,
                 int[] appWidgetIds,
                 Callback callback)
RemoteViews object with the
 given viewId. This is used for loading bitmaps into all instances of a widget.public void into(android.widget.ImageView target)
ImageView.
 
 Note: This method keeps a weak reference to the ImageView instance and will
 automatically support object recycling.
public void into(android.widget.ImageView target,
                 Callback callback)
ImageView and invokes the
 target Callback if it's not null.
 
 Note: The Callback param is a strong reference and will prevent your
 Activity or Fragment from being garbage collected. If
 you use this method, it is strongly recommended you invoke an adjacent
 Picasso.cancelRequest(android.widget.ImageView) call to prevent temporary leaking.