Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

too many gifs in recyclerview #2755

Open
CK875430315 opened this issue Dec 21, 2023 · 0 comments
Open

too many gifs in recyclerview #2755

CK875430315 opened this issue Dec 21, 2023 · 0 comments

Comments

@CK875430315
Copy link

Very slow,and block; but use glide is smooth ,how can i optimize? thanks too much.

  if (uri.toString().isGif()) {

        val controllerBuilder =
            Fresco.newDraweeControllerBuilder()
                .setAutoPlayAnimations(true)
                .setOldController(simpleDraweeView.getController());
        val optionsBuilder =
            ImageDecodeOptions.newBuilder().setMaxDimensionPx(4000);

        optionsBuilder.setCustomImageDecoder(GifDecoder())

        controllerBuilder.setImageRequest(
            ImageRequestBuilder.newBuilderWithSource(uri)
                .setImageDecodeOptions(optionsBuilder.build())
                .build());

        simpleDraweeView.getHierarchy().setOverlayImage(null);
        simpleDraweeView.controller = controllerBuilder.build()

        return
    }

api "com.facebook.fresco:fresco:${FrescoVersion}"
api "com.facebook.fresco:animated-gif:${FrescoVersion}"//加载gif动图需添加此库
api "com.facebook.fresco:animated-gif-lite:${FrescoVersion}"//加载gif动图需添加此库
api "com.facebook.fresco:animated-webp:${FrescoVersion}"//加载webp动图需添加此库
api "com.facebook.fresco:webpsupport:${FrescoVersion}"//支持webp需添加此库
api "com.facebook.fresco:animated-drawable:${FrescoVersion}"
api "com.facebook.fresco:animated-base:${FrescoVersion}"

FrescoVersion=2.6.0,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant