Hi I want to have a progress bar for image which will shown while image loading but when image loading will be completed I want to set it to gone. Earlier I was using Picass
This is the best answer as it does not use any hack like setting visibility to get the desired output.
Download a gif of progressbar and call it progressbargif and put it in the drawable folder.
Glide.with(ctx)
.load(url)
.thumbnail(Glide.with(ctx).load(R.drawable.progressbargif))
.diskCacheStrategy(DiskCacheStrategy.SOURCE)
.error(R.drawable.image_unavailable)
.crossFade(200)
.into(iv);
Once the url image is loaded, the thumbnail vanishes. The thumbnail vanishes immediately when the cached image is loaded.