Skip to content

Commit

Permalink
Autoplay GIFs on Android
Browse files Browse the repository at this point in the history
Summary: This adds support for animated GIFs on Android! Looking forward to some meme apps :)
Also, Fresco is awesome.

Closes #2997.

@​public

Reviewed By: @mkonicek

Differential Revision: D2477540

committer: Service User <svcscm@fb.com>
  • Loading branch information
Martin Konicek authored and facebook-github-bot-7 committed Sep 24, 2015
1 parent 03222d6 commit fcd7de5
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ public void maybeUpdateView() {

DraweeController draweeController = mDraweeControllerBuilder
.reset()
.setAutoPlayAnimations(true)
.setCallerContext(mCallerContext)
.setOldController(getController())
.setImageRequest(imageRequest)
Expand Down

5 comments on commit fcd7de5

@davidgilbertson
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do I need to do something different to get this working? I have the following and it doesn't animate on Android:

<Image
    style={[styles.image]}
    source={{uri: 'https://s-media-cache-ak0.pinimg.com/originals/c8/0f/bf/c80fbf0fb821bc8a8777bc9b5f36e5ef.jpg'}}
    />

I'm using RN 0.13.0-rc and can confirm that ReactImageView.java has setAutoPlayAnimations set to true.

@satya164
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@davidgilbertson May be something to do with the file extension (.jpg)?

@davidgilbertson
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, I also thought it might be because it's not a cute animal, so tried a .gif dog and a .gifv cat, no joy. They just show as stills.

@0rland0
Copy link

@0rland0 0rland0 commented on fcd7de5 Jul 3, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any updates on that? It is also not working for me. with the code above or similar code here in my stackoverflow question:
http://stackoverflow.com/questions/38169519/how-to-display-gif-in-react-native-android-app

@ide
Copy link
Contributor

@ide ide commented on fcd7de5 Jul 3, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to opt into gif support to your Gradle file, ex: #8455

Please sign in to comment.