thumbnail

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. Best used for loading thumbnail resources that are smaller and will be loaded more quickly than the full size resource. There are no guarantees about the order in which the requests will actually finish. However, if the thumb request completes after the full request, the thumb resource will never replace the full resource.

Recursive calls to thumbnail are supported.

Overrides any previous calls to this method, thumbnail and thumbnail.

Return

This request builder.

See also

Parameters

thumbnailRequest

The request to use to load the thumbnail.


open fun thumbnail(thumbnails: Array<RequestBuilder<TranscodeType>>): RequestBuilder<TranscodeType>

Recursively applies thumbnail so that the RequestBuilders are loaded as thumbnails in the given priority order.

thumbnail is applied in the order given so that the 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 with null.

Any individual RequestBuilder in the array of thumbnails provided here may be null. nullRequestBuilders 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 methods overridden.

Overrides any previous calls to thumbnail, thumbnail and this method.

Return

This request builder.

See also


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.

thumbnail is applied in the order given so that the 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 with null.

Any individual RequestBuilder in the list of thumbnails provided here may be null. nullRequestBuilders 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 methods overridden.

Overrides any previous calls to thumbnail, thumbnail and this method.

Return

This request builder.

See also


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. If the thumbnail load completes before the full size load, the thumbnail will be shown. If the thumbnail load completes after the full size load, the thumbnail will not be shown.

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 .

Almost all options will be copied from the original load, including the , com.bumptech.glide.load.ResourceDecoder, and com.bumptech.glide.load.Transformations. However, placeholder and error, and listener 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, and thumbnail.

Return

This request builder.

Deprecated

The behavior differences between this method and thumbnail are subtle, hard to understand for users and hard to maintain for developers. See the javadoc on listener for one concrete example of the behavior differences and complexity introduced by this method. Better consistency and readability can be obtained by calling thumbnail with a duplicate RequestBuilder on which you have called sizeMultiplier. 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.

See also

Parameters

sizeMultiplier

The multiplier to apply to the Target's dimensions when loading the thumbnail.