Fresco(各种特效)——播放gif
来源:互联网 发布:闪电侠第三季人工智能 编辑:程序博客网 时间:2024/05/22 12:35
- xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:fresco="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" android:gravity="center_horizontal" android:orientation="vertical"> <Button android:id="@+id/xml_bt_xml_gif" android:layout_width="match_parent" android:layout_height="45dp" android:text="gif播放/暂停"/> <com.facebook.drawee.view.SimpleDraweeView android:layout_width="350dp" android:layout_height="300dp" fresco:placeholderImage="@mipmap/android_icon" android:id="@+id/xml_gif_iv_show"/></LinearLayout>
- 核心java代码
1.设置
DraweeController
的setAutoPlayAnimations(true)
为true,自动播放
draweeController= Fresco.newDraweeControllerBuilder() .setAutoPlayAnimations(true) .setUri(Uri.parse(uri))//设置uri .build();//设置ControllersimpleDraweeView.setController(draweeController);
2.控制播放
Animatable animatable=draweeController.getAnimatable(); //判断是否正在运行 if (animatable.isRunning()){ //运行中,停止 animatable.stop(); }else{ //停止了,运行 animatable.start(); }
- 效果图
2 0
- Fresco(各种特效)——播放gif
- Fresco(各种特效)——圆角
- Fresco(各种特效)——缩放
- Fresco(各种特效)——缩放特效
- Fresco(各种特效)——Loading效果
- Fresco 使用笔记(一):加载gif图片并播放
- Fresco 使用笔记(一):加载gif图片并播放
- fresco:0.12.0 无法播放gif图片的解决方法
- Gif图完美运行——播放Gif图
- Android Fresco gif图
- fresco+本地加载gif
- Fresco(2)——fresco的基本使用
- Fresco加载gif实现圆角(无动画)
- 我的手机开发(八)——GIF动画播放
- 我的手机开发(九)——使用IImage组件播放GIF
- Glide入门教程——6.播放Gif & 视频
- 播放GIF
- 播放gif
- static 代码块
- Antiscroll 滚动条插件
- directshow 获取本地音频
- 【GPS】d文件转换为o文件
- 函数指针用法
- Fresco(各种特效)——播放gif
- (2.3.5)java关键字
- C语言单链表练习
- C++ Vector的用法
- 喜羊羊系列之【xshell】 ctrl+s 锁住问题
- C++11:深入理解右值引用,move语义和完美转发
- 位运算复习——字节的奇偶校验和反转一个字节中的二进制位
- C++中的引用与指针的区别
- Jquery隐藏/显示表格内容