Skip to content

Commit

Permalink
Migrate package com.facebook.react.uimanager.RootView to Kotlin
Browse files Browse the repository at this point in the history
Summary:
As per title.

Changelog: [Internal]

Differential Revision: D66159881
  • Loading branch information
fabriziocucci authored and facebook-github-bot committed Nov 19, 2024
1 parent 398b3b3 commit 9f27870
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
* LICENSE file in the root directory of this source tree.
*/

package com.facebook.react.uimanager;
package com.facebook.react.uimanager

import android.view.MotionEvent;
import android.view.View;
import android.view.MotionEvent
import android.view.View

/** Interface for the root native view of a React native application. */
public interface RootView {
Expand All @@ -17,21 +17,20 @@ public interface RootView {
* Called when a child starts a native gesture (e.g. a scroll in a ScrollView). Should be called
* from the child's onTouchIntercepted implementation.
*/
void onChildStartedNativeGesture(View childView, MotionEvent ev);
public fun onChildStartedNativeGesture(childView: View?, ev: MotionEvent)

/**
* @deprecated
*/
@Deprecated
default void onChildStartedNativeGesture(MotionEvent ev) {
onChildStartedNativeGesture(null, ev);
@Deprecated(
message = "Use onChildStartedNativeGesture with a childView parameter.",
replaceWith = ReplaceWith("onChildStartedNativeGesture"))
public fun onChildStartedNativeGesture(ev: MotionEvent) {
onChildStartedNativeGesture(null, ev)
}

/**
* Called when a child ends a native gesture. Should be called from the child's onTouchIntercepted
* implementation.
*/
void onChildEndedNativeGesture(View childView, MotionEvent ev);
public fun onChildEndedNativeGesture(childView: View, ev: MotionEvent)

void handleException(Throwable t);
public fun handleException(t: Throwable)
}
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ public class ReactModalHostView(context: ThemedReactContext) :
return super.onHoverEvent(event)
}

override fun onChildStartedNativeGesture(childView: View, ev: MotionEvent) {
override fun onChildStartedNativeGesture(childView: View?, ev: MotionEvent) {
eventDispatcher?.let { eventDispatcher ->
jSTouchDispatcher.onChildStartedNativeGesture(ev, eventDispatcher)
jSPointerDispatcher?.onChildStartedNativeGesture(childView, ev, eventDispatcher)
Expand Down

0 comments on commit 9f27870

Please sign in to comment.