Skip to content

Commit

Permalink
Redo "[RN][Android] Convert ReactViewGroup to Kotlin" (facebook#46672)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: facebook#46672

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D63129923
  • Loading branch information
Thomas Nardone authored and facebook-github-bot committed Sep 26, 2024
1 parent 41da2ba commit fce08ab
Show file tree
Hide file tree
Showing 6 changed files with 936 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 @@ -8318,7 +8318,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 fce08ab

Please sign in to comment.