Builder

class Builder

Constructors

Builder
Link copied to clipboard
fun Builder(context: Context)
Builder
Link copied to clipboard
fun Builder(request: ImageRequest, context: Context = request.context)

Functions

addHeader
Link copied to clipboard
fun addHeader(name: String, value: String): <ERROR CLASS>
Add a header for any network operations performed by this request.
allowConversionToBitmap
Link copied to clipboard
fun allowConversionToBitmap(enable: Boolean): <ERROR CLASS>
Allow converting the result drawable to a bitmap to apply any transformations.
allowHardware
Link copied to clipboard
fun allowHardware(enable: Boolean): <ERROR CLASS>
allowRgb565
Link copied to clipboard
fun allowRgb565(enable: Boolean): <ERROR CLASS>
bitmapConfig
Link copied to clipboard
fun bitmapConfig(config: Bitmap.Config): <ERROR CLASS>
build
Link copied to clipboard
fun build(): ImageRequest
Create a new ImageRequest.
colorSpace
Link copied to clipboard
@RequiresApi(value = 26)
fun colorSpace(colorSpace: ColorSpace): <ERROR CLASS>
Set the preferred ColorSpace.
crossfade
Link copied to clipboard
fun crossfade(enable: Boolean): <ERROR CLASS>
fun crossfade(durationMillis: Int): <ERROR CLASS>
data
Link copied to clipboard
fun data(data: Any?): <ERROR CLASS>
Set the data to load.
decoderDispatcher
Link copied to clipboard
fun decoderDispatcher(dispatcher: CoroutineDispatcher): <ERROR CLASS>
decoderFactory
Link copied to clipboard
fun decoderFactory(factory: Decoder.Factory): <ERROR CLASS>
Use factory to handle decoding any image data.
defaults
Link copied to clipboard
fun defaults(defaults: DefaultRequestOptions): <ERROR CLASS>
Set the defaults for any unset request values.
diskCacheKey
Link copied to clipboard
fun diskCacheKey(key: String?): <ERROR CLASS>
Set the disk cache key for this request.
diskCachePolicy
Link copied to clipboard
fun diskCachePolicy(policy: CachePolicy): <ERROR CLASS>
Enable/disable reading/writing from/to the disk cache.
dispatcher
Link copied to clipboard
fun dispatcher(dispatcher: CoroutineDispatcher): <ERROR CLASS>
error
Link copied to clipboard
fun error(drawable: Drawable?): <ERROR CLASS>
Set the error drawable to use if the request fails.
fun error(@DrawableRes() drawableResId: Int): <ERROR CLASS>
Set the error drawable to use if the request fails.
fallback
Link copied to clipboard
fun fallback(drawable: Drawable?): <ERROR CLASS>
Set the fallback drawable to use if data is null.
fun fallback(@DrawableRes() drawableResId: Int): <ERROR CLASS>
Set the fallback drawable to use if data is null.
fetcherDispatcher
Link copied to clipboard
fun fetcherDispatcher(dispatcher: CoroutineDispatcher): <ERROR CLASS>
fetcherFactory
Link copied to clipboard
inline fun <T : Any> fetcherFactory(factory: Fetcher.Factory<T>): <ERROR CLASS>
Use factory to handle fetching any image data.
fun <T : Any> fetcherFactory(factory: Fetcher.Factory<T>, type: Class<T>): <ERROR CLASS>
Use factory to handle fetching any image data.
headers
Link copied to clipboard
fun headers(headers: Headers): <ERROR CLASS>
Set the Headers for any network operations performed by this request.
interceptorDispatcher
Link copied to clipboard
fun interceptorDispatcher(dispatcher: CoroutineDispatcher): <ERROR CLASS>
lifecycle
Link copied to clipboard
fun lifecycle(lifecycle: Lifecycle?): <ERROR CLASS>
Set the Lifecycle for this request.
fun lifecycle(owner: LifecycleOwner?): <ERROR CLASS>
Set the Lifecycle for this request.
listener
Link copied to clipboard
fun listener(listener: ImageRequest.Listener?): <ERROR CLASS>
Set the Listener.
inline fun listener(crossinline onStart: (request: ImageRequest) -> Unit = {}, crossinline onCancel: (request: ImageRequest) -> Unit = {}, crossinline onError: (request: ImageRequest, result: ErrorResult) -> Unit = { _, _ -> }, crossinline onSuccess: (request: ImageRequest, result: SuccessResult) -> Unit = { _, _ -> }): <ERROR CLASS>
Convenience function to create and set the Listener.
memoryCacheKey
Link copied to clipboard
fun memoryCacheKey(key: MemoryCache.Key?): <ERROR CLASS>
Set the memory cache key for this request.
fun memoryCacheKey(key: String?): <ERROR CLASS>
Set the memory cache key for this request.
memoryCachePolicy
Link copied to clipboard
fun memoryCachePolicy(policy: CachePolicy): <ERROR CLASS>
Enable/disable reading/writing from/to the memory cache.
networkCachePolicy
Link copied to clipboard
fun networkCachePolicy(policy: CachePolicy): <ERROR CLASS>
Enable/disable reading from the network.
parameters
Link copied to clipboard
fun parameters(parameters: Parameters): <ERROR CLASS>
Set the parameters for this request.
placeholder
Link copied to clipboard
fun placeholder(drawable: Drawable?): <ERROR CLASS>
Set the placeholder drawable to use when the request starts.
fun placeholder(@DrawableRes() drawableResId: Int): <ERROR CLASS>
Set the placeholder drawable to use when the request starts.
placeholderMemoryCacheKey
Link copied to clipboard
fun placeholderMemoryCacheKey(key: MemoryCache.Key?): <ERROR CLASS>
Set the memory cache key whose value will be used as the placeholder drawable.
fun placeholderMemoryCacheKey(key: String?): <ERROR CLASS>
Set the memory cache key whose value will be used as the placeholder drawable.
precision
Link copied to clipboard
fun precision(precision: Precision): <ERROR CLASS>
Set the precision for the size of the loaded image.
premultipliedAlpha
Link copied to clipboard
fun premultipliedAlpha(enable: Boolean): <ERROR CLASS>
Enable/disable pre-multiplication of the color (RGB) channels of the decoded image by the alpha channel.
removeHeader
Link copied to clipboard
fun removeHeader(name: String): <ERROR CLASS>
Remove all network headers with the key name.
removeParameter
Link copied to clipboard
fun removeParameter(key: String): <ERROR CLASS>
Remove a parameter from this request.
scale
Link copied to clipboard
fun scale(scale: Scale): <ERROR CLASS>
Set the scaling algorithm that will be used to fit/fill the image into the size provided by sizeResolver.
setHeader
Link copied to clipboard
fun setHeader(name: String, value: String): <ERROR CLASS>
Set a header for any network operations performed by this request.
setParameter
Link copied to clipboard
fun setParameter(key: String, value: Any?, memoryCacheKey: String? = value?.toString()): <ERROR CLASS>
Set a parameter for this request.
size
Link copied to clipboard
fun size(size: Size): <ERROR CLASS>
Set the requested width/height.
fun size(resolver: SizeResolver): <ERROR CLASS>
Set the SizeResolver to resolve the requested width/height.
fun size(@Px() size: Int): <ERROR CLASS>
Set the requested width/height.
fun size(width: Dimension, height: Dimension): <ERROR CLASS>
Set the requested width/height.
fun size(@Px() width: Int, @Px() height: Int): <ERROR CLASS>
Set the requested width/height.
tag
Link copied to clipboard
inline fun <T : Any> tag(tag: T?): <ERROR CLASS>
Attach tag to this request using T as the key.
fun <T : Any> tag(type: Class<in T>, tag: T?): <ERROR CLASS>
Attach tag to this request using type as the key.
tags
Link copied to clipboard
fun tags(tags: Tags): <ERROR CLASS>
Set the tags for this request.
target
Link copied to clipboard
fun target(imageView: ImageView): <ERROR CLASS>
Convenience function to set imageView as the Target.
fun target(target: Target?): <ERROR CLASS>
Set the Target.
inline fun target(crossinline onStart: (placeholder: Drawable?) -> Unit = {}, crossinline onError: (error: Drawable?) -> Unit = {}, crossinline onSuccess: (result: Drawable) -> Unit = {}): <ERROR CLASS>
Convenience function to create and set the Target.
transformationDispatcher
Link copied to clipboard
fun transformationDispatcher(dispatcher: CoroutineDispatcher): <ERROR CLASS>
transformations
Link copied to clipboard
fun transformations(vararg transformations: Transformation): <ERROR CLASS>
Set the list of Transformations to be applied to this request.
fun transformations(transformations: List<Transformation>): <ERROR CLASS>
Set the list of Transformations to be applied to this request.
transitionFactory
Link copied to clipboard
fun transitionFactory(transition: Transition.Factory): <ERROR CLASS>