/**
* @author chenli
* @create 2019/3/19
* @Describe
*/
public class GifLoadOneTimeGif {
/**
* Gif 加载 可以设置次数,监听播放完成回调
* @param context 上下文对象
* @param model 传入的gif地址,可以是网络,也可以是本地,(https://raw.githubusercontent.com/Jay-YaoJie/KotlinDialogs/master/diagram/test.gif)
* @param imageView 要显示的imageView
* @param loopCount 播放次数
* @param gifListener Gif播放完毕回调
*/
public static void loadOneTimeGif(Context context, Object model, final ImageView imageView , int loopCount, final GifListener gifListener) {
Glide.with(context).asGif().load(model).listener(new RequestListener<GifDrawable>() {
@Override
public boolean onLoadFailed(@Nullable GlideException e, Object model, Target<GifDrawable> target, boolean isFirstResource) {
return false;
}
@Override
pu
设置Gif播放次数和监听
最新推荐文章于 2024-05-16 04:55:10 发布