Fresco Android GIF/WEBP动画未播放
我决定使用Fresco Android GIF/WEBP动画未播放,android,fresco,Android,Fresco,我决定使用Fresco,因为它可以解决我的问题:GIF和WEBP播放 根据文件: 我可以使用以下代码自动播放动画: Uri uri; DraweeController controller = Fresco.newDraweeControllerBuilder() .setUri(uri) .setAutoPlayAnimations(true) . // other setters .build(); mSimpleDr
Fresco
,因为它可以解决我的问题:GIF
和WEBP
播放
根据文件:
我可以使用以下代码自动播放动画:
Uri uri;
DraweeController controller = Fresco.newDraweeControllerBuilder()
.setUri(uri)
.setAutoPlayAnimations(true)
. // other setters
.build();
mSimpleDraweeView.setController(controller);
但是,当我使用代码时,它只显示静态图像
要播放GIF/WEBP,我还需要执行其他步骤吗?还是我误解了文档对“动画”的使用
编辑:
其他信息,在使用ControllerListener时,我发现onFinalImageSet()中的可动画返回为null。我不知道为什么
我还尝试运行此示例项目,但.gif也无法设置动画:
我正在使用Nexus 5X测试btw(6.0.1版)请确保添加:
好的,问题是我没有添加GIF和WebP支持的模块
dependencies {
// If your app supports Android versions before Ice Cream Sandwich (API level 14)
compile 'com.facebook.fresco:animated-base-support:1.2.0'
// For animated GIF support
compile 'com.facebook.fresco:animated-gif:1.2.0'
// For WebP support, including animated WebP
compile 'com.facebook.fresco:animated-webp:1.2.0'
compile 'com.facebook.fresco:webpsupport:1.2.0'
// For WebP support, without animations
compile 'com.facebook.fresco:webpsupport:1.2.0'
}