GenericViewTarget

abstract class GenericViewTarget<T : View> : ViewTarget<T> , TransitionTarget, DefaultLifecycleObserver

An opinionated ViewTarget that simplifies updating the Drawable attached to a View and supports automatically starting and stopping animated Drawables.

If you need custom behaviour that this class doesn't support it's recommended to implement ViewTarget directly.

Constructors

GenericViewTarget
Link copied to clipboard
fun GenericViewTarget()

Functions

onError
Link copied to clipboard
open override fun onError(error: Drawable?)
Called if an error occurs while executing the request.
onStart
Link copied to clipboard
open override fun onStart(placeholder: Drawable?)
Called when the request starts.
open override fun onStart(owner: LifecycleOwner)
onStop
Link copied to clipboard
open override fun onStop(owner: LifecycleOwner)
onSuccess
Link copied to clipboard
open override fun onSuccess(result: Drawable)
Called if the request completes successfully.

Properties

drawable
Link copied to clipboard
abstract override var drawable: Drawable?
The current Drawable attached to view.

Inheritors

ImageViewTarget
Link copied to clipboard