preload

open fun preload(width: Int, height: Int): Target<TranscodeType>

Preloads the resource into the cache using the given width and height.

Pre-loading is useful for making sure that resources you are going to to want in the near future are available quickly.

Note - Any thumbnail request that does not complete before the primary request will be cancelled and may not be preloaded successfully. Cancellation of outstanding thumbnails after the primary request succeeds is a common behavior of all Glide requests. We do not try to prevent that behavior here. If you absolutely need all thumbnails to be preloaded individually, make separate preload() requests for each thumbnail (you can still combine them into one call when loading the image(s) into the UI in a subsequent request).

Return

A Target that can be used to cancel the load via clear.

See also

Parameters

width

The desired width in pixels, or SIZE_ORIGINAL. This will be overridden by override if previously called.

height

The desired height in pixels, or SIZE_ORIGINAL. This will be overridden by override} if previously called).


open fun preload(): Target<TranscodeType>

Preloads the resource into the cache using SIZE_ORIGINAL as the target width and height. Equivalent to calling preload with SIZE_ORIGINAL as the width and height.

Return

A Target that can be used to cancel the load via clear

See also