com.bumptech.glide.load.resource.gifbitmap
Class GifBitmapWrapperTransformation

java.lang.Object
  extended by com.bumptech.glide.load.resource.gifbitmap.GifBitmapWrapperTransformation
All Implemented Interfaces:
Transformation<GifBitmapWrapper>

public class GifBitmapWrapperTransformation
extends Object
implements Transformation<GifBitmapWrapper>

A Transformation that can apply a wrapped Bitmap transformation to both Bitmaps and GifDrawable.


Constructor Summary
GifBitmapWrapperTransformation(BitmapPool bitmapPool, Transformation<Bitmap> bitmapTransformation)
           
 
Method Summary
 String getId()
          A method to get a unique identifier for this particular transformation that can be used as part of a cache key.
 Resource<GifBitmapWrapper> transform(Resource<GifBitmapWrapper> resource, int outWidth, int outHeight)
          Transforms the given resource and returns the transformed resource.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GifBitmapWrapperTransformation

public GifBitmapWrapperTransformation(BitmapPool bitmapPool,
                                      Transformation<Bitmap> bitmapTransformation)
Method Detail

transform

public Resource<GifBitmapWrapper> transform(Resource<GifBitmapWrapper> resource,
                                            int outWidth,
                                            int outHeight)
Description copied from interface: Transformation
Transforms the given resource and returns the transformed resource.

Note - If the original resource object is not returned, the original resource will be recycled and it's internal resources may be reused. This means it is not safe to rely on the original resource or any internal state of the original resource in any new resource that is created. Usually this shouldn't occur, but if absolutely necessary either the original resource object can be returned with modified internal state, or the data in the original resource can be copied into the transformed resource.

Specified by:
transform in interface Transformation<GifBitmapWrapper>
Parameters:
resource - The resource to transform.
outWidth - The width of the view or target the resource will be displayed in, or Target.SIZE_ORIGINAL to indicate the original resource width.
outHeight - The height of the view or target the resource will be displayed in, or Target.SIZE_ORIGINAL to indicate the original resource height.
Returns:
The transformed resource.

getId

public String getId()
Description copied from interface: Transformation
A method to get a unique identifier for this particular transformation that can be used as part of a cache key. The fully qualified class name for this class is appropriate if written out, but getClass().getName() is not because the name may be changed by proguard.

If this transformation does not affect the data that will be stored in cache, returning an empty string here is acceptable.

Specified by:
getId in interface Transformation<GifBitmapWrapper>
Returns:
A string that uniquely identifies this transformation.