Class ThumbnailImageViewTarget<T>

Type Parameters:
T - The type of resource that will be displayed in the ImageView.
All Implemented Interfaces:
LifecycleListener, Target<T>, Transition.ViewAdapter
Direct Known Subclasses:
BitmapThumbnailImageViewTarget, DrawableThumbnailImageViewTarget

public abstract class ThumbnailImageViewTarget<T> extends ImageViewTarget<T>
Avoids extra calls to View.requestLayout() when loading more than once image into an ImageView with fixed dimensions.

Typically it makes sense to use this class when loading multiple images with the RequestBuilder.thumbnail(com.bumptech.glide.RequestBuilder) API into views in a scrolling list like ListView, GridView, or RecyclerView.

FixedSizeDrawable may cause skewing or other undesirable behavior depending on your images, views, and scaling. If this occurs, consider DrawableImageViewTarget or BitmapImageViewTarget as alternatives.

  • Constructor Details

  • Method Details

    • setResource

      protected void setResource(@Nullable T resource)
      Specified by:
      setResource in class ImageViewTarget<T>
    • getDrawable

      protected abstract Drawable getDrawable(T resource)