fun Context.loadImageCenterCrop(url: String, imageView: ImageView) {
Picasso.withContext(this)
.load(url)
.centerCrop()
.fit()
.into(imageView)
}
Extension functions are not a replacement for all utility functions
Dmitry Suzdalev
314
But what do you think about the following implementation of the same logic:
fun ImageView.loadImageCenterCrop(url: String) {
Picasso.withContext(this.getContext())
.load(url)
.centerCrop()
.fit()
.into(this)
}I find it very useful