Skip to content

Latest commit

 

History

History
33 lines (24 loc) · 1.11 KB

README.md

File metadata and controls

33 lines (24 loc) · 1.11 KB

GlideWebpDecoder

Android 使用Glide加载webp动图 使其可以暂停在某一帧

在大佬的 项目上稍微做的修改 Original project GlideWebpDecoder

Usage

下载并导入 aar包 webp.aar

Transformation<Bitmap> circleCrop = new CircleCrop();
GlideApp.with(mContext)
        .load(url)
        .optionalTransform(circleCrop).optionalTransform(WebpDrawable.class, new WebpDrawableTransformation(mBitmapTrans, new WebpDrawableTransformation.WebpDrawableCallBack() {
                    @Override
                    public void onAnimationStart(Drawable drawable) {

                    }

                    @Override
                    public void onAnimationEnd(Drawable drawable) {

                    }

                    @Override
                    public void onLoadSuccess(WebpDrawable webpDrawable) {
                        webpDrawable.stopFrameIndex(99);//设置想要暂停在哪一帧
                    }
                }))
        .into(imageView);