Builder

class Builder

Constructors

Builder
Link copied to clipboard
fun Builder(context: Context)

Functions

addLastModifiedToFileCacheKey
Link copied to clipboard
fun addLastModifiedToFileCacheKey(enable: Boolean): <ERROR CLASS>
Enables adding File.lastModified to the memory cache key when loading an image from a File.
allowHardware
Link copied to clipboard
fun allowHardware(enable: Boolean): <ERROR CLASS>
Allow the use of Bitmap.Config.HARDWARE.
allowRgb565
Link copied to clipboard
fun allowRgb565(enable: Boolean): <ERROR CLASS>
Allow automatically using Bitmap.Config.RGB_565 when an image is guaranteed to not have alpha.
bitmapConfig
Link copied to clipboard
fun bitmapConfig(bitmapConfig: Bitmap.Config): <ERROR CLASS>
Set the preferred Bitmap.Config.
bitmapFactoryExifOrientationPolicy
Link copied to clipboard
fun bitmapFactoryExifOrientationPolicy(policy: ExifOrientationPolicy): <ERROR CLASS>
Sets the policy for handling the EXIF orientation flag for images decoded by BitmapFactoryDecoder.
bitmapFactoryMaxParallelism
Link copied to clipboard
fun bitmapFactoryMaxParallelism(maxParallelism: Int): <ERROR CLASS>
Sets the maximum number of parallel BitmapFactory decode operations at once.
build
Link copied to clipboard
fun build(): ImageLoader
Create a new ImageLoader instance.
callFactory
Link copied to clipboard
fun callFactory(initializer: () -> Call.Factory): <ERROR CLASS>
Set a lazy callback to create the Call.Factory used for network requests.
fun callFactory(callFactory: Call.Factory): <ERROR CLASS>
Set the Call.Factory used for network requests.
components
Link copied to clipboard
fun components(components: ComponentRegistry): <ERROR CLASS>
inline fun components(builder: ComponentRegistry.Builder.() -> Unit): <ERROR CLASS>
Build and set the ComponentRegistry.
crossfade
Link copied to clipboard
fun crossfade(enable: Boolean): <ERROR CLASS>
Enable a crossfade animation with duration CrossfadeDrawable.DEFAULT_DURATION milliseconds when a request completes successfully.
fun crossfade(durationMillis: Int): <ERROR CLASS>
Enable a crossfade animation with durationMillis milliseconds when a request completes successfully.
decoderDispatcher
Link copied to clipboard
fun decoderDispatcher(dispatcher: CoroutineDispatcher): <ERROR CLASS>
The CoroutineDispatcher that Decoder.decode will be executed on.
diskCache
Link copied to clipboard
fun diskCache(diskCache: DiskCache?): <ERROR CLASS>
Set the DiskCache.
fun diskCache(initializer: () -> DiskCache?): <ERROR CLASS>
Set a lazy callback to create the DiskCache.
diskCachePolicy
Link copied to clipboard
fun diskCachePolicy(policy: CachePolicy): <ERROR CLASS>
Set the default disk cache policy.
dispatcher
Link copied to clipboard
fun dispatcher(dispatcher: CoroutineDispatcher): <ERROR CLASS>
A convenience function to set fetcherDispatcher, decoderDispatcher, and transformationDispatcher in one call.
error
Link copied to clipboard
fun error(drawable: Drawable?): <ERROR CLASS>
Set the default error drawable to use when a request fails.
fun error(@DrawableRes() drawableResId: Int): <ERROR CLASS>
Set the default error drawable to use when a request fails.
eventListener
Link copied to clipboard
fun eventListener(listener: EventListener): <ERROR CLASS>
Set a single EventListener that will receive all callbacks for requests launched by this image loader.
eventListenerFactory
Link copied to clipboard
fun eventListenerFactory(factory: EventListener.Factory): <ERROR CLASS>
Set the EventListener.Factory to create per-request EventListeners.
fallback
Link copied to clipboard
fun fallback(drawable: Drawable?): <ERROR CLASS>
Set the default fallback drawable to use if ImageRequest.data is null.
fun fallback(@DrawableRes() drawableResId: Int): <ERROR CLASS>
Set the default fallback drawable to use if ImageRequest.data is null.
fetcherDispatcher
Link copied to clipboard
fun fetcherDispatcher(dispatcher: CoroutineDispatcher): <ERROR CLASS>
The CoroutineDispatcher that Fetcher.fetch will be executed on.
interceptorDispatcher
Link copied to clipboard
fun interceptorDispatcher(dispatcher: CoroutineDispatcher): <ERROR CLASS>
The CoroutineDispatcher that the Interceptor chain will be executed on.
logger
Link copied to clipboard
fun logger(logger: Logger?): <ERROR CLASS>
Set the Logger to write logs to.
memoryCache
Link copied to clipboard
fun memoryCache(memoryCache: MemoryCache?): <ERROR CLASS>
Set the MemoryCache.
fun memoryCache(initializer: () -> MemoryCache?): <ERROR CLASS>
Set a lazy callback to create the MemoryCache.
memoryCachePolicy
Link copied to clipboard
fun memoryCachePolicy(policy: CachePolicy): <ERROR CLASS>
Set the default memory cache policy.
networkCachePolicy
Link copied to clipboard
fun networkCachePolicy(policy: CachePolicy): <ERROR CLASS>
Set the default network cache policy.
networkObserverEnabled
Link copied to clipboard
fun networkObserverEnabled(enable: Boolean): <ERROR CLASS>
Enables short circuiting network requests if the device is offline.
okHttpClient
Link copied to clipboard
fun okHttpClient(initializer: () -> OkHttpClient): <ERROR CLASS>
Set a lazy callback to create the OkHttpClient used for network requests.
fun okHttpClient(okHttpClient: OkHttpClient): <ERROR CLASS>
Set the OkHttpClient used for network requests.
placeholder
Link copied to clipboard
fun placeholder(drawable: Drawable?): <ERROR CLASS>
Set the default placeholder drawable to use when a request starts.
fun placeholder(@DrawableRes() drawableResId: Int): <ERROR CLASS>
Set the default placeholder drawable to use when a request starts.
precision
Link copied to clipboard
fun precision(precision: Precision): <ERROR CLASS>
Set the default precision for a request.
respectCacheHeaders
Link copied to clipboard
fun respectCacheHeaders(enable: Boolean): <ERROR CLASS>
Enables support for network cache headers.
transformationDispatcher
Link copied to clipboard
fun transformationDispatcher(dispatcher: CoroutineDispatcher): <ERROR CLASS>
The CoroutineDispatcher that Transformation.transform will be executed on.
transitionFactory
Link copied to clipboard
fun transitionFactory(factory: Transition.Factory): <ERROR CLASS>
Set the default Transition.Factory for each request.