load

open fun load(model: Any): RequestBuilder<TranscodeType>

Sets the specific model to load data for.

Return

This request builder.

Parameters

model

The model to load data for, or null.


open fun load(bitmap: Bitmap): RequestBuilder<TranscodeType>

Returns an object to load the given Bitmap.

It's almost always better to allow Glide to load Bitmaps than pass Bitmaps into Glide. If you have a custom way to obtain Bitmaps that is not supported by Glide by default, consider registering a custom com.bumptech.glide.load.model.ModelLoader or com.bumptech.glide.load.ResourceDecoder instead of using this method.

The DiskCacheStrategy is set to NONE. Previous calls to apply or previously applied DiskCacheStrategys will be overridden by this method. Applying an DiskCacheStrategy other than NONE after calling this method may result in undefined behavior.

In memory caching relies on Object equality. The contents of the Bitmaps are not compared.

See also


open fun load(drawable: Drawable): RequestBuilder<TranscodeType>

Returns a request builder to load the given Drawable.

It's almost always better to allow Glide to load Bitmaps than to pass s into Glide using this method . If you have a custom way to obtain Bitmaps that is not supported by Glide by default, consider registering a custom or com.bumptech.glide.load.ResourceDecoder instead of using this method.

The DiskCacheStrategy is set to NONE. Previous calls to apply or previously applied DiskCacheStrategys will be overridden by this method. Applying an DiskCacheStrategy other than NONE after calling this method may result in undefined behavior.

In memory caching relies on Object equality. The contents of the Drawables are not compared.

See also


open fun load(string: String): RequestBuilder<TranscodeType>

Returns a request builder to load the given java.lang.String.

Note - this method caches data using only the given String as the cache key. If the data is a Uri outside of your control, or you otherwise expect the data represented by the given String to change without the String identifier changing, Consider using signature to mixin a signature you create that identifies the data currently at the given String that will invalidate the cache if that data changes. Alternatively, using NONE and/or skipMemoryCache may be appropriate.

See also

Parameters

string

A file path, or a uri or url handled by .


open fun load(uri: Uri): RequestBuilder<TranscodeType>

Returns a request builder to load the given Uri.

Note - this method caches data at Uris using only the Uri itself as the cache key. The data represented by Uris from some content providers may change without the Uri changing, which means using this method can lead to displaying stale data. Consider using signature to mixin a signature you create based on the data at the given Uri that will invalidate the cache if that data changes. Alternatively, using NONE and/or skipMemoryCache may be appropriate.

See also

Parameters

uri

The Uri representing the image. Must be of a type handled by .


open fun load(file: File): RequestBuilder<TranscodeType>

Returns a request builder to load the given File.

Note - this method caches data for Files using only the file path itself as the cache key. The data in the File can change so using this method can lead to displaying stale data. If you expect the data in the File to change, Consider using signature to mixin a signature you create that identifies the data currently in the File that will invalidate the cache if that data changes. Alternatively, using NONE and/or skipMemoryCache may be appropriate.

See also

Parameters

file

The File containing the image


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. Defaults to to load resource id models.

By default this method adds a version code and night mode based signature to the cache key used to cache this resource in Glide. This signature is sufficient to guarantee that end users will see the most up to date versions of your Drawables, but during development if you do not increment your version code before each install and you replace a Drawable with different data without changing the Drawable name, you may see inconsistent cached data. To get around this, consider using NONE via diskCacheStrategy during development, and re-enabling the default RESOURCE for release builds.

This method will load non-android.graphics.Bitmap resources like s. Although Glide makes a best effort to apply s to these Drawables by either extracting the underlying Bitmap or by converting the Drawable to a Bitmap, Glide is still not able to transform all types of resources. Animated Drawables cannot be transformed (other than com.bumptech.glide.load.resource.gif.GifDrawable). To avoid load failures if a Drawable can't be transformed, use the optional transformation methods like optionalTransform.

In some cases converting Drawables to Bitmaps may be inefficient. Use this method, especially in conjunction with com.bumptech.glide.load.Transformations with caution for non-BitmapDrawables.

See also


open fun load(url: URL): RequestBuilder<TranscodeType>

Returns a request builder to load the given URL.

Deprecated

The java.net.URL class has a number of performance problems and should generally be avoided when possible. Prefer load or load.

See also

Parameters

url

The URL representing the image.


open fun load(model: Array<Byte>): RequestBuilder<TranscodeType>

Returns a request to load the given byte array.

Note - by default loads for bytes are not cached in either the memory or the disk cache.

See also

Parameters

model

the data to load.