RequestBuilder

open class RequestBuilder<TranscodeType> : BaseRequestOptions<T> , Cloneable, ModelTypes<T>

A generic class that can handle setting options and staring loads for generic resource types.

Parameters

<TranscodeType>

The type of resource that will be delivered to the .

Functions

Link copied to clipboard
open fun addListener(requestListener: RequestListener<TranscodeType>): RequestBuilder<TranscodeType>
Adds a RequestListener to the list that will be called in the order they were added when the request ends.
Link copied to clipboard
open fun apply(requestOptions: BaseRequestOptions<out Any>): RequestBuilder<TranscodeType>
Applies the given options to the request.
Link copied to clipboard
open fun autoClone(): T
Similar to lock except that mutations cause a clone operation to happen before the mutation resulting in all methods returning a new Object and leaving the original locked object unmodified.
Link copied to clipboard
open fun centerCrop(): T
Applies CenterCrop to all default types and throws an exception if asked to transform an unknown type.
Link copied to clipboard
open fun centerInside(): T
Applies CenterInside to all default types, CENTER_INSIDE to image types and throws an exception if asked to transform an unknown type.
Link copied to clipboard
open fun circleCrop(): T
Applies CircleCrop to all default types and throws an exception if asked to transform an unknown type.
Link copied to clipboard
open fun clone(): RequestBuilder<TranscodeType>
Returns a copy of this request builder with all of the options put so far on this builder.
Link copied to clipboard
open fun decode(resourceClass: Class<out Any>): T
Link copied to clipboard
open fun disallowHardwareConfig(): T
Disables the use of HARDWARE in Downsampler to avoid errors caused by inspecting Bitmap pixels, drawing with hardware support disabled, drawing to android.graphics.
Link copied to clipboard
open fun diskCacheStrategy(strategy: DiskCacheStrategy): T
Sets the DiskCacheStrategy to use for this load.
Link copied to clipboard
open fun dontAnimate(): T
Disables resource decoders that return animated resources so any resource returned will be static.
Link copied to clipboard
open fun dontTransform(): T
Removes all applied Transformations for all resource classes and allows unknown resource types to be transformed without throwing an exception.
Link copied to clipboard
open fun <Y : Target<File>?> downloadOnly(target: Y): Y
Loads the original unmodified data into the cache and calls the given Target with the cache File.
open fun downloadOnly(width: Int, height: Int): FutureTarget<File>
Loads the original unmodified data into the cache and returns a that can be used to retrieve the cache File containing the data.
Link copied to clipboard
open fun downsample(strategy: DownsampleStrategy): T
Sets the DownsampleStrategy to use when decoding Bitmaps using .
Link copied to clipboard
open fun encodeFormat(format: CompressFormat): T
Sets the value for key COMPRESSION_FORMAT.
Link copied to clipboard
open fun encodeQuality(quality: Int): T
Sets the value for key COMPRESSION_QUALITY.
Link copied to clipboard
open fun equals(o: Any): Boolean
Link copied to clipboard
open fun error(drawable: Drawable): T
Sets a Drawable to display if a load fails.
open fun error(resourceId: Int): T
Sets a resource to display if a load fails.
open fun error(errorBuilder: RequestBuilder<TranscodeType>): RequestBuilder<TranscodeType>
Sets a RequestBuilder that is built and run if the load started by this fails.
open fun error(model: Any): RequestBuilder<TranscodeType>
Identical to calling error where the RequestBuilder is the result of calling clone and removing any existing thumbnail and error RequestBuilders.
Link copied to clipboard
open fun fallback(drawable: Drawable): T
Sets an Drawable to display if the model provided to load is null.
open fun fallback(resourceId: Int): T
Sets a resource to display if the model provided to load is null.
Link copied to clipboard
open fun fitCenter(): T
Applies FitCenter and to all default types, FIT_CENTER to image types, and throws an exception if asked to transform an unknown type.
Link copied to clipboard
open fun format(format: DecodeFormat): T
Sets the DecodeFormat to use when decoding Bitmap objects using and Glide's default GIF decoders.
Link copied to clipboard
open fun frame(frameTimeMicros: Long): T
Sets the time position of the frame to extract from a video.
Link copied to clipboard
open fun hashCode(): Int
Link copied to clipboard
open fun into(view: ImageView): ViewTarget<ImageView, TranscodeType>
Sets the ImageView the resource will be loaded into, cancels any existing loads into the view, and frees any resources Glide may have previously loaded into the view so they may be reused.
open fun <Y : Target<TranscodeType>?> into(target: Y): Y
Set the target the resource will be loaded into.
open fun into(width: Int, height: Int): FutureTarget<TranscodeType>
Returns a future that can be used to do a blocking get on a background thread.
Link copied to clipboard
fun isDiskCacheStrategySet(): Boolean
Link copied to clipboard
fun isMemoryCacheable(): Boolean
Link copied to clipboard
fun isPrioritySet(): Boolean
Link copied to clipboard
fun isSkipMemoryCacheSet(): Boolean
Link copied to clipboard
fun isTransformationSet(): Boolean
Link copied to clipboard
fun isValidOverride(): Boolean
Link copied to clipboard
open fun listener(requestListener: RequestListener<TranscodeType>): RequestBuilder<TranscodeType>
Sets a RequestListener to monitor the resource load and removes all previously set listeners (either via this method or from addListener .
Link copied to clipboard
open fun load(bitmap: Bitmap): RequestBuilder<TranscodeType>
Returns an object to load the given Bitmap.
open fun load(drawable: Drawable): RequestBuilder<TranscodeType>
Returns a request builder to load the given Drawable.
open fun load(uri: Uri): RequestBuilder<TranscodeType>
Returns a request builder to load the given Uri.
open fun load(model: Array<Byte>): RequestBuilder<TranscodeType>
Returns a request to load the given byte array.
open fun load(file: File): RequestBuilder<TranscodeType>
Returns a request builder to load the given File.
open fun load(resourceId: Integer): RequestBuilder<TranscodeType>
Returns a request builder that uses the currently registered or Integer to load the image represented by the given Integer resource id.
open fun load(model: Any): RequestBuilder<TranscodeType>
Sets the specific model to load data for.
open fun load(string: String): RequestBuilder<TranscodeType>
Returns a request builder to load the given java.lang.String.
open fun load(url: URL): RequestBuilder<TranscodeType>
Returns a request builder to load the given URL.
Link copied to clipboard
open fun lock(): T
Throws if any further mutations are attempted.
Link copied to clipboard
open fun onlyRetrieveFromCache(flag: Boolean): T
If set to true, will only load an item if found in the cache, and will not fetch from source.
Link copied to clipboard
open fun optionalCenterCrop(): T
Applies com.bumptech.glide.load.resource.bitmap.CenterCrop to all default types, and ignores unknown types.
Link copied to clipboard
open fun optionalCenterInside(): T
Applies com.bumptech.glide.load.resource.bitmap.CenterInside to all default types, CENTER_INSIDE to image types, and ignores unknown types.
Link copied to clipboard
open fun optionalCircleCrop(): T
Applies CircleCrop to all default types, and ignores unknown types.
Link copied to clipboard
open fun optionalFitCenter(): T
Applies FitCenter and to all default types, FIT_CENTER to image types, and ignores unknown types.
Link copied to clipboard
open fun optionalTransform(transformation: Transformation<Bitmap>): T
Applies the given Transformation for Bitmaps to the default types (Bitmap, android.graphics.drawable.
open fun <Y> optionalTransform(resourceClass: Class<Y>, transformation: Transformation<Y>): T
Applies the given Transformation for any decoded resource of the given type and allows unknown resource types to be ignored.
Link copied to clipboard
open fun override(size: Int): T
Overrides the com.bumptech.glide.request.target.Target's width and height with the given size.
open fun override(width: Int, height: Int): T
Overrides the com.bumptech.glide.request.target.Target's width and height with the given values.
Link copied to clipboard
open fun placeholder(drawable: Drawable): T
Sets an Drawable to display while a resource is loading.
open fun placeholder(resourceId: Int): T
Sets an Android resource id for a Drawable resource to display while a resource is loading.
Link copied to clipboard
open fun preload(): Target<TranscodeType>
Preloads the resource into the cache using SIZE_ORIGINAL as the target width and height.
open fun preload(width: Int, height: Int): Target<TranscodeType>
Preloads the resource into the cache using the given width and height.
Link copied to clipboard
open fun priority(priority: Any): T
Sets the priority for this load.
Link copied to clipboard
open fun <Y> set(option: Option<Y>, value: Y): T
Link copied to clipboard
open fun signature(signature: Key): T
Sets some additional data to be mixed in to the memory and disk cache keys allowing the caller more control over when cached data is invalidated.
Link copied to clipboard
open fun sizeMultiplier(sizeMultiplier: Float): T
Applies a multiplier to the com.bumptech.glide.request.target.Target's size before loading the resource.
Link copied to clipboard
open fun skipMemoryCache(skip: Boolean): T
Allows the loaded resource to skip the memory cache.
Link copied to clipboard
open fun submit(): FutureTarget<TranscodeType>
open fun submit(width: Int, height: Int): FutureTarget<TranscodeType>
Returns a future that can be used to do a blocking get on a background thread.
Link copied to clipboard
open fun theme(theme: Theme): T
Sets the android.content.res.Resources.
Link copied to clipboard
open fun thumbnail(thumbnails: Array<RequestBuilder<TranscodeType>>): RequestBuilder<TranscodeType>
open fun thumbnail(thumbnails: List<RequestBuilder<TranscodeType>>): RequestBuilder<TranscodeType>
Recursively applies thumbnail so that the RequestBuilders are loaded as thumbnails in the given priority order.
open fun thumbnail(thumbnailRequest: RequestBuilder<TranscodeType>): RequestBuilder<TranscodeType>
Loads and displays the resource retrieved by the given thumbnail request if it finishes before this request.
open fun thumbnail(sizeMultiplier: Float): RequestBuilder<TranscodeType>
Loads a resource in an identical manner to this request except with the dimensions of the target multiplied by the given size multiplier.
Link copied to clipboard
open fun timeout(timeoutMs: Int): T
Sets the read and write timeout for the http requests used to load the image.
Link copied to clipboard
open fun transform(transformations: Array<Transformation<Bitmap>>): T
Applies the given Transformations in the given order for Bitmaps to the default types (Bitmap, android.graphics.drawable.
open fun transform(transformation: Transformation<Bitmap>): T
Applies the given Transformation for Bitmaps to the default types (Bitmap, android.graphics.drawable.
open fun <Y> transform(resourceClass: Class<Y>, transformation: Transformation<Y>): T
Applies the given Transformation for any decoded resource of the given type and throws if asked to transform an unknown resource type.
Link copied to clipboard
open fun transforms(transformations: Array<Transformation<Bitmap>>): T
Applies the given Transformations in the given order for Bitmaps to the default types (Bitmap, android.graphics.drawable.
Link copied to clipboard
open fun transition(transitionOptions: TransitionOptions<out Any, out Any>): RequestBuilder<TranscodeType>
Sets the TransitionOptions to use to transition from the placeholder or thumbnail when this load completes.
Link copied to clipboard
open fun useAnimationPool(flag: Boolean): T
If set to true, uses a special java.util.concurrent.Executor that is used exclusively for decoding frames of animated resources, like GIFs.
Link copied to clipboard
open fun useUnlimitedSourceGeneratorsPool(flag: Boolean): T
If set to true, uses a cached unlimited java.util.concurrent.Executor to run the request.

Properties

Link copied to clipboard
open val diskCacheStrategy: DiskCacheStrategy
Link copied to clipboard
open val errorId: Int
Link copied to clipboard
open val errorPlaceholder: Drawable
Link copied to clipboard
open val fallbackDrawable: Drawable
Link copied to clipboard
open val fallbackId: Int
Link copied to clipboard
open val isLocked: Boolean
Link copied to clipboard
open val isTransformationAllowed: Boolean
Link copied to clipboard
open val isTransformationRequired: Boolean
Link copied to clipboard
open val onlyRetrieveFromCache: Boolean
Link copied to clipboard
open val options: Options
Link copied to clipboard
open val overrideHeight: Int
Link copied to clipboard
open val overrideWidth: Int
Link copied to clipboard
open val placeholderDrawable: Drawable
Link copied to clipboard
open val placeholderId: Int
Link copied to clipboard
open val priority: Any
Link copied to clipboard
open val resourceClass: Class<out Any>
Link copied to clipboard
open val signature: Key
Link copied to clipboard
open val sizeMultiplier: Float
Link copied to clipboard
open val theme: Theme
Link copied to clipboard
open val transformations: Map<Class<out Any>, Transformation<out Any>>
Link copied to clipboard
open val useAnimationPool: Boolean
Link copied to clipboard
open val useUnlimitedSourceGeneratorsPool: Boolean