use of com.bumptech.glide.load.resource.bitmap.BitmapDrawableTransformation in project glide by bumptech.
the class BaseRequestOptions method optionalTransform.
/**
* Applies the given {@link com.bumptech.glide.load.Transformation} for
* {@link android.graphics.Bitmap Bitmaps} to the default types ({@link android.graphics.Bitmap},
* {@link android.graphics.drawable.BitmapDrawable}, and
* {@link com.bumptech.glide.load.resource.gif.GifDrawable}) and ignores unknown types.
*
* <p>This will override previous calls to {@link #dontTransform()}.
*
* @param context Any {@link android.content.Context}.
* @param transformation Any {@link com.bumptech.glide.load.Transformation} for
* {@link android.graphics.Bitmap}s.
* @see #transform(android.content.Context, com.bumptech.glide.load.Transformation)
* @see #transform(Class, com.bumptech.glide.load.Transformation)
*/
public CHILD optionalTransform(Context context, Transformation<Bitmap> transformation) {
if (isAutoCloneEnabled) {
return clone().optionalTransform(context, transformation);
}
optionalTransform(Bitmap.class, transformation);
// TODO: remove BitmapDrawable decoder and this transformation.
optionalTransform(BitmapDrawable.class, new BitmapDrawableTransformation(context, transformation));
optionalTransform(GifDrawable.class, new GifDrawableTransformation(context, transformation));
return selfOrThrowIfLocked();
}
use of com.bumptech.glide.load.resource.bitmap.BitmapDrawableTransformation in project Rocket by mozilla-tw.
the class RequestOptions method optionalTransform.
/**
* Applies the given {@link Transformation} for
* {@link Bitmap Bitmaps} to the default types ({@link Bitmap},
* {@link android.graphics.drawable.BitmapDrawable}, and ignores unknown types.
*
* <p>This will override previous calls to {@link #dontTransform()}.
*
* @param transformation Any {@link Transformation} for {@link Bitmap}s.
* @see #transform(Transformation)
* @see #transform(Class, Transformation)
*/
// Guaranteed to modify the current object by the isAutoCloneEnabledCheck.
@SuppressWarnings("CheckResult")
@CheckResult
public RequestOptions optionalTransform(Transformation<Bitmap> transformation) {
if (isAutoCloneEnabled) {
return clone().optionalTransform(transformation);
}
optionalTransform(Bitmap.class, transformation);
// TODO: remove BitmapDrawable decoder and this transformation.
optionalTransform(BitmapDrawable.class, new BitmapDrawableTransformation(transformation));
return selfOrThrowIfLocked();
}
Aggregations