Skip to content

Commit

Permalink
Migrate package com.facebook.react.uimanager.RootView to Kotlin (#47701)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #47701

As per title.

Changelog:
[Android][Breaking] Convert RootView to Kotlin

Reviewed By: cortinico

Differential Revision: D66159881

fbshipit-source-id: 082881a03946088293dde3c085e1d1882bac96be
  • Loading branch information
fabriziocucci authored and facebook-github-bot committed Dec 3, 2024
1 parent 9df20d4 commit 21c9491
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 21c9491

Please sign in to comment.