Version: 4.10.0
No integration libraries
Issue details / Repro steps / Use case background:
I have a custom view, that has a setImage(Bitmap) method. I'm using Kotlin. I was trying to load an image into said view by using:
Glide.with(this)
.load(addSchemeIfNeeded(url))
.into(object : CustomViewTarget<MyCustomView, Bitmap>(myCustomView) {
override fun onLoadFailed(errorDrawable: Drawable?) {
}
override fun onResourceCleared(placeholder: Drawable?) {
}
override fun onResourceReady(resource: Bitmap, transition: Transition<in Bitmap>?) {
myCustomView.setImage(resource)
}
})
This results in a compilation error: Type mismatch: inferred type is
I needed to add ".asBitmap()" to the builder calls.
val target = Glide.with(this@MainActivity)
.asBitmap()
.load(item.mediaUrl)
.diskCacheStrategy(DiskCacheStrategy.ALL)
.into(object : CustomTarget
override fun onLoadCleared(placeholder: Drawable?) {
TODO("Not yet implemented")
}
override fun onResourceReady(resource: Bitmap, transition: Transition<in Bitmap>?) {
TODO("Not yet implemented")
}
})
Most helpful comment
I needed to add ".asBitmap()" to the builder calls.