question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Smooth transition when changing image on SimpleDraweeView

See original GitHub issue

I have a SimpleDraweeView that is processing an image request through a controller:

Postprocessor redMeshPostprocessor = new BasePostprocessor() {
                @Override
                public String getName() {
                    return "redMeshPostprocessor";
                }

                @Override
                public CloseableReference<Bitmap> process(
                        Bitmap sourceBitmap,
                        PlatformBitmapFactory bitmapFactory) {
                    //custom processing on the bitmap and returning it

                }
            };

            ImageRequest request = ImageRequestBuilder.newBuilderWithSource(Uri.parse(coverImage))
                    .setPostprocessor(redMeshPostprocessor)
                    .build();

            PipelineDraweeController controller = (PipelineDraweeController)
                    Fresco.newDraweeControllerBuilder()
                            .setImageRequest(request)
                            .setOldController(iv_cover.getController())
                            // other setters as you need
                            .build();
            iv_cover.setController(controller);

Then later on, I want to change the image on the SimpleDraweeView by simply saying: iv_cover.setImageURI(Uri.parse(url));

Problem is that when loading the second image, there’s a split second where the SimpleDraweeView is showing the placeholder. How to avoid that? Want the transition between the 2 images to be gapless and smooth. Thanks!

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
ziad-halabi9commented, May 3, 2016

@massimocarli Thank you for your response. Say I have an image already cached and I want to request it but with bigger size to replace it. So what I do is I get the first cached bitmap, resize it, blur it and display it on SimpleDraweeView. In the meantime I request the image with bigger size, and when I receive it, I want to place it on the same SimpleDraweeView with a fade in animation. So I want the transition between the 2 images to be gapless, hence without showing a placeholder.

0reactions
oprisnikcommented, Apr 6, 2017

See #1328 and linked issues there.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Shared Element Transition and Fresco not working properly
The problem is, the transition is not smooth and very fast. I read here that I need to change the transition to ChangeBounds...
Read more >
Using SimpleDraweeView - Fresco
When using Fresco, you will use SimpleDraweeView to display images. These can be used in XML layouts. The simplest usage example of SimpleDraweeView...
Read more >
Quick tip #2 (AE): Creating an image sequence with transition
After Effects. Basic tutorial on how to make an image sequence with build in transition options in AE.... and sorry for the poor...
Read more >
Create a perfect transition of one image over 2 slides in Canva
In this tutorial, I show you how to create an these smooth transition in Canva when one image in on 2 slides. #canvatutorial...
Read more >
Android-WebP this is a demo showing how to display W @codeKK ...
This library is used to display animated WebP image file. It uses 3 native libraries to ... Smooth transition when changing image on...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found