-2

I am using android-gif-drawable library to show gif image in my android application. As you know gif images should be in assets folder not in drawable, so android can not switch between different sizes automatically.

How can I handle this for different screen sizes?

Maveňツ
  • 1
  • 12
  • 50
  • 89
user5510211
  • 297
  • 1
  • 3
  • 13
  • Can check for [Screen width and height programmatically](http://stackoverflow.com/a/18712361/2870496) and load different gif as the screen size – Maveňツ Dec 13 '16 at 06:58
  • 2
    Possible duplicate of [Butterfly animation on Imageview Android](http://stackoverflow.com/questions/40976690/butterfly-animation-on-imageview-android) – Maveňツ Dec 13 '16 at 07:02
  • @MaňishYadav this question is completely different, why do you mark it as duplicate? :/ – user5510211 Dec 13 '16 at 07:42

2 Answers2

1

Refer this Find Device density of device and set gif-image accordingly. More idea about DisplayMetrics

Community
  • 1
  • 1
Ankita Shah
  • 1,866
  • 16
  • 31
1

Just one way:

Try to Change gifs manually. Use getResources().getDisplayMetrics().density; to find device density and then change gif based on this.