-
- All Implemented Interfaces:
-
coil.request.ImageRequest.Listener
public interface EventListener implements ImageRequest.Listener
A listener for tracking the progress of an image request. This class is useful for measuring analytics, performance, or other metrics tracking.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceEventListener.Factorypublic classEventListener.Companion
-
Method Summary
-
-
Method Detail
-
onStart
@MainThread() Unit onStart(ImageRequest request)
-
resolveSizeStart
@MainThread() Unit resolveSizeStart(ImageRequest request)
Called before SizeResolver.size.
-
resolveSizeEnd
@MainThread() Unit resolveSizeEnd(ImageRequest request, Size size)
Called after SizeResolver.size.
- Parameters:
size- The resolved Size for this request.
-
mapStart
@MainThread() Unit mapStart(ImageRequest request, Object input)
Called before Mapper.map.
- Parameters:
input- The data that will be converted.
-
mapEnd
@MainThread() Unit mapEnd(ImageRequest request, Object output)
Called after Mapper.map.
- Parameters:
output- The data after it has been converted.
-
keyStart
@MainThread() Unit keyStart(ImageRequest request, Object input)
Called before Keyer.key.
- Parameters:
input- The data that will be converted.
-
keyEnd
@MainThread() Unit keyEnd(ImageRequest request, String output)
Called after Keyer.key.
- Parameters:
output- The data after it has been converted into a string key.
-
fetchStart
@WorkerThread() Unit fetchStart(ImageRequest request, Fetcher fetcher, Options options)
Called before Fetcher.fetch.
- Parameters:
fetcher- The Fetcher that will be used to handle the request.options- The Options that will be passed to Fetcher.fetch.
-
fetchEnd
@WorkerThread() Unit fetchEnd(ImageRequest request, Fetcher fetcher, Options options, FetchResult result)
Called after Fetcher.fetch.
- Parameters:
fetcher- The Fetcher that was used to handle the request.options- The Options that were passed to Fetcher.fetch.result- The result of Fetcher.fetch.
-
decodeStart
@WorkerThread() Unit decodeStart(ImageRequest request, Decoder decoder, Options options)
Called before Decoder.decode.
This is skipped if Fetcher.fetch does not return a SourceResult.
- Parameters:
decoder- The Decoder that will be used to handle the request.options- The Options that will be passed to Decoder.decode.
-
decodeEnd
@WorkerThread() Unit decodeEnd(ImageRequest request, Decoder decoder, Options options, DecodeResult result)
Called after Decoder.decode.
This is skipped if Fetcher.fetch does not return a SourceResult.
- Parameters:
decoder- The Decoder that was used to handle the request.options- The Options that were passed to Decoder.decode.result- The result of Decoder.decode.
-
transformStart
@WorkerThread() Unit transformStart(ImageRequest request, Bitmap input)
Called before any Transformations are applied.
This is skipped if ImageRequest.transformations is empty.
- Parameters:
input- The Bitmap that will be transformed.
-
transformEnd
@WorkerThread() Unit transformEnd(ImageRequest request, Bitmap output)
Called after any Transformations are applied.
This is skipped if ImageRequest.transformations is empty.
- Parameters:
output- The Bitmap that was transformed.
-
transitionStart
@MainThread() Unit transitionStart(ImageRequest request, Transition transition)
Called before Transition.transition.
This is skipped if transition is a NoneTransition or ImageRequest.target does not implement TransitionTarget.
-
transitionEnd
@MainThread() Unit transitionEnd(ImageRequest request, Transition transition)
Called after Transition.transition.
This is skipped if transition is a NoneTransition or ImageRequest.target does not implement TransitionTarget.
-
onCancel
@MainThread() Unit onCancel(ImageRequest request)
-
onError
@MainThread() Unit onError(ImageRequest request, ErrorResult result)
-
onSuccess
@MainThread() Unit onSuccess(ImageRequest request, SuccessResult result)
-
-
-
-