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

Callbacks do not work when both setLowResImageRequest and setImageRequest are used #2497

Open
jokermonn opened this issue May 6, 2020 · 3 comments · May be fixed by #2501
Open

Callbacks do not work when both setLowResImageRequest and setImageRequest are used #2497

jokermonn opened this issue May 6, 2020 · 3 comments · May be fixed by #2501

Comments

@jokermonn
Copy link

Description

val normalUriString = "https://www.google.com.hk/logos/doodles/2020/stay-and-play-at-home-with-popular-past-google-doodles-halloween-2016-6753651837108773-s.png"
val 404UriString = "https://www.google.com.hk/404"

vImage.controller = Fresco.newDraweeControllerBuilder()
     .setLowResImageRequest(ImageRequest.fromUri(Uri.parse(normalUriString)))
     .setImageRequest(ImageRequest.fromUri(Uri.parse(404UriString)))
     .setControllerListener(object : BaseControllerListener<ImageInfo>() {
         override fun onFailure(id: String?, throwable: Throwable?) {
             Log.e("TAG", "onFailure")
         }

         override fun onIntermediateImageSet(id: String?, imageInfo: ImageInfo?) {
             Log.e("TAG", "onIntermediateImageSet")
         }

         override fun onFinalImageSet(id: String?, imageInfo: ImageInfo?, animatable: Animatable?) {
             Log.e("TAG", "onFinalImageSet")
         }
     })
     .setOldController(vImage.controller)
     .build()

fun clearCache() {
     Fresco.getImagePipeline().clearCaches()
}

expect:

E/TAG: onIntermediateImageSet
E/TAG: onFailure

actually:
It works the first time, but after calling clearCache a few times(call several times), It doesn't work:

E/TAG: onFinalImageSet

Reproduction

As shown above

@stale
Copy link

stale bot commented May 13, 2020

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as "bug" or "enhancement" and I will leave it open. Thank you for your contributions.

@stale stale bot added the stale label May 13, 2020
jokermonn pushed a commit to jokermonn/fresco that referenced this issue May 15, 2020
@jokermonn jokermonn linked a pull request May 15, 2020 that will close this issue
@shreelakshmijoshi
Copy link

Hi @oprisnik !
I am a new open source contributor and would love to solve this issue, could you help me understand the issue better by providing some extra references ?
Is this is issue open to contribute ?

@jokermonn
Copy link
Author

@oprisnik can this MR be merged

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

Successfully merging a pull request may close this issue.

3 participants