facebook/fresco

Callbacks do not work when both `setLowResImageRequest` and `setImageRequest` are used

Open

#2 497 ouverte le 6 mai 2020

Voir sur GitHub
 (4 commentaires) (0 réactions) (0 assignés)Java (3 750 forks)batch import
buggood first issuehelp wanted

Métriques du dépôt

Stars
 (17 072 stars)
Métriques de merge PR
 (Aucune PR mergée en 30 j)

Description

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

Guide contributeur