Search code examples
androidfresco

Android, Fresco Gif displaying in recyclerview, with start and stop "onClick"


I'm trying to achieve something like 9gag, where you have a list of gifs inside a recyclerview and you can start&stop each of them within a click on the image.

I can implement such feature on my own, but i was wondering if any of the current image loaders libraries (especially Fresco) has this feature built in?


Solution

  • Yes, Fresco allows manual control of animations. The simplest way is this:

    Animatable animatable = mSimpleDraweeView.getController().getAnimatable();
    if (animatable != null) {
      animatable.start();
      // later
      animatable.stop();
    }