AppWidgetTarget

open class AppWidgetTarget : CustomTarget<T>

This class is used in order to display downloaded Bitmap inside an ImageView of an AppWidget through RemoteViews.

Note - For cancellation to work correctly, you must pass in the same instance of this class for every subsequent load.

Constructors

Link copied to clipboard
open fun AppWidgetTarget(    context: Context,     width: Int,     height: Int,     viewId: Int,     remoteViews: RemoteViews,     widgetIds: Array<Int>)
Constructor using an int array of widgetIds to get a handle on the Widget in order to update it.
Link copied to clipboard
open fun AppWidgetTarget(    context: Context,     viewId: Int,     remoteViews: RemoteViews,     widgetIds: Array<Int>)
Constructor using an int array of widgetIds to get a handle on the Widget in order to update it that uses SIZE_ORIGINAL as the target width and height.
Link copied to clipboard
open fun AppWidgetTarget(    context: Context,     width: Int,     height: Int,     viewId: Int,     remoteViews: RemoteViews,     componentName: ComponentName)
Constructor using a ComponentName to get a handle on the Widget in order to update it.
Link copied to clipboard
open fun AppWidgetTarget(    context: Context,     viewId: Int,     remoteViews: RemoteViews,     componentName: ComponentName)
Constructor using a ComponentName, when override has been put to get a handle on the Widget in order to update it that uses SIZE_ORIGINAL as the target width and height.

Functions

Link copied to clipboard
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
open fun onResourceReady(resource: Bitmap, 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
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.