5

I need some advice about animation. I have an animated GIF, but how to put in Android app to be animation. When I put it doesn't move at all. I read something about animation in Android and I need to have pictures for animation. Is there any solution for this ?

Yi Jiang
  • 49,435
  • 16
  • 136
  • 136
Momcilo
  • 51
  • 1
  • 1
  • 2

3 Answers3

5

Android does not support animated GIFs much. You can use an AnimationDrawable, perhaps defined from frames using a drawable XML file.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • 2
    I extract gif to png pictures with gif2png and it works with XML ! Thanks for advice ! – Momcilo Sep 12 '10 at 17:04
  • 1
    it supports but it's way more complicated to use that then frame animation – Ewoks Oct 26 '12 at 09:21
  • How about this: http://stackoverflow.com/questions/32996878/showing-gif-image-with-library. How can I implement it with library – Twitter khuong291 Oct 08 '15 at 07:46
  • @CommonsWare Sir, what should be do for the url gif ? means which library is helpful Glide OR Ion..Or there much more better library from this two libarary......Could you please help me – Ravindra Kushwaha Jan 20 '17 at 13:53
1

you can do it by using GIF image in your app as Splash screen. Android does not support animated GIFs. so extract gif to png pictures with gif2png and it works with XML. And Other Option Adding gif image in an ImageView in android Adding gif image in an ImageView in android

Community
  • 1
  • 1
Nikhil Borad
  • 2,065
  • 16
  • 20
1

100 % Work...

1) Add Glide library dependency...

   compile 'com.github.bumptech.glide:glide:4.2.0'

2)

   imageView = findViewById(R.id.gifImage);

3)

 Glide.with(getApplicationContext())
            .asGif()
            .load(R.drawable.gifImage)
            .into(imageView);

just use .asGif() before .load()

Sheharyar Ejaz
  • 2,808
  • 1
  • 14
  • 15