You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The methods onStart and onSuccess are correctly called under 1.4.0 but no longer called after the library update
After some investigation I copied the ImageView.load code discovering the call to target bypasses the calls to the ImageRequest.Builder passed to it, indeed the code below works fine but the lambda inside the apply is never called
val viewContext = itemView.context
val request =ImageRequest.Builder(viewContext)
.apply {
target { System.err.println("dafi: PhotoGridViewHolder.displayImage target from apply is not called") }
}
.data("https://myurl.com")
.target(object:ImageViewTarget(thumbImage) {
overridefunonStart(placeholder:Drawable?) {
System.err.println("dafi: PhotoGridViewHolder.onStart "+ placeholder)
}
overridefunonSuccess(result:Drawable) {
System.err.println("dafi: PhotoGridViewHolder.onSuccess ")
}
})
.build()
viewContext.imageLoader.enqueue(request)
Is this a regression? I searched the documentation for some new behaviour but without success.
I repeat the first code snippet correctly works on 1.4.0.
To make the code working on 2.0.0-rc03 I need to patch it and pass ImageViewTarget directly to the request to enqueue,
This makes ImageView.load useless if not worse harmful
The text was updated successfully, but these errors were encountered:
I think you're right that this change is unexpected in 2.x; fixed here. That said, I wouldn't recommend using load if you want to set a custom target. It's expected that your second code snippet won't have the first target called since you're overwriting it. It looks like your use case would be better suited by a listener.
Describe the bug
I updated my project from
1.4.0
to2.0.0-rc03
and the following code stopped to workThe methods
onStart
andonSuccess
are correctly called under1.4.0
but no longer called after the library updateAfter some investigation I copied the
ImageView.load
code discovering the call totarget
bypasses the calls to theImageRequest.Builder
passed to it, indeed the code below works fine but the lambda inside theapply
is never calledIs this a regression? I searched the documentation for some new behaviour but without success.
I repeat the first code snippet correctly works on
1.4.0
.To make the code working on
2.0.0-rc03
I need to patch it and passImageViewTarget
directly to the request to enqueue,This makes
ImageView.load
useless if not worse harmfulThe text was updated successfully, but these errors were encountered: