Skip to content

Commit f1cd007

Browse files
cortinicometa-codesync[bot]
authored andcommitted
Migrate JSPointerDispatcher to Kotlin (#56910)
Summary: Pull Request resolved: #56910 Convert `JSPointerDispatcher` from Java to Kotlin as part of the ongoing React Native Android migration to 100% Kotlin. This follows the same pattern as the recent `JSTouchDispatcher` migration; the class becomes `final` in the API surface (Kotlin default), which is intentional since the class is not part of the supported public API. Adjacent changes required by the migration: - Remove `JSPointerDispatcher.java` from the `ReactNoNewJavaDetector` allow-list. - Regenerate `ReactAndroid.api` to reflect the `final` modifier added to the class and its methods. - Fix one internal caller (`EmbeddedReactView`) whose `eventDispatcher` was being passed without a null-check; the call is now wrapped in the same `eventDispatcher?.let { ... }` pattern that already guards `jsTouchDispatcher` immediately above it. Changelog: [Internal] Reviewed By: javache Differential Revision: D105847417 fbshipit-source-id: 390ff2f0b4c7413a9f21532749cc934ecfedc4af
1 parent 5c937d7 commit f1cd007

3 files changed

Lines changed: 800 additions & 740 deletions

File tree

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

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

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

33293329
public final class com/facebook/react/uimanager/JSTouchDispatcher {

0 commit comments

Comments
 (0)