From a9ccdcace53235513a9569e8cf896fcb3706d859 Mon Sep 17 00:00:00 2001 From: David Vacca Date: Fri, 19 Nov 2021 15:46:33 -0800 Subject: [PATCH] Store metadata to determine if a view is listening for a JS event Summary: This diff updates the BaseViewManager in order to store metadata in views that are handling JS events. This information will be used later in the stack to optimize dispatching of hover events and fix viewFlattening bugs changelog: [internal] internal Reviewed By: philIip Differential Revision: D32253127 fbshipit-source-id: b6b74f0b1a5b8cc652b3ac3fff42165ee4ce85e1 --- .../facebook/react/uimanager/BaseViewManager.java | 15 +++++++++++++++ .../src/main/res/views/uimanager/values/ids.xml | 8 ++++++++ 2 files changed, 23 insertions(+) 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 25579c4c292f6b..40a7227bf085d4 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/uimanager/BaseViewManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/uimanager/BaseViewManager.java @@ -462,4 +462,19 @@ public void setBorderTopRightRadius(T view, float borderRadius) { private void logUnsupportedPropertyWarning(String propName) { FLog.w(ReactConstants.TAG, "%s doesn't support property '%s'", getName(), propName); } + + @ReactProp(name = "pointerenter") + public void setPointerEnter(@NonNull T view, @Nullable boolean value) { + view.setTag(R.id.pointer_enter, value); + } + + @ReactProp(name = "pointerleave") + public void setPointerLeave(@NonNull T view, @Nullable boolean value) { + view.setTag(R.id.pointer_leave, value); + } + + @ReactProp(name = "pointermove") + public void setPointerMove(@NonNull T view, @Nullable boolean value) { + view.setTag(R.id.pointer_move, value); + } } diff --git a/ReactAndroid/src/main/res/views/uimanager/values/ids.xml b/ReactAndroid/src/main/res/views/uimanager/values/ids.xml index 6886defd469257..8fe4be952af418 100644 --- a/ReactAndroid/src/main/res/views/uimanager/values/ids.xml +++ b/ReactAndroid/src/main/res/views/uimanager/values/ids.xml @@ -27,4 +27,12 @@ + + + + + + + +