Make setPointerEvents public on ReactViewGroup.java (#45975)

Summary:
I maintain the `react-native-svg` library, where our elements extend `ReactViewGroup`. Currently, `ReactViewGroup` only exposes the getter for `mPointerEvents` publicly, so we cannot set it. To properly handle `pointerEvents`, we would have to duplicate all methods related to `mPointerEvents`, which results in maintaining a separate state. This duplication can lead to desynchronization between the state in our class and the state in the superclass.

PR with a workaround that we can avoid with this change https://github.com/software-mansion/react-native-svg/pull/2395

## Changelog:

[ANDROID] [CHANGED] - make `setPointerEvents` public

Pull Request resolved: https://github.com/facebook/react-native/pull/45975

Test Plan: This change was tested manually by making the field public, allowing dependent classes to override or reference it.

Reviewed By: cortinico

Differential Revision: D61124293

Pulled By: javache

fbshipit-source-id: 389d0a670375a8a68c975294f98c33c28ef41ffe
This commit is contained in:
Jakub Grzywacz
2024-08-12 10:36:57 -07:00
committed by Facebook GitHub Bot
parent c30e35fb44
commit 010e0010a3
2 changed files with 2 additions and 1 deletions
@@ -8247,6 +8247,7 @@ public class com/facebook/react/views/view/ReactViewGroup : android/view/ViewGro
public fun setOpacityIfPossible (F)V
public fun setOverflow (Ljava/lang/String;)V
public fun setOverflowInset (IIII)V
public fun setPointerEvents (Lcom/facebook/react/uimanager/PointerEvents;)V
public fun setRemoveClippedSubviews (Z)V
public fun setTranslucentBackgroundDrawable (Landroid/graphics/drawable/Drawable;)V
public fun updateClippingRect ()V
@@ -673,7 +673,7 @@ public class ReactViewGroup extends ViewGroup
// to it's children.
}
/*package*/ void setPointerEvents(PointerEvents pointerEvents) {
public void setPointerEvents(PointerEvents pointerEvents) {
mPointerEvents = pointerEvents;
}