Skip to content

Check to see if Image Should Reload When Attached#24023

Merged
PureWeen merged 4 commits intomainfrom
fix_14471
Aug 6, 2024
Merged

Check to see if Image Should Reload When Attached#24023
PureWeen merged 4 commits intomainfrom
fix_14471

Conversation

@PureWeen
Copy link
Copy Markdown
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
Copy Markdown
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
@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
@rmarinho rmarinho added this to the .NET 9 SR8 milestone May 30, 2025
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.

4 participants