I am currently using Glide to download an image using a URL and using that to load the image in the imageView. This is how I am doing it:
Glide.with(cardView)
.load(urls.get(0))
.centerCrop()
.into(imageView1);
Now, I want that I seperate out the process of downloading the image using Glide and setting the image in the imageView.
I want to do it such that I create a function which downloads the image using Glide and returns a drawable/bitmap. And then after it is done downloading, I pass it to setting the image in the imageView.
The reason I am doing it is because I Want to make a generic function in parent class that takes in a URL and downloads the image, and then this function can be used by different child classes as per their own need.