Skip to content

Commit

Permalink
Convert ReactViewGroup to Kotlin (#46577)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #46577

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D62642663

fbshipit-source-id: 780350e7e449ffd2d6378cbed6f4381e34636a24
  • Loading branch information
Thomas Nardone authored and facebook-github-bot committed Sep 19, 2024
1 parent d80e1e9 commit 66c3074
Show file tree
Hide file tree
Showing 5 changed files with 839 additions and 980 deletions.
1 change: 0 additions & 1 deletion packages/react-native/ReactAndroid/api/ReactAndroid.api
Original file line number Diff line number Diff line change
Expand Up @@ -8326,7 +8326,6 @@ public class com/facebook/react/views/view/ReactViewGroup : android/view/ViewGro
public fun draw (Landroid/graphics/Canvas;)V
protected fun drawChild (Landroid/graphics/Canvas;Landroid/view/View;J)Z
protected fun getChildDrawingOrder (II)I
public fun getChildVisibleRect (Landroid/view/View;Landroid/graphics/Rect;Landroid/graphics/Point;)Z
public fun getClippingRect (Landroid/graphics/Rect;)V
public fun getHitSlopRect ()Landroid/graphics/Rect;
public fun getOverflow ()Ljava/lang/String;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -432,21 +432,21 @@ public class ReactModalHostView(context: ThemedReactContext) :
reactContext.reactApplicationContext.handleException(RuntimeException(t))
}

override fun onInterceptTouchEvent(event: MotionEvent): Boolean {
override fun onInterceptTouchEvent(ev: MotionEvent): Boolean {
eventDispatcher?.let { eventDispatcher ->
jSTouchDispatcher.handleTouchEvent(event, eventDispatcher, reactContext)
jSPointerDispatcher?.handleMotionEvent(event, eventDispatcher, true)
jSTouchDispatcher.handleTouchEvent(ev, eventDispatcher, reactContext)
jSPointerDispatcher?.handleMotionEvent(ev, eventDispatcher, true)
}
return super.onInterceptTouchEvent(event)
return super.onInterceptTouchEvent(ev)
}

@SuppressLint("ClickableViewAccessibility")
override fun onTouchEvent(event: MotionEvent): Boolean {
override fun onTouchEvent(ev: MotionEvent): Boolean {
eventDispatcher?.let { eventDispatcher ->
jSTouchDispatcher.handleTouchEvent(event, eventDispatcher, reactContext)
jSPointerDispatcher?.handleMotionEvent(event, eventDispatcher, false)
jSTouchDispatcher.handleTouchEvent(ev, eventDispatcher, reactContext)
jSPointerDispatcher?.handleMotionEvent(ev, eventDispatcher, false)
}
super.onTouchEvent(event)
super.onTouchEvent(ev)
// In case when there is no children interested in handling touch event, we return true from
// the root view in order to receive subsequent events related to that gesture
return true
Expand Down
Loading

0 comments on commit 66c3074

Please sign in to comment.