optionalTransform

open fun optionalTransform(transformation: Transformation<Bitmap>): T

Applies the given Transformation for Bitmaps to the default types (Bitmap, android.graphics.drawable.BitmapDrawable, and ) and ignores unknown types.

This will override previous calls to dontTransform.

See also

Parameters

transformation

Any Transformation for Bitmaps.


open fun <Y> optionalTransform(resourceClass: Class<Y>, transformation: Transformation<Y>): T

Applies the given Transformation for any decoded resource of the given type and allows unknown resource types to be ignored.

Users can apply different transformations for each resource class. Applying a for a resource type that already has a Transformation will override the previous call.

If any calls are made to the non-optional transform methods, then attempting to transform an unknown resource class will throw an exception. To allow unknown types, users must always call the optional version of each method.

This will override previous calls to dontTransform.

Parameters

resourceClass

The type of resource to transform.

transformation

The Transformation to apply.