Skip to content

Commit a9ccdca

Browse files
mdvaccafacebook-github-bot
authored andcommitted
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
1 parent 44143b5 commit a9ccdca

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

ReactAndroid/src/main/java/com/facebook/react/uimanager/BaseViewManager.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -462,4 +462,19 @@ public void setBorderTopRightRadius(T view, float borderRadius) {
462462
private void logUnsupportedPropertyWarning(String propName) {
463463
FLog.w(ReactConstants.TAG, "%s doesn't support property '%s'", getName(), propName);
464464
}
465+
466+
@ReactProp(name = "pointerenter")
467+
public void setPointerEnter(@NonNull T view, @Nullable boolean value) {
468+
view.setTag(R.id.pointer_enter, value);
469+
}
470+
471+
@ReactProp(name = "pointerleave")
472+
public void setPointerLeave(@NonNull T view, @Nullable boolean value) {
473+
view.setTag(R.id.pointer_leave, value);
474+
}
475+
476+
@ReactProp(name = "pointermove")
477+
public void setPointerMove(@NonNull T view, @Nullable boolean value) {
478+
view.setTag(R.id.pointer_move, value);
479+
}
465480
}

ReactAndroid/src/main/res/views/uimanager/values/ids.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,12 @@
2727
<!--tag is used to store accessibilityValue tag -->
2828
<item type="id" name="accessibility_value"/>
2929

30+
<!-- tag is used to store if a view is subscribed to the pointerenter event -->
31+
<item type="id" name="pointer_enter"/>
32+
33+
<!-- tag is used to store if a view is subscribed to the pointerleave event -->
34+
<item type="id" name="pointer_leave"/>
35+
36+
<!-- tag is used to store if a view is subscribed to the pointermove event -->
37+
<item type="id" name="pointer_move"/>
3038
</resources>

0 commit comments

Comments
 (0)