TranscodeType - The type of resource that will be delivered to the Target.public class RequestBuilder<TranscodeType> extends BaseRequestOptions<RequestBuilder<TranscodeType>> implements java.lang.Cloneable
| Modifier and Type | Field and Description |
|---|---|
protected static RequestOptions |
DOWNLOAD_ONLY_OPTIONS |
| Modifier | Constructor and Description |
|---|---|
protected |
RequestBuilder(java.lang.Class<TranscodeType> transcodeClass,
RequestBuilder<?> other) |
protected |
RequestBuilder(Glide glide,
RequestManager requestManager,
java.lang.Class<TranscodeType> transcodeClass,
android.content.Context context) |
| Modifier and Type | Method and Description |
|---|---|
RequestBuilder<TranscodeType> |
addListener(RequestListener<TranscodeType> requestListener)
Adds a
RequestListener to the list that will be called in the order they were added
when the request ends. |
RequestBuilder<TranscodeType> |
apply(BaseRequestOptions<?> requestOptions)
Applies the given options to the request.
|
RequestBuilder<TranscodeType> |
clone()
Returns a copy of this request builder with all of the options put so far on this builder.
|
FutureTarget<java.io.File> |
downloadOnly(int width,
int height)
Deprecated.
|
<Y extends Target<java.io.File>> |
downloadOnly(Y target)
Deprecated.
|
RequestBuilder<TranscodeType> |
error(java.lang.Object model)
Identical to calling
error(RequestBuilder) where the RequestBuilder is the
result of calling clone() and removing any existing thumbnail and error RequestBuilders. |
RequestBuilder<TranscodeType> |
error(RequestBuilder<TranscodeType> errorBuilder)
Sets a
RequestBuilder that is built and run if the load started by this RequestBuilder fails. |
protected RequestBuilder<java.io.File> |
getDownloadOnlyRequest() |
ViewTarget<android.widget.ImageView,TranscodeType> |
into(android.widget.ImageView view)
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. |
FutureTarget<TranscodeType> |
into(int width,
int height)
Deprecated.
Use
submit(int, int) instead. |
<Y extends Target<TranscodeType>> |
into(Y target)
Set the target the resource will be loaded into.
|
RequestBuilder<TranscodeType> |
listener(RequestListener<TranscodeType> requestListener)
Sets a
RequestListener to monitor the resource load and removes all previously set
listeners (either via this method or from addListener(RequestListener) . |
RequestBuilder<TranscodeType> |
load(android.graphics.Bitmap bitmap)
Returns an object to load the given
Bitmap. |
RequestBuilder<TranscodeType> |
load(byte[] model)
Returns a request to load the given byte array.
|
RequestBuilder<TranscodeType> |
load(android.graphics.drawable.Drawable drawable)
Returns a request builder to load the given
Drawable. |
RequestBuilder<TranscodeType> |
load(java.io.File file)
Returns a request builder to load the given
File. |
RequestBuilder<TranscodeType> |
load(java.lang.Integer resourceId)
Returns a request builder that uses the
ModelLoaderFactory currently registered or Integer to
load the image represented by the given Integer resource id. |
RequestBuilder<TranscodeType> |
load(java.lang.Object model)
Sets the specific model to load data for.
|
RequestBuilder<TranscodeType> |
load(java.lang.String string)
Returns a request builder to load the given
String. |
RequestBuilder<TranscodeType> |
load(android.net.Uri uri)
Returns a request builder to load the given
Uri. |
RequestBuilder<TranscodeType> |
load(java.net.URL url)
Deprecated.
The
URL class has a number of
performance problems and should generally be avoided when possible. Prefer load(android.net.Uri) or load(String). |
Target<TranscodeType> |
preload()
Preloads the resource into the cache using
Target.SIZE_ORIGINAL as the target width and
height. |
Target<TranscodeType> |
preload(int width,
int height)
Preloads the resource into the cache using the given width and height.
|
FutureTarget<TranscodeType> |
submit()
Returns a future that can be used to do a blocking get on a background thread.
|
FutureTarget<TranscodeType> |
submit(int width,
int height)
Returns a future that can be used to do a blocking get on a background thread.
|
RequestBuilder<TranscodeType> |
thumbnail(float sizeMultiplier)
Deprecated.
The behavior differences between this method and
thumbnail(RequestBuilder)
are subtle, hard to understand for users and hard to maintain for developers. See the
javadoc on listener(RequestListener) for one concrete example of the behavior
differences and complexity introduced by this method. Better consistency and readability
can be obtained by calling thumbnail(RequestBuilder) with a duplicate RequestBuilder on which you have called BaseRequestOptions.sizeMultiplier(float).
In practice this method also isn't especially useful. It's much more common to want to
specify a number of different attributes for thumbnails than just a simple percentage
modifier on the target size, so there's little justification for keeping this method. This
method will be removed in a future version of Glide. |
RequestBuilder<TranscodeType> |
thumbnail(java.util.List<RequestBuilder<TranscodeType>> thumbnails)
Recursively applies
thumbnail(RequestBuilder) so that the RequestBuilders are
loaded as thumbnails in the given priority order. |
RequestBuilder<TranscodeType> |
thumbnail(RequestBuilder<TranscodeType>... thumbnails)
Recursively applies
thumbnail(RequestBuilder) so that the RequestBuilders are
loaded as thumbnails in the given priority order. |
RequestBuilder<TranscodeType> |
thumbnail(RequestBuilder<TranscodeType> thumbnailRequest)
Loads and displays the resource retrieved by the given thumbnail request if it finishes before
this request.
|
RequestBuilder<TranscodeType> |
transition(TransitionOptions<?,? super TranscodeType> transitionOptions)
Sets the
TransitionOptions to use to transition from the placeholder or thumbnail when
this load completes. |
autoClone, centerCrop, centerInside, circleCrop, decode, disallowHardwareConfig, diskCacheStrategy, dontAnimate, dontTransform, downsample, encodeFormat, encodeQuality, equals, error, error, fallback, fallback, fitCenter, format, frame, getDiskCacheStrategy, getErrorId, getErrorPlaceholder, getFallbackDrawable, getFallbackId, getOnlyRetrieveFromCache, getOptions, getOverrideHeight, getOverrideWidth, getPlaceholderDrawable, getPlaceholderId, getPriority, getResourceClass, getSignature, getSizeMultiplier, getTheme, getTransformations, getUseAnimationPool, getUseUnlimitedSourceGeneratorsPool, hashCode, isAutoCloneEnabled, isDiskCacheStrategySet, isLocked, isMemoryCacheable, isPrioritySet, isSkipMemoryCacheSet, isTransformationAllowed, isTransformationRequired, isTransformationSet, isValidOverride, lock, onlyRetrieveFromCache, optionalCenterCrop, optionalCenterInside, optionalCircleCrop, optionalFitCenter, optionalTransform, optionalTransform, override, override, placeholder, placeholder, priority, selfOrThrowIfLocked, set, signature, sizeMultiplier, skipMemoryCache, theme, timeout, transform, transform, transform, transforms, useAnimationPool, useUnlimitedSourceGeneratorsPoolprotected static final RequestOptions DOWNLOAD_ONLY_OPTIONS
protected RequestBuilder(@NonNull
Glide glide,
RequestManager requestManager,
java.lang.Class<TranscodeType> transcodeClass,
android.content.Context context)
protected RequestBuilder(java.lang.Class<TranscodeType> transcodeClass, RequestBuilder<?> other)
@NonNull @CheckResult public RequestBuilder<TranscodeType> apply(@NonNull BaseRequestOptions<?> requestOptions)
As with BaseRequestOptions.apply(BaseRequestOptions), #apply only replaces those
values that are explicitly set in the given RequestOptions object. If you need to
completely reset all previously set options, create a new RequestBuilder instead of
using this method.
apply in class BaseRequestOptions<RequestBuilder<TranscodeType>>BaseRequestOptions.apply(BaseRequestOptions)@NonNull @CheckResult public RequestBuilder<TranscodeType> transition(@NonNull TransitionOptions<?,? super TranscodeType> transitionOptions)
TransitionOptions to use to transition from the placeholder or thumbnail when
this load completes.
The given TransitionOptions will replace any TransitionOptions set
previously.
@NonNull @CheckResult public RequestBuilder<TranscodeType> listener(@Nullable RequestListener<TranscodeType> requestListener)
RequestListener to monitor the resource load and removes all previously set
listeners (either via this method or from addListener(RequestListener) .
Calls to this method will replace previously set listeners. To set multiple listeners, use
addListener(com.bumptech.glide.request.RequestListener<TranscodeType>) instead.
requestListener - The request listener to use.@NonNull @CheckResult public RequestBuilder<TranscodeType> addListener(@Nullable RequestListener<TranscodeType> requestListener)
RequestListener to the list that will be called in the order they were added
when the request ends.
Multiple calls to this method append additional listeners. Previous listeners are not
removed. If you want to replace any previously added listeners, use listener(RequestListener).
Listeners track the state of the request started by this particular builder. When
used with the thumbnail APIs (thumbnail(RequestBuilder)) this can start to seem
confusing because multiple requests are running and each may succeed or fail, independent of
each other. As a rule, Glide does not add RequestListeners to thumbnail requests
automatically. That means that RequestListeners track the state of exactly one request
in the chain. For example, if you start a primary request with a single nested thumbnail and
you add a RequestListener only to the primary request, then the RequestListener
will only be notified when the primary request succeeds or fails. If the thumbnail succeeds,
but the primary request fails, the RequestListener added to the primary request will
still be called with RequestListener.onLoadFailed(GlideException, Object, Target,
boolean). In the same scenario, the RequestListener added only to the primary request
will not have RequestListener.onResourceReady(Object, Object, Target, DataSource,
boolean) called when the thumbnail request finishes successfully. Similarly, if you add a
RequestListener only to a thumbnail request, but not the primary request, that listener will only be called for changes related to the thumbnail request. If the thumbnail
request fails, the listener added to the thumbnail request will be immediately called
via RequestListener.onLoadFailed(GlideException, Object, Target, boolean), even though
the primary request may eventually succeed. It is perfectly possible to add a RequestListener to both the primary and a thumbnail request. If you do so, the RequestListener will be called independently for each request when it finishes. Keep in mind
that if any parent request finishes before its thumbnail request(s), it will attempt to cancel
those requests. As a result there's no guarantee that a RequestListener added to a
thumbnail request will actually be called with either success or failure. These same patterns
hold for arbitrarily nested thumbnails. The listener is only called for the requests it
is added to and may not be called for every thumbnail request if those requests are cancelled
due to the completion of a parent request.
The one exception to the rules about thumbnails is thumbnail(float). In this case
we appear to be passing RequestListeners added to the parent request to the generated
thumbnail requests. To try to reduce confusion, the thumbnail(float) method has been
deprecated. It can be easily replicated using thumbnail(RequestBuilder) and BaseRequestOptions.sizeMultiplier(float).
Often in UIs it's desirable to try to track the overall status of a request, including the
thumbnails. For example, you might want to load an image, start an animation if the
asynchronous image load succeeds and perform some fallback action if it fails. If you're using
a single primary request, RequestListener will work for this. However, if you then
decide to try to make things more performant by adding a thumbnail (or multiple thumbnails),
RequestListener is awkward because either you only add it to the main request and it's
not called when the thumbnails complete (which defeats the purpose) or it's called for every
request and it's hard to keep track of when the overall request has failed. A better option
than using RequestListener to track the state of the UI then is to use Target
instead. Target.onResourceReady(Object, Transition) will be called when any thumbnail
finishes, which you can use to trigger your animation starting. Target.onLoadFailed(Drawable) will only be called if every request in the chain, including the
primary request, fails, which you can use to trigger your fallback behavior. Be sure to pick an
appropriate Target subclass when possible, like BitmapImageViewTarget or DrawableImageViewTarget when loading into ImageView
or CustomTarget when using custom rendering. Don't
forget to call super() in the ImageViewTargets.
It's best to create a single instance of an exception handler per type of request (usually activity/fragment) rather than pass one in per request to avoid some redundant object allocation.
requestListener - The request listener to use. If null, this method is a noop.@NonNull public RequestBuilder<TranscodeType> error(@Nullable RequestBuilder<TranscodeType> errorBuilder)
RequestBuilder that is built and run if the load started by this RequestBuilder fails.
If this RequestBuilder uses a thumbnail that succeeds the given error RequestBuilder will be started anyway if the non-thumbnail request fails.
Recursive calls to this method as well as calls to thumbnail(float) and thumbnail(RequestBuilder) are supported for the given error RequestBuilder.
Unlike thumbnail(RequestBuilder) and thumbnail(float), no options from
this primary RequestBuilder are propagated to the given error RequestBuilder.
Options like priority, override widths and heights and transitions must be applied
independently to the error builder.
The given RequestBuilder will start and potentially override a fallback drawable if
it's set on this RequestBuilder via BaseRequestOptions.fallback(android.graphics.drawable.Drawable) or BaseRequestOptions.fallback(int).
RequestBuilder.@NonNull @CheckResult public RequestBuilder<TranscodeType> error(java.lang.Object model)
error(RequestBuilder) where the RequestBuilder is the
result of calling clone() and removing any existing thumbnail and error RequestBuilders.
Other than thumbnail and error RequestBuilders, which are removed, all other options
are retained from the primary request. However, order matters! Any options applied after
this method is called will not be applied to the error RequestBuilder.
WARNING: Calling this method with a model whose type does not match the type of the
model passed to load() may be dangerous! Any options that were applied by the various
type specific load() methods, like load(byte[]) will be copied to the error
request here even if the model you pass to this method doesn't match. Similary, options
that would be normally applied by type specific load() methods will not be
applied to this request. If this behavior is confusing or unexpected, use error(RequestBuilder) instead.
@NonNull @CheckResult public RequestBuilder<TranscodeType> thumbnail(@Nullable RequestBuilder<TranscodeType> thumbnailRequest)
Recursive calls to thumbnail are supported.
Overrides any previous calls to this method, thumbnail(float) and thumbnail(RequestBuilder[]).
thumbnailRequest - The request to use to load the thumbnail.thumbnail(float),
thumbnail(RequestBuilder[])@NonNull @CheckResult public RequestBuilder<TranscodeType> thumbnail(@Nullable RequestBuilder<TranscodeType>... thumbnails)
thumbnail(RequestBuilder) so that the RequestBuilders are
loaded as thumbnails in the given priority order.
thumbnail(RequestBuilder) is applied in the order given so that the RequestBuilder at position 0 has the RequestBuilder at position 1 applied as using its
thumbnail method, the RequestBuilder at position 1 has the RequestBuilder at
position 2 applied using its thumbnail method and so on.
Calling this method with an null array of RequestBuilder thumbnails or an
empty array of RequestBuilder thumbnails is equivalent to calling thumbnail(RequestBuilder) with null.
Any individual RequestBuilder in the array of thumbnails provided here may be null. null RequestBuilders are ignored and excluded from the recursive chain.
The RequestBuilder objects provided here may be mutated and have any previous calls
to this method or thumbnail(RequestBuilder) methods overridden.
Overrides any previous calls to thumbnail(RequestBuilder), thumbnail(float) and this method.
thumbnail(float),
thumbnail(RequestBuilder)@NonNull @CheckResult public RequestBuilder<TranscodeType> thumbnail(@Nullable java.util.List<RequestBuilder<TranscodeType>> thumbnails)
thumbnail(RequestBuilder) so that the RequestBuilders are
loaded as thumbnails in the given priority order.
thumbnail(RequestBuilder) is applied in the order given so that the RequestBuilder at position 0 has the RequestBuilder at position 1 applied as using its
thumbnail method, the RequestBuilder at position 1 has the RequestBuilder at
position 2 applied using its thumbnail method and so on.
Calling this method with a null list of RequestBuilder thumbnails or an
empty list of RequestBuilder thumbnails is equivalent to calling thumbnail(RequestBuilder) with null.
Any individual RequestBuilder in the list of thumbnails provided here may be null. null RequestBuilders are ignored and excluded from the recursive chain.
The RequestBuilder objects provided here may be mutated and have any previous calls
to this method or thumbnail(RequestBuilder) methods overridden.
Overrides any previous calls to thumbnail(RequestBuilder), thumbnail(float) and this method.
thumbnail(float),
thumbnail(RequestBuilder)@NonNull @CheckResult @Deprecated public RequestBuilder<TranscodeType> thumbnail(float sizeMultiplier)
thumbnail(RequestBuilder)
are subtle, hard to understand for users and hard to maintain for developers. See the
javadoc on listener(RequestListener) for one concrete example of the behavior
differences and complexity introduced by this method. Better consistency and readability
can be obtained by calling thumbnail(RequestBuilder) with a duplicate RequestBuilder on which you have called BaseRequestOptions.sizeMultiplier(float).
In practice this method also isn't especially useful. It's much more common to want to
specify a number of different attributes for thumbnails than just a simple percentage
modifier on the target size, so there's little justification for keeping this method. This
method will be removed in a future version of Glide.Note - The thumbnail resource will be smaller than the size requested so the target (or
ImageView) must be able to scale the thumbnail appropriately. See ImageView.ScaleType.
Almost all options will be copied from the original load, including the ModelLoader, ResourceDecoder,
and Transformations. However, BaseRequestOptions.placeholder(int) and BaseRequestOptions.error(int), and listener(RequestListener)
will only be used on the full size load and will not be copied for the thumbnail load.
Recursive calls to thumbnail are supported.
Overrides any previous calls to this method, thumbnail(RequestBuilder[]), and
thumbnail(RequestBuilder).
sizeMultiplier - The multiplier to apply to the Target's dimensions when loading
the thumbnail.thumbnail(RequestBuilder),
thumbnail(RequestBuilder[])@NonNull @CheckResult public RequestBuilder<TranscodeType> load(@Nullable java.lang.Object model)
model - The model to load data for, or null.@NonNull @CheckResult public RequestBuilder<TranscodeType> load(@Nullable android.graphics.Bitmap bitmap)
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 ModelLoader or
ResourceDecoder instead of using this method.
The DiskCacheStrategy is set to DiskCacheStrategy.NONE. Previous calls to
apply(BaseRequestOptions) or previously applied DiskCacheStrategys will be
overridden by this method. Applying an DiskCacheStrategy other than DiskCacheStrategy.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.
load(Object)@NonNull @CheckResult public RequestBuilder<TranscodeType> load(@Nullable android.graphics.drawable.Drawable drawable)
Drawable.
It's almost always better to allow Glide to load Bitmaps than to pass Bitmaps 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 ModelLoader or ResourceDecoder
instead of using this method.
The DiskCacheStrategy is set to DiskCacheStrategy.NONE. Previous calls to
apply(BaseRequestOptions) or previously applied DiskCacheStrategys will be
overridden by this method. Applying an DiskCacheStrategy other than DiskCacheStrategy.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.
load(Object)@NonNull @CheckResult public RequestBuilder<TranscodeType> load(@Nullable java.lang.String string)
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 BaseRequestOptions.signature(com.bumptech.glide.load.Key) 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 DiskCacheStrategy.NONE and/or BaseRequestOptions.skipMemoryCache(boolean) may be appropriate.
string - A file path, or a uri or url handled by UriLoader.load(Object)@NonNull @CheckResult public RequestBuilder<TranscodeType> load(@Nullable android.net.Uri uri)
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 BaseRequestOptions.signature(com.bumptech.glide.load.Key) 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 DiskCacheStrategy.NONE and/or BaseRequestOptions.skipMemoryCache(boolean) may be appropriate.
uri - The Uri representing the image. Must be of a type handled by UriLoader.load(Object)@NonNull @CheckResult public RequestBuilder<TranscodeType> load(@Nullable java.io.File file)
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 BaseRequestOptions.signature(com.bumptech.glide.load.Key) 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 DiskCacheStrategy.NONE and/or BaseRequestOptions.skipMemoryCache(boolean) may be appropriate.
file - The File containing the imageload(Object)@NonNull @CheckResult public RequestBuilder<TranscodeType> load(@RawRes @DrawableRes @Nullable java.lang.Integer resourceId)
ModelLoaderFactory currently registered or Integer to
load the image represented by the given Integer resource id. Defaults to ResourceLoader 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 DiskCacheStrategy.NONE via BaseRequestOptions.diskCacheStrategy(com.bumptech.glide.load.engine.DiskCacheStrategy) during
development, and re-enabling the default DiskCacheStrategy.RESOURCE for release builds.
This method will load non-Bitmap resources like VectorDrawables. Although Glide makes a best effort to apply Transformations 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 GifDrawable). To avoid
load failures if a Drawable can't be transformed, use the optional transformation
methods like BaseRequestOptions.optionalTransform(Class, Transformation).
In some cases converting Drawables to Bitmaps may be inefficient. Use this
method, especially in conjunction with Transformations with
caution for non-Bitmap Drawables.
load(Integer),
AndroidResourceSignature@Deprecated @CheckResult public RequestBuilder<TranscodeType> load(@Nullable java.net.URL url)
URL class has a number of
performance problems and should generally be avoided when possible. Prefer load(android.net.Uri) or load(String).URL.url - The URL representing the image.load(Object)@NonNull @CheckResult public RequestBuilder<TranscodeType> load(@Nullable byte[] model)
Note - by default loads for bytes are not cached in either the memory or the disk cache.
model - the data to load.load(Object)@CheckResult public RequestBuilder<TranscodeType> clone()
This method returns a "deep" copy in that all non-immutable arguments are copied such that changes to one builder will not affect the other builder. However, in addition to immutable arguments, the current model is not copied so changes to the model will affect both builders.
clone in class BaseRequestOptions<RequestBuilder<TranscodeType>>@NonNull public <Y extends Target<TranscodeType>> Y into(@NonNull Y target)
target - The target to load the resource into.RequestManager.clear(Target)@NonNull public ViewTarget<android.widget.ImageView,TranscodeType> into(@NonNull android.widget.ImageView view)
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.view - The view to cancel previous loads for and load the new resource into.Target used to wrap the given ImageView.RequestManager.clear(Target)@Deprecated public FutureTarget<TranscodeType> into(int width, int height)
submit(int, int) instead.width - The desired width in pixels, or Target.SIZE_ORIGINAL. This will be
overridden by BaseRequestOptions.override(int, int) if
previously called.height - The desired height in pixels, or Target.SIZE_ORIGINAL. This will be
overridden by BaseRequestOptions.override(int, int)} if
previously called).RequestManager.clear(Target)@NonNull public FutureTarget<TranscodeType> submit()
This method defaults to Target.SIZE_ORIGINAL for the width and the height. However,
since the width and height will be overridden by values passed to BaseRequestOptions.override(int, int), this method can be used whenever RequestOptions
with override values are applied, or whenever you want to retrieve the image in its original
size.
submit(int, int),
into(Target)@NonNull public FutureTarget<TranscodeType> submit(int width, int height)
width - The desired width in pixels, or Target.SIZE_ORIGINAL. This will be
overridden by BaseRequestOptions.override(int, int) if
previously called.height - The desired height in pixels, or Target.SIZE_ORIGINAL. This will be
overridden by BaseRequestOptions.override(int, int)} if
previously called).@NonNull public Target<TranscodeType> preload(int width, int 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).
width - The desired width in pixels, or Target.SIZE_ORIGINAL. This will be
overridden by BaseRequestOptions.override(int, int) if
previously called.height - The desired height in pixels, or Target.SIZE_ORIGINAL. This will be
overridden by BaseRequestOptions.override(int, int)} if
previously called).Target that can be used to cancel the load via RequestManager.clear(Target).ListPreloader@NonNull public Target<TranscodeType> preload()
Target.SIZE_ORIGINAL as the target width and
height. Equivalent to calling preload(int, int) with Target.SIZE_ORIGINAL as
the width and height.Target that can be used to cancel the load via RequestManager.clear(Target)preload(int, int)@Deprecated @CheckResult public <Y extends Target<java.io.File>> Y downloadOnly(@NonNull Y target)
RequestManager.downloadOnly() and into(Target).Y - The type of Target.target - The Target that will receive the cache File when the load completes@Deprecated @CheckResult public FutureTarget<java.io.File> downloadOnly(int width, int height)
RequestManager.downloadOnly() and submit(int, int).Future that can be used to retrieve the cache File containing the data.width - The width in pixels to use to fetch the data.height - The height in pixels to use to fetch the data.Future that can be used to retrieve the cache File
containing the data.@NonNull @CheckResult protected RequestBuilder<java.io.File> getDownloadOnlyRequest()