In this tutorial, I am going to explain to you how we can set a circle image in ImageView using Android Glide Library. First, you need to set up the Glide Library in your Android Application. Follow the below steps to do that.
Step 1. Open your app build.gradle file and add dependencies in that you can also follow the official link here or add below code in dependencies
dependencies { implementation 'com.github.bumptech.glide:glide:4.9.0' annotationProcessor 'com.github.bumptech.glide:compiler:4.9.0' }
Step 2. Now we need to use the RequestOptions method to do that as shown in below code
RequestOptions options = new RequestOptions(); Glide.with(this.mContext) .load("image_url") .apply(options.circleCropTransform()) .placeholder(new ColorDrawable(Color.LTGRAY)) .into("IMAGEVIEW");
That’s it. Hope this simple post help you.