From c80309e5ae66d651c4dabcd5c0b4ec912797c9fd Mon Sep 17 00:00:00 2001 From: Genki Kondo Date: Sun, 12 Jun 2022 12:42:08 -0700 Subject: [PATCH] Support animation events in ViewEventModule Summary: Adds support for handling animations in response to events on the platform side, without needing a JS round trip. With this TM, NativeViewEvents will no longer affected by JS thread - hover events will not be delayed when JS thread is busy. This makes a significant difference for VR panel apps - see test plan for an example for the before and after in Store. Changelog: [Internal] - Make NativeAnimatedNodesManager public Reviewed By: JoshuaGross Differential Revision: D37082069 fbshipit-source-id: 330acd78c547587de5545b61895e0d821fb99552 --- .../java/com/facebook/react/animated/NativeAnimatedModule.java | 2 +- .../com/facebook/react/animated/NativeAnimatedNodesManager.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/animated/NativeAnimatedModule.java b/ReactAndroid/src/main/java/com/facebook/react/animated/NativeAnimatedModule.java index 275fcdea53f..f3b7e4e4040 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/animated/NativeAnimatedModule.java +++ b/ReactAndroid/src/main/java/com/facebook/react/animated/NativeAnimatedModule.java @@ -411,7 +411,7 @@ public class NativeAnimatedModule extends NativeAnimatedModuleSpec * @return {@link NativeAnimatedNodesManager} */ @Nullable - private NativeAnimatedNodesManager getNodesManager() { + public NativeAnimatedNodesManager getNodesManager() { if (mNodesManager.get() == null) { ReactApplicationContext reactApplicationContext = getReactApplicationContextIfActiveOrWarn(); diff --git a/ReactAndroid/src/main/java/com/facebook/react/animated/NativeAnimatedNodesManager.java b/ReactAndroid/src/main/java/com/facebook/react/animated/NativeAnimatedNodesManager.java index ffb215fa616..83307b52c1e 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/animated/NativeAnimatedNodesManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/animated/NativeAnimatedNodesManager.java @@ -51,7 +51,7 @@ import java.util.Queue; * *

IMPORTANT: This class should be accessed only from the UI Thread */ -/*package*/ class NativeAnimatedNodesManager implements EventDispatcherListener { +public class NativeAnimatedNodesManager implements EventDispatcherListener { private static final String TAG = "NativeAnimatedNodesManager";