-
Notifications
You must be signed in to change notification settings - Fork 685
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
Images disappear while in return transition #650
Comments
I'm so glad I found this bug report. At first I thought it was a bug in the material design library. They have a bug open, too. But Keywords for anyone with the same problem: Coil preserve image during return transition ImageView ShapeableImageView |
I haven't tested myself, but if you set |
Just tested |
Setting a custom target should hopefully work around the issue: val request = ImageRequest.Builder(context)
.data(url)
.target { imageView.setImageDrawable(it) }
.build()
imageLoader.enqueue(request) |
I can confirm that setting a custom target fix the issue ! |
So is this the intended way? Don't really want to put any hacks in production code :) |
I don't think this is the intended way, but it might be the only way to workaround the problem as it was found out here after the research: facebook/fresco#1445 (comment) |
I use |
Note that it is expected behavior from the Android framework side that any To fix this, you'd need to disable that behavior and only rely on the |
@ianhanniballake Yep, we could probably add an option disable the detach behaviour (like how using a non- EDIT: This issue is fixed in the |
Hello,
Describe the bug
I'm using Jetpack Navigation with shared elements transition between fragments. When my detail fragment is returning to home fragment, images in detail fragment disappear as soon as the transition (MaterialContainerTransform) is initiated. It seems that ViewTargetRequestDelegate.dispose() is called at the beginning of the transition, causing the image to be cleared.
Expected behavior
I expect the images to be displayed (and fade) during the transition. This is working correctly when Glide is used instead of Coil.
To Reproduce
The simpliest I found to reproduce is to take the Reply app from Material-components-android-examples and replace the glide image loading in BindingAdapter.kt with Coil. I see the same behaviour with my own app.
Logs/Screenshots
With Coil

With Glide

Version
Coil 1.1.1
Thank you in advance !
The text was updated successfully, but these errors were encountered: