From e0be14a310009f085e6f5abb52528a528bc923f3 Mon Sep 17 00:00:00 2001 From: Pieter De Baets Date: Thu, 11 Aug 2022 02:36:44 -0700 Subject: [PATCH] Correctly reset pivot when recyling views Summary: Calling `setPivotX` and `setPivotY` internally sets `isPivotExplicitlySet` in Android UI, which causes some transforms to no longer use the right transform. Instead use `resetPivot` to get the desired behaviour. Changelog: [Android][Fixed] Bug with view transforms when view recycling is enabled Reviewed By: NickGerleman Differential Revision: D38579267 fbshipit-source-id: 36186286c6765f92aabaa44994546e06f34c2be0 --- .../java/com/facebook/react/uimanager/BaseViewManager.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/uimanager/BaseViewManager.java b/ReactAndroid/src/main/java/com/facebook/react/uimanager/BaseViewManager.java index 1d8b484b2058c9..e0458a86a7d42d 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/uimanager/BaseViewManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/uimanager/BaseViewManager.java @@ -92,8 +92,7 @@ protected T prepareToRecycleView(@NonNull ThemedReactContext reactContext, T vie setTransform(view, null); // RenderNode params not covered by setTransform above - view.setPivotX(0); - view.setPivotY(0); + view.resetPivot(); view.setTop(0); view.setBottom(0); view.setLeft(0);