Poolable View Target
A ViewTarget that supports Bitmap pooling.
Implementing PoolableViewTarget opts this target into bitmap pooling. This allows Coil to re-use Bitmaps given to this target, which can conserve memory by avoiding a new Bitmap allocation.
To opt out of bitmap pooling, implement ViewTarget instead.
Implementing PoolableViewTarget requires that you must stop using the previous Drawable as soon as the next PoolableViewTarget lifecycle method is called; one of:
Target.onStart, Target.onSuccess, Target.onError, PoolableViewTarget.onClear.
For example, a PoolableViewTarget must stop using the placeholder drawable from Target.onStart as soon as Target.onSuccess is called.
Continuing to use the previous Drawable after the next lifecycle method is called can cause rendering issues and/or throw exceptions.
See also
Functions
Called when the current drawable is no longer usable. Targets must stop using the current Drawable.
Called if an error occurs while executing the request.
Called when the request starts.
Called if the request completes successfully.