NativeAnimatedModule: subscribe to Fabric lifecycle events in more cases

Summary:
The previous assumption was that any animations would result in `addAnimatedEventToView` being called. That's not true in all cases, so sometimes we never subscribed to Fabric lifecycle events, preventing animations from working on some screens and for Venice.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D22483509

fbshipit-source-id: c97576675902b4b9e1d4e659c7c1e24c5fe92946
This commit is contained in:
Joshua Gross
2020-07-10 23:32:37 -07:00
committed by Facebook GitHub Bot
parent 8e6e83be0c
commit 95d05fc415
2 changed files with 78 additions and 47 deletions
@@ -51,6 +51,7 @@ import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.concurrent.CopyOnWriteArrayList;
/**
* Native module to allow JS to create and update native Views.
@@ -119,7 +120,8 @@ public class UIManagerModule extends ReactContextBaseJavaModule
private final UIImplementation mUIImplementation;
private final MemoryTrimCallback mMemoryTrimCallback = new MemoryTrimCallback();
private final List<UIManagerModuleListener> mListeners = new ArrayList<>();
private final List<UIManagerListener> mUIManagerListeners = new ArrayList<>();
private final CopyOnWriteArrayList<UIManagerListener> mUIManagerListeners =
new CopyOnWriteArrayList<>();
private @Nullable Map<String, WritableMap> mViewManagerConstantsCache;
private volatile int mViewManagerConstantsCacheSize;