Skip to content

Commit e1a43b7

Browse files
cortinicofacebook-github-bot
authored andcommitted
Mark JSPointerDispatcher and JSTouchDispatcher as open (#57022)
Summary: The Java-to-Kotlin migration of these classes made them implicitly final (Kotlin default), breaking downstream libraries that subclass them (e.g. react-native-keyboard-controller's JSPointerDispatcherCompat). Adding `open` restores the pre-migration extensibility. ## Changelog: [ANDROID] [CHANGED] - Mark JSPointerDispatcher and JSTouchDispatcher as open Test Plan: CI Reviewed By: javache Differential Revision: D107089429 Pulled By: cortinico
1 parent 7cc8c76 commit e1a43b7

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

packages/react-native/ReactAndroid/api/ReactAndroid.api

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3319,14 +3319,14 @@ public class com/facebook/react/uimanager/IllegalViewOperationException : com/fa
33193319
public final fun getView ()Landroid/view/View;
33203320
}
33213321

3322-
public final class com/facebook/react/uimanager/JSPointerDispatcher {
3322+
public class com/facebook/react/uimanager/JSPointerDispatcher {
33233323
public fun <init> (Landroid/view/ViewGroup;)V
33243324
public final fun handleMotionEvent (Landroid/view/MotionEvent;Lcom/facebook/react/uimanager/events/EventDispatcher;Z)V
33253325
public final fun onChildEndedNativeGesture ()V
33263326
public final fun onChildStartedNativeGesture (Landroid/view/View;Landroid/view/MotionEvent;Lcom/facebook/react/uimanager/events/EventDispatcher;)V
33273327
}
33283328

3329-
public final class com/facebook/react/uimanager/JSTouchDispatcher {
3329+
public class com/facebook/react/uimanager/JSTouchDispatcher {
33303330
public fun <init> (Landroid/view/ViewGroup;)V
33313331
public final fun handleTouchEvent (Landroid/view/MotionEvent;Lcom/facebook/react/uimanager/events/EventDispatcher;)V
33323332
public final fun handleTouchEvent (Landroid/view/MotionEvent;Lcom/facebook/react/uimanager/events/EventDispatcher;Lcom/facebook/react/bridge/ReactContext;)V

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/JSPointerDispatcher.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import com.facebook.react.uimanager.events.PointerEventHelper.EVENT
2828
* onHoverEvent, onInterceptHoverEvent. It will correctly find the right view to handle the touch
2929
* and also dispatch the appropriate event to JS
3030
*/
31-
public class JSPointerDispatcher(private val rootViewGroup: ViewGroup) {
31+
public open class JSPointerDispatcher(private val rootViewGroup: ViewGroup) {
3232

3333
private var lastHitPathByPointerId: MutableMap<Int, List<ViewTarget>>? = null
3434
private var lastEventCoordinatesByPointerId: MutableMap<Int, FloatArray>? = null

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/JSTouchDispatcher.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import com.facebook.react.uimanager.events.TouchEventType
2525
* need to call handleTouchEvent from onTouchEvent and onInterceptTouchEvent. It will correctly find
2626
* the right view to handle the touch and also dispatch the appropriate event to JS
2727
*/
28-
public class JSTouchDispatcher(private val viewGroup: ViewGroup) {
28+
public open class JSTouchDispatcher(private val viewGroup: ViewGroup) {
2929
private var targetTag = -1
3030
private val targetCoordinates = FloatArray(2)
3131
private var childIsHandlingNativeGesture = false

0 commit comments

Comments
 (0)