coil-base / coil.target / PoolableViewTarget
interface PoolableViewTarget<T :
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 improves performance.
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.
|Name ||Summary |
|onClear ||Called when the current drawable is no longer usable. Targets must stop using the current Drawable. |
abstract fun onClear():