-
- All Implemented Interfaces:
-
androidx.lifecycle.DefaultLifecycleObserver,androidx.lifecycle.LifecycleObserver,coil.target.Target,coil.target.ViewTarget,coil.transition.TransitionTarget
public abstract class GenericViewTarget<T extends View> implements 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.
-
-
Constructor Summary
Constructors Constructor Description GenericViewTarget()
-
Method Summary
Modifier and Type Method Description abstract DrawablegetDrawable()The current Drawable attached to view. abstract UnitsetDrawable(Drawable drawable)The current Drawable attached to view. abstract TgetView()The View used by this Target. UnitonStart(Drawable placeholder)Called when the request starts. UnitonStart(LifecycleOwner owner)UnitonError(Drawable error)Called if an error occurs while executing the request. UnitonSuccess(Drawable result)Called if the request completes successfully. UnitonStop(LifecycleOwner owner)-
-
Method Detail
-
getDrawable
abstract Drawable getDrawable()
-
setDrawable
abstract Unit setDrawable(Drawable drawable)
-
onStart
Unit onStart(LifecycleOwner owner)
-
onStop
Unit onStop(LifecycleOwner owner)
-
-
-
-