BaseTarget

abstract class BaseTarget<Z> : Target<R>

A base Target for loading com.bumptech.glide.load.engine.Resources that provides basic or empty implementations for most methods.

For maximum efficiency, clear this target when you have finished using or displaying the com.bumptech.glide.load.engine.Resource loaded into it using clear.

For loading com.bumptech.glide.load.engine.Resources into android.view.Views, com.bumptech.glide.request.target.ViewTarget or are preferable.

Deprecated

Use CustomViewTarget if loading the content into a view, the download API if in the background (http://bumptech.github.io/glide/doc/getting-started.html#background-threads), or a a fully implemented Target for any specialized use-cases. Using BaseView is unsafe if the user does not implement onLoadCleared, resulting in recycled bitmaps being referenced from the UI and hard to root-cause crashes.

Parameters

<Z>

The type of resource that will be received by this target.

Functions

Link copied to clipboard
abstract fun getSize(cb: SizeReadyCallback)
A method to retrieve the size of this target.
Link copied to clipboard
open fun onDestroy()
Callback for when onDestroy} or onDestroy is called.
Link copied to clipboard
open fun onLoadCleared(placeholder: Drawable)
A mandatory lifecycle callback that is called when a load is cancelled and its resources are freed.
Link copied to clipboard
open fun onLoadFailed(errorDrawable: Drawable)
A mandatory lifecycle callback that is called when a load fails.
Link copied to clipboard
open fun onLoadStarted(placeholder: Drawable)
A lifecycle callback that is called when a load is started.
Link copied to clipboard
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
abstract fun removeCallback(cb: SizeReadyCallback)
Removes the given callback from the pending set if it's still retained.

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