krissini krissini - 8 months ago 25
Java Question

Is there a way to show a gif inside a SurfaceView?

I created a surfaceVeiw with a custom Background and a little figure. So far so good. Is there a posibility to show a Explosion (not as one picture but as a little video) when the figure collides with objects?

I already created these objects so the only thing I need to know is, how I can implement a method to show such explosion.

Do you need some code to help me?

Answer Source

You can use glide libray for showing gif in android

Glide.with(context)
    .load(imageUrl)
    .asGif()
    .placeholder(R.drawable.loading_gif)
    .into(imageView);