ThumbnailImageViewTarget

abstract class ThumbnailImageViewTarget<T> : ImageViewTarget<Z>

Avoids extra calls to requestLayout when loading more than once image into an android.widget.ImageView with fixed dimensions.

Typically it makes sense to use this class when loading multiple images with the thumbnail 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 as alternatives.

Parameters

<T>

The type of resource that will be displayed in the ImageView.

Constructors

Link copied to clipboard
open fun ThumbnailImageViewTarget(view: ImageView)
Link copied to clipboard
open fun ThumbnailImageViewTarget(view: ImageView, waitForLayout: Boolean)

Functions

Link copied to clipboard
fun clearOnDetach(): ViewTarget<T, Z>
Clears the View's Request when the View is detached from its and restarts the Request when the View is re-attached from its android.view.
Link copied to clipboard
open fun getCurrentDrawable(): Drawable
Returns the current android.graphics.drawable.
Link copied to clipboard
open fun getSize(cb: SizeReadyCallback)
Determines the size of the view by first checking getWidth and getHeight.
Link copied to clipboard
open fun getView(): T
abstract fun getView(): View
Returns the wrapped android.view.
Link copied to clipboard
open fun onDestroy()
Callback for when onDestroy} or onDestroy is called.
Link copied to clipboard
open fun onLoadCleared(placeholder: Drawable)
Sets the given android.graphics.drawable.
Link copied to clipboard
open fun onLoadFailed(errorDrawable: Drawable)
Sets the given android.graphics.drawable.
Link copied to clipboard
open fun onLoadStarted(placeholder: Drawable)
Sets the given android.graphics.drawable.
Link copied to clipboard
open fun onResourceReady(resource: Z, transition: Transition<out Any>)
abstract fun onResourceReady(resource: R, transition: Transition<out Any>)
The method that will be called when the resource load has finished.
Link copied to clipboard
open fun onStart()
Callback for when onStart} or onStart is called.
Link copied to clipboard
open fun onStop()
Callback for when onStop} or onStop} is called.
Link copied to clipboard
open fun removeCallback(cb: SizeReadyCallback)
Removes the given callback from the pending set if it's still retained.
Link copied to clipboard
open fun setDrawable(drawable: Drawable)
Sets the given android.graphics.drawable.
Link copied to clipboard
open fun setTagId(tagId: Int)
Sets the android resource id to use in conjunction with setTag to store temporary state allowing loads to be automatically cancelled and resources re-used in scrolling lists.
Link copied to clipboard
open fun toString(): String
Link copied to clipboard
fun waitForLayout(): ViewTarget<T, Z>
Indicates that Glide should always wait for any pending layout pass before checking for the size an View.

Properties

Link copied to clipboard
open var request: Request
Link copied to clipboard
val SIZE_ORIGINAL: Int
Indicates that we want the resource in its original unmodified width and/or height.

Inheritors

Link copied to clipboard
Link copied to clipboard