com.bumptech.glide
Class Glide.Request<T>

java.lang.Object
  extended by com.bumptech.glide.Glide.Request<T>
Type Parameters:
T - The type of model that will be loaded into the target
Enclosing class:
Glide

public static class Glide.Request<T>
extends java.lang.Object

Sets a variety of type independent options including resizing, animations, and placeholders. Responsible for building or retrieving an ImagePresenter for the given target and passing the ImagePresenter the given model.


Method Summary
 Glide.Request<T> animate(int animationId)
          Sets an animation to run on the wrapped target when an image load finishes.
 Glide.Request<T> approximate()
          Load images at a size near the size of the target using Downsampler.AT_LEAST.
 Glide.Request<T> asIs()
          Load images at their original size using Downsampler.NONE.
 Glide.Request<T> centerCrop()
          Transform images using CenterCrop.
 Glide.Request<T> downsample(Downsampler downsampler)
          Load images using the given Downsampler.
 Glide.Request<T> error(int resourceId)
          Sets a resource to display if a load fails
 Glide.Request<T> fitCenter()
          Transform images using FitCenter.
 void into(android.widget.ImageView imageView)
          Start loading the image into the view.
 Glide.ContextRequest into(Target target)
          Set the target the image will be loaded into.
 Glide.Request<T> listener(Glide.RequestListener<T> requestListener)
          Sets a Request listener to monitor the image load.
 Glide.Request<T> placeholder(int resourceId)
          Sets a resource to display while an image is loading
 Glide.Request<T> transform(Transformation transformation)
          Set an arbitrary transformation to apply after an image has been loaded into memory.
 Glide.Request<T> transform(TransformationLoader<T> transformationLoader)
          Transform images with the given TransformationLoader.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

approximate

public Glide.Request<T> approximate()
Load images at a size near the size of the target using Downsampler.AT_LEAST.

Returns:
This Request
See Also:
downsample(com.bumptech.glide.resize.load.Downsampler)

asIs

public Glide.Request<T> asIs()
Load images at their original size using Downsampler.NONE.

Returns:
This Request
See Also:
downsample(com.bumptech.glide.resize.load.Downsampler)

downsample

public Glide.Request<T> downsample(Downsampler downsampler)
Load images using the given Downsampler. Replaces any existing downsampler. Defaults to Downsampler.AT_LEAST

Parameters:
downsampler - The downsampler
Returns:
This Request

centerCrop

public Glide.Request<T> centerCrop()
Transform images using CenterCrop.

Returns:
This Request
See Also:
transform(com.bumptech.glide.loader.transformation.TransformationLoader)

fitCenter

public Glide.Request<T> fitCenter()
Transform images using FitCenter.

Returns:
This Request
See Also:
transform(com.bumptech.glide.loader.transformation.TransformationLoader)

transform

public Glide.Request<T> transform(Transformation transformation)
Set an arbitrary transformation to apply after an image has been loaded into memory.

Parameters:
transformation - The transformation to use
Returns:
This Request
See Also:
transform(com.bumptech.glide.loader.transformation.TransformationLoader)

transform

public Glide.Request<T> transform(TransformationLoader<T> transformationLoader)
Transform images with the given TransformationLoader. Appends this transformation onto any existing transformations

Parameters:
transformationLoader - The loader to obtaian a transformation for a given model
Returns:
This Request

animate

public Glide.Request<T> animate(int animationId)
Sets an animation to run on the wrapped target when an image load finishes. Will only be run if the image was loaded asynchronously (ie was not in the memory cache)

Parameters:
animationId - The resource id of the animation to run
Returns:
This Request

placeholder

public Glide.Request<T> placeholder(int resourceId)
Sets a resource to display while an image is loading

Parameters:
resourceId - The id of the resource to use as a placeholder
Returns:
This Request

error

public Glide.Request<T> error(int resourceId)
Sets a resource to display if a load fails

Parameters:
resourceId - The id of the resource to use as a placeholder
Returns:
This request

listener

public Glide.Request<T> listener(Glide.RequestListener<T> requestListener)
Sets a Request listener to monitor the image load. It's best to create a single instance of an exception handler per type of request (usually activity/fragment) rather than pass one in per request to avoid some redundant object allocation.

Parameters:
requestListener - The request listener to use
Returns:
This request

into

public void into(android.widget.ImageView imageView)
Start loading the image into the view.

Note - This method will call View.setTag(Object) and may silently overwrite any tag that might already be set on the view.

Parameters:
imageView - The view that will display the image
See Also:
ImagePresenter.setModel(Object)

into

public Glide.ContextRequest into(Target target)
Set the target the image will be loaded into.

Note - This method does not actually start loading the view. You must first pass in a Context to returned Request via Glide.ContextRequest.with(android.content.Context).

Parameters:
target - The target to load te image for
Returns:
A Glide.ContextRequest that can start the load