Skip to content

通过大佬的GlideWebpDecoder进行修改 支持暂停到某一帧

License

Notifications You must be signed in to change notification settings

liuhuan0225/GlideWebpDecoder-Public

Repository files navigation

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);

About

通过大佬的GlideWebpDecoder进行修改 支持暂停到某一帧

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published