I am new in Kolin and I am converting my old codebase into Kotlin. I am getting an error while loading an image using Glide.
My Code
Glide.with(context)
.load(url)
.apply(options)
.error(R.drawable.ic_no_image)
.into(imageView)
Normally this is correct. But I am getting type mismatch error from Kotlin compiler in the error() builder method.
Required: RequestBuilder
Anyone has any solution without extension function.
I believe you want to create a class such as MyGlideModule which extends AppGlideModule and is annotated with @GlideModule
Then instead of calling Glide.With(...) you call GlideApp.With(...) and these extra methods should be available.
@GlideModule
class MyGlideModule : AppGlideModule
See here: GlideModule
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With