DylanVann / react-native-fast-image

🚩 FastImage, performant React Native image component.
MIT License
8.09k stars 1.47k forks source link

fix: Android `onLoad` event when view width and height are zero #953

Open thomas-coldwell opened 1 year ago

thomas-coldwell commented 1 year ago

Hey @DylanVann 👋

This PR aims to fix an existing issue with the onLoad event not firing on Android when the view style's width or height is zero as documented here https://github.com/DylanVann/react-native-fast-image/issues/865. There is a similar PR https://github.com/DylanVann/react-native-fast-image/pull/446 that was opened, but as mentioned in reviews this causes crashes due to the .override(Target.SIZE_ORIGINAL) method being applied to Glide. Instead, this PR follows the recommended way of getting the natural image dimensions as documented here in the Glide repo https://github.com/bumptech/glide/issues/781#issuecomment-160953996.

The changes here include:

These changes are best tested with the AutoSize component in the example app - as you can see setting the width to zero still triggers the onLoad event and this example is then rendered correctly.

Beamanator commented 1 year ago

@DylanVann Is there any chance you can let us know your thoughts on this change? @thomas-coldwell and I would be happy to discuss with you if you have any questions / concerns about this update

Beamanator commented 10 months ago

Bump? 🙃