-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
ImageView + DraweeHolder: Image is cleared during fragment transition #2512
Comments
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as "bug" or "enhancement" and I will leave it open. Thank you for your contributions. |
Hey! Are you using animations? If so, this is probably the same issue as #1445. |
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as "bug" or "enhancement" and I will leave it open. Thank you for your contributions. |
Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to reopen with up-to-date information. |
@oprisnik thanks for the link. I think it's a similar issue. I applied your patch from here in my custom image view. To make things work I also need to override onVisibilityAggregated:
|
Thanks, so you're saying that with the patch and your patch everything is fixed? |
Correct. We no longer see flashes during fragment transitions. |
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as "bug" or "enhancement" and I will leave it open. Thank you for your contributions. |
Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to reopen with up-to-date information. |
Summary: Adds support for Android Transitions during Fragment navigation. React Native navigation libraries (like [the Navigation router](https://github.com/grahammendick/navigation/blob/e9deae985a1962db17d6b1fbf90628d20c29810c/NavigationReactNative/src/android/src/main/java/com/navigation/reactnative/NavigationStackView.java#L139) and [React Native Screens](https://github.com/software-mansion/react-native-screens/blob/ea240b46866d66398904d0c2d0fe5fabdc2f269b/android/src/main/java/com/swmansion/rnscreens/ScreenContainer.kt#L98)) use Fragments to manage the stack of screens. But they can’t use Transitions to animate these Fragments because React Native images disappear during the Transition (see the videos in the Test Plan section below). Navigation libraries are forced to [setCustomAnimations](https://developer.android.com/reference/androidx/fragment/app/FragmentTransaction.html#setCustomAnimations(int,int)) instead of [enter and exit Transitions](https://developer.android.com/reference/android/app/Fragment#setEnterTransition(android.transition.Transition)). But animations have limitations compared to Transitions - Animations have to be resx files so can’t be defined declaratively in React - Android’s Material Transforms are built around Transitions - Native shared elements only support Transitions Images disappearing during Transitions is [a known Fresco bug](facebook/fresco#2512). This PR applies [the fix suggested by the Fresco repo](facebook/fresco#1445 (comment)). ## Changelog: [ANDROID] [FIXED] - Support Android Transitions during Fragment navigation Pull Request resolved: #37857 Test Plan: I’ve created a [minimal reproduction that demonstrates the bug](https://github.com/grahammendick/image-disappears-during-transition-bug). The first video below shows the example from that repo. You can see that the image disappears when changing the painting. It should fade out and in like the text does. The second video shows the same example after the fix is applied. You can see that the painting fades out and in just like the text. https://github.com/facebook/react-native/assets/1761227/6739f029-eda0-44d2-b328-a73b075bd82a https://github.com/facebook/react-native/assets/1761227/9c73cdf0-303b-4a82-8df5-5f6a5846a58e Reviewed By: javache Differential Revision: D46769995 Pulled By: dmytrorykun fbshipit-source-id: 0ced8af7b246d8c59cbfb5cabf422114c6154c65
Description
I'm using a ImageView with DraweeHolder. When I transition to a different fragment, the image in my image view is cleared. My non-Fresco backed images don't get cleared.
It seems like this is triggered from AbstractDraweeController.onDetach.
Is there any way to avoid this?
Additional Information
The text was updated successfully, but these errors were encountered: