diff --git a/packages/react-native-reanimated/CHANGELOG.md b/packages/react-native-reanimated/CHANGELOG.md index fec8cc0e374c..e98ad807af8c 100644 --- a/packages/react-native-reanimated/CHANGELOG.md +++ b/packages/react-native-reanimated/CHANGELOG.md @@ -13,5 +13,6 @@ - Fix `EXC_BAD_ACCESS` crash in `-[REANodesManager performOperations]` when called before the `_performOperations` block is registered on iOS. ([#10229](https://github.com/software-mansion/react-native-reanimated/pull/10229) by [@tomekzaw](https://github.com/tomekzaw)) - Fix missing unmount of ancestors of animated components with exiting animations in experimental Layout Animations Proxy ([#10103](https://github.com/software-mansion/react-native-reanimated/pull/10103) by [@pawicao](https://github.com/pawicao)) - Fix crash when a CSS animation or transition runs between two keyword values on a property that also accepts relative lengths, such as `width` going from `auto` to `auto`. ([#10281](https://github.com/software-mansion/react-native-reanimated/pull/10281) by [@MatiPl01](https://github.com/MatiPl01)) +- Fix Android flashes at the start of entering animations in experimental Layout Animations Proxy by temporarily setting opacity 0 at the start of an insert mutation ([#10198](https://github.com/software-mansion/react-native-reanimated/pull/10198) by [@pawicao](https://github.com/pawicao)) ### 💡 Others diff --git a/packages/react-native-reanimated/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsProxy_Experimental.cpp b/packages/react-native-reanimated/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsProxy_Experimental.cpp index 4a638ba8c90c..72c1b4763270 100644 --- a/packages/react-native-reanimated/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsProxy_Experimental.cpp +++ b/packages/react-native-reanimated/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsProxy_Experimental.cpp @@ -267,6 +267,9 @@ void LayoutAnimationsProxy_Experimental::updateLightTree( } else if (layoutAnimationsManager_->hasLayoutAnimation(tag, ENTERING)) { entering_.push_back(node); filteredMutations.push_back(mutation); + auto hiddenView = cloneViewWithoutOpacity(mutation.newChildShadowView, propsParserContext); + filteredMutations.push_back( + ShadowViewMutation::UpdateMutation(mutation.newChildShadowView, hiddenView, mutation.parentTag)); } else if (sharedTransitionManager_->tagToName_.contains(tag) && isInsideInactiveBoundary(node)) { filteredMutations.push_back(mutation); auto hiddenView = cloneViewWithoutOpacity(mutation.newChildShadowView, propsParserContext); @@ -474,7 +477,8 @@ void LayoutAnimationsProxy_Experimental::addOngoingAnimations(SurfaceId surfaceI const auto layoutAnimationIt = layoutAnimations_.find(tag); - if (layoutAnimationIt == layoutAnimations_.end() || layoutAnimationIt->second.isSettled()) { + if (layoutAnimationIt == layoutAnimations_.end() || + (layoutAnimationIt->second.isSettled() && !layoutAnimationIt->second.opacity.has_value())) { continue; }