I'm trying to show a GIF inside a loading dialog in my app, I'm using the glide image lib since of it's support for GIFS. When im trying to show the GIF in the dialog it doesnt present the GIF and only shows the dialog background. I have been searching around but i havent found a good solution.
My dialog code below
class ShowProgress(context: Context) : Dialog(context) {
var dialog: Dialog? = null
var imageView: ImageView? = null
init {
dialog = Dialog(context)
imageView = findViewById(R.id.glideImage)
}
fun showDialog(context: Context) {
val dialogView = LayoutInflater.from(context).inflate(R.layout.progress_layout, null, false)
imageView?.let { Glide.with(context).asGif().placeholder(R.drawable.redbull).into(it) }
dialog?.setCancelable(false)
dialog?.setContentView(dialogView)
dialog?.show()
}