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

Check to see if Image Should Reload When Attached #24023

Merged
merged 4 commits into from
Aug 6, 2024
Merged

Check to see if Image Should Reload When Attached #24023

merged 4 commits into from
Aug 6, 2024

Conversation

PureWeen
Copy link
Member

@PureWeen PureWeen commented Aug 5, 2024

Description of Change

This is a simplified down version of #23830. Glide monitors the life cycle of the fragment that it is contained in. If the fragment is paused or stopped it will dispose of the bitmap and set the drawable on the image to null. This PR checks to see if an ImageView should have a drawable when it's being reattached to the window. If it should, then it refires the image loading code so that Glide can reload the image.

We should fix this more completely in the Glide layer, but, for now this will at least fix a really nasty bug with images.

Issues Fixed

Fixes #14471

@PureWeen PureWeen requested a review from a team as a code owner August 5, 2024 20:52
Comment on lines +31 to +35
#if ANDROID
// This is a temporary workaround for Android so that images don't just keep vanishing
// We will have a better fix in the next release that's better integrated with Glide
internal bool CheckForImageLoadedOnAttached { get; set; }
#endif
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we get an issue assigned to something so this does not haunt us forever?

@PureWeen PureWeen merged commit b0da2a0 into main Aug 6, 2024
97 checks passed
@PureWeen PureWeen deleted the fix_14471 branch August 6, 2024 14:06
@github-actions github-actions bot locked and limited conversation to collaborators Sep 8, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Android] Image can disappear when going back to the page.
3 participants