Java 类com.bumptech.glide.load.resource.gif.GifDataResource 实例源码

项目:saarang-iosched    文件:GifBitmapWrapperTransformation.java   
@Override
public Resource<GifBitmapWrapper> transform(Resource<GifBitmapWrapper> resource, int outWidth, int outHeight) {
    Resource<Bitmap> bitmapResource = resource.get().getBitmapResource();
    if (bitmapResource != null) {
        Resource<Bitmap> transformed = wrapped.transform(bitmapResource, outWidth, outHeight);
        if (transformed != bitmapResource) {
            GifBitmapWrapper gifBitmap = new GifBitmapWrapper(transformed, null);
            return new GifBitmapWrapperResource(gifBitmap);
        }
    } else {
        //TODO: this should be pushed down into a GifData transformation?
        Resource<GifData> gifResource = resource.get().getGifResource();
        GifData gifData = gifResource.get();
        Transformation<Bitmap> newTransformation =
                new MultiTransformation<Bitmap>(gifData.getFrameTransformation(), wrapped);
        gifData.setFrameTransformation(newTransformation);
        return new GifBitmapWrapperResource(new GifBitmapWrapper(null, new GifDataResource(gifData)));
    }
    return resource;
}
项目:AppDevFestSudeste2015    文件:GifBitmapWrapperTransformation.java   
@Override
public Resource<GifBitmapWrapper> transform(Resource<GifBitmapWrapper> resource, int outWidth, int outHeight) {
    Resource<Bitmap> bitmapResource = resource.get().getBitmapResource();
    if (bitmapResource != null) {
        Resource<Bitmap> transformed = wrapped.transform(bitmapResource, outWidth, outHeight);
        if (transformed != bitmapResource) {
            GifBitmapWrapper gifBitmap = new GifBitmapWrapper(transformed, null);
            return new GifBitmapWrapperResource(gifBitmap);
        }
    } else {
        //TODO: this should be pushed down into a GifData transformation?
        Resource<GifData> gifResource = resource.get().getGifResource();
        GifData gifData = gifResource.get();
        Transformation<Bitmap> newTransformation =
                new MultiTransformation<Bitmap>(gifData.getFrameTransformation(), wrapped);
        gifData.setFrameTransformation(newTransformation);
        return new GifBitmapWrapperResource(new GifBitmapWrapper(null, new GifDataResource(gifData)));
    }
    return resource;
}
项目:devfestnorte-app    文件:GifBitmapWrapperTransformation.java   
@Override
public Resource<GifBitmapWrapper> transform(Resource<GifBitmapWrapper> resource, int outWidth, int outHeight) {
    Resource<Bitmap> bitmapResource = resource.get().getBitmapResource();
    if (bitmapResource != null) {
        Resource<Bitmap> transformed = wrapped.transform(bitmapResource, outWidth, outHeight);
        if (transformed != bitmapResource) {
            GifBitmapWrapper gifBitmap = new GifBitmapWrapper(transformed, null);
            return new GifBitmapWrapperResource(gifBitmap);
        }
    } else {
        //TODO: this should be pushed down into a GifData transformation?
        Resource<GifData> gifResource = resource.get().getGifResource();
        GifData gifData = gifResource.get();
        Transformation<Bitmap> newTransformation =
                new MultiTransformation<Bitmap>(gifData.getFrameTransformation(), wrapped);
        gifData.setFrameTransformation(newTransformation);
        return new GifBitmapWrapperResource(new GifBitmapWrapper(null, new GifDataResource(gifData)));
    }
    return resource;
}
项目:saarang-iosched    文件:GifBitmapWrapperTransformation.java   
@Override
public Resource<GifBitmapWrapper> transform(Resource<GifBitmapWrapper> resource, int outWidth, int outHeight) {
    Resource<Bitmap> bitmapResource = resource.get().getBitmapResource();
    if (bitmapResource != null) {
        Resource<Bitmap> transformed = wrapped.transform(bitmapResource, outWidth, outHeight);
        if (transformed != bitmapResource) {
            GifBitmapWrapper gifBitmap = new GifBitmapWrapper(transformed, null);
            return new GifBitmapWrapperResource(gifBitmap);
        }
    } else {
        //TODO: this should be pushed down into a GifData transformation?
        Resource<GifData> gifResource = resource.get().getGifResource();
        GifData gifData = gifResource.get();
        Transformation<Bitmap> newTransformation =
                new MultiTransformation<Bitmap>(gifData.getFrameTransformation(), wrapped);
        gifData.setFrameTransformation(newTransformation);
        return new GifBitmapWrapperResource(new GifBitmapWrapper(null, new GifDataResource(gifData)));
    }
    return resource;
}