There is not enough documentation or blogs around this topic.
Can someone point me in the right direction? Tried this in getView. Works on an imageview that is not part of item of listview.
val articleImage: AppWidgetTarget = object : AppWidgetTarget(appContext, R.id.article_image, views, appWidgetId) {
override fun onResourceReady(resource: Bitmap, transition: Transition<in Bitmap>?) {
super.onResourceReady(resource, transition)
}
}
val options = RequestOptions()
.override(62, 62)
.placeholder(R.drawable.news_thumbnail)
.error(R.drawable.news_thumbnail)
Glide
.with(appContext)
.asBitmap()
.load("/*URL*/")
.apply(options)
.into(articleImage)
AppWidgetTarget
appears to be for anImageView
directly in the app widget's layout, as it usesupdateAppWidget()
to push over the change. It does not appear to tie into aRemoteViewsFactory
, which is how you populate anAdapterView
inside of an app widget.