简体   繁体   English

Android,Fresco Gif在recyclerview中显示,带有“ onClick”的启动和停止

[英]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. 我正在尝试实现9gag之类的功能,其中在recyclerview中有一个gif列表,您可以单击图像来启动和停止每个gif。

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? 我可以自己实现此功能,但我想知道当前的图像加载程序库(尤其是Fresco)是否内置了此功能?

Yes, Fresco allows manual control of animations . 是的,Fresco允许手动控制动画 The simplest way is this: 最简单的方法是这样的:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM