Skip to content

Commit

Permalink
Fix view recycling incorrectly resetting transform (#39306)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #39306

This broke on Android platforms where `ReactFeatureFlags.enableViewRecycling` is enabled, as `setTransform` no longer directly mutates the transform properties, but instead goes through `setTransformProperty`

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D49008194

fbshipit-source-id: 7e5543b8ce79caaaf380f20010bdde69f6e212b1
  • Loading branch information
javache authored and pull[bot] committed Jan 17, 2024
1 parent 502a20f commit 1477436
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ protected T prepareToRecycleView(@NonNull ThemedReactContext reactContext, T vie
// setScaleX
// setScaleY
// setCameraDistance
setTransform(view, null);
setTransformProperty(view, null, null);

// RenderNode params not covered by setTransform above
// RenderNode params not covered by setTransformProperty above
view.resetPivot();
view.setTop(0);
view.setBottom(0);
Expand All @@ -94,6 +94,7 @@ protected T prepareToRecycleView(@NonNull ThemedReactContext reactContext, T vie
view.setTag(R.id.transform_origin, null);
view.setTag(R.id.invalidate_transform, null);
view.removeOnLayoutChangeListener(this);

// setShadowColor
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
view.setOutlineAmbientShadowColor(Color.BLACK);
Expand Down

0 comments on commit 1477436

Please sign in to comment.