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
This commit is contained in:
David Vacca
2021-11-19 15:48:14 -08:00
committed by Facebook GitHub Bot
parent 44143b50fd
commit a9ccdcace5
2 changed files with 23 additions and 0 deletions
@@ -462,4 +462,19 @@ public abstract class BaseViewManager<T extends View, C extends LayoutShadowNode
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);
}
}