I have to successfully load an image to this imageview
and I am using glide. My biggest challenged however is I want this rectangle drawable
to be in the image and the image to fit in the white rectangle drawable.
Here is my glide function
private fun loadUrl(url: String) {
Glide.with(this)
.asBitmap()
.load(url)
.fitCenter()
.centerInside()
.into(object : CustomTarget<Bitmap?>() {
override fun onResourceReady(
resource: Bitmap,
transition: Transition<in Bitmap?>?
) {
binding.imageview.setImageBitmap(resource)
binding.imageview.setBackgroundResource(R.drawable.white_rectangle)
}
override fun onLoadCleared(placeholder: Drawable?) {
}
})
}
My image view
<ImageView
android:id="@+id/imageview"
android:layout_width="48dp"
android:layout_height="48dp"
I want to achieve something like this.
I saw this one how can I advance this?