Skip to content

Commit 7dea1d7

Browse files
mateoguzmanafacebook-github-bot
authored andcommitted
Make ReactInterceptingViewGroup and OnInterceptTouchEventListener internal (react#50919)
Summary: These classes can be internalized as part of the initiative to reduce the public API surface. I've checked there are no relevant OSS usages. - [ReactInterceptingViewGroup](https://github.com/search?type=code&q=NOT+is%3Afork+NOT+org%3Afacebook+NOT+repo%3Areact-native-tvos%2Freact-native-tvos+NOT+repo%3Anuagoz%2Freact-native+NOT+repo%3A2lambda123%2Freact-native+NOT+repo%3Abeanchips%2Ffacebookreactnative+NOT+repo%3AfabOnReact%2Freact-native-notes+NOT+user%3Ahuntie+NOT+user%3Acortinico+NOT+repo%3AMaxdev18%2Fpowersync_app+NOT+repo%3Acarter-0%2Finstagram-decompiled+NOT+repo%3Am0mosenpai%2Finstadamn+NOT+repo%3AA-Star100%2FA-Star100-AUG2-2024+NOT+repo%3Alclnrd%2Fdetox-scrollview-reproductible+NOT+repo%3ADionisisChytiris%2FWorldWiseTrivia_Main+NOT+repo%3Apast3l%2Fhi2+NOT+repo%3AoneDotpy%2FCaribouQuest+NOT+repo%3Abejayoharen%2Fdailytodo+NOT+repo%3Amolangning%2Freversing-discord+NOT+repo%3AScottPrzy%2Freact-native+NOT+repo%3Agabrieldonadel%2Freact-native-visionos+NOT+repo%3AGabriel2308%2FTestes-Soft+NOT+repo%3Adawnzs03%2FflakyBuild+NOT+repo%3Acga2351%2Fcode+NOT+repo%3Astreeg%2Ftcc+NOT+repo%3Asoftware-mansion-labs%2Freact-native-swiftui+NOT+repo%3Apkcsecurity%2Fdecompiled-lightbulb+com.facebook.react.touch.ReactInterceptingViewGroup) - [OnInterceptTouchEventListener](https://github.com/search?type=code&q=NOT+is%3Afork+NOT+org%3Afacebook+NOT+repo%3Areact-native-tvos%2Freact-native-tvos+NOT+repo%3Anuagoz%2Freact-native+NOT+repo%3A2lambda123%2Freact-native+NOT+repo%3Abeanchips%2Ffacebookreactnative+NOT+repo%3AfabOnReact%2Freact-native-notes+NOT+user%3Ahuntie+NOT+user%3Acortinico+NOT+repo%3AMaxdev18%2Fpowersync_app+NOT+repo%3Acarter-0%2Finstagram-decompiled+NOT+repo%3Am0mosenpai%2Finstadamn+NOT+repo%3AA-Star100%2FA-Star100-AUG2-2024+NOT+repo%3Alclnrd%2Fdetox-scrollview-reproductible+NOT+repo%3ADionisisChytiris%2FWorldWiseTrivia_Main+NOT+repo%3Apast3l%2Fhi2+NOT+repo%3AoneDotpy%2FCaribouQuest+NOT+repo%3Abejayoharen%2Fdailytodo+NOT+repo%3Amolangning%2Freversing-discord+NOT+repo%3AScottPrzy%2Freact-native+NOT+repo%3Agabrieldonadel%2Freact-native-visionos+NOT+repo%3AGabriel2308%2FTestes-Soft+NOT+repo%3Adawnzs03%2FflakyBuild+NOT+repo%3Acga2351%2Fcode+NOT+repo%3Astreeg%2Ftcc+NOT+repo%3Asoftware-mansion-labs%2Freact-native-swiftui+NOT+repo%3Apkcsecurity%2Fdecompiled-lightbulb+com.facebook.react.touch.OnInterceptTouchEventListener) ## Changelog: [INTERNAL] - Make ReactInterceptingViewGroup and OnInterceptTouchEventListener internal Pull Request resolved: react#50919 Test Plan: ```bash yarn test-android yarn android ``` Reviewed By: javache, cortinico Differential Revision: D73643867 Pulled By: rshest fbshipit-source-id: 8e3c9d36f3cdd985d53189c83e462ca1c612d96c
1 parent 906474a commit 7dea1d7

3 files changed

Lines changed: 4 additions & 12 deletions

File tree

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

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3396,18 +3396,10 @@ public final class com/facebook/react/touch/JSResponderHandler : com/facebook/re
33963396
public final fun setJSResponder (ILandroid/view/ViewParent;)V
33973397
}
33983398

3399-
public abstract interface class com/facebook/react/touch/OnInterceptTouchEventListener {
3400-
public abstract fun onInterceptTouchEvent (Landroid/view/ViewGroup;Landroid/view/MotionEvent;)Z
3401-
}
3402-
34033399
public abstract interface class com/facebook/react/touch/ReactHitSlopView {
34043400
public abstract fun getHitSlopRect ()Landroid/graphics/Rect;
34053401
}
34063402

3407-
public abstract interface class com/facebook/react/touch/ReactInterceptingViewGroup {
3408-
public abstract fun setOnInterceptTouchEventListener (Lcom/facebook/react/touch/OnInterceptTouchEventListener;)V
3409-
}
3410-
34113403
public final class com/facebook/react/turbomodule/core/interfaces/BindingsInstallerHolder {
34123404
public fun <init> (Lcom/facebook/jni/HybridData;)V
34133405
}

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/touch/OnInterceptTouchEventListener.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import android.view.ViewGroup
1414
* Interface definition for a callback to be invoked when a onInterceptTouch is called on a
1515
* [ViewGroup].
1616
*/
17-
public fun interface OnInterceptTouchEventListener {
17+
internal fun interface OnInterceptTouchEventListener {
1818

1919
/**
2020
* Called when a onInterceptTouch is invoked on a view group.
@@ -24,5 +24,5 @@ public fun interface OnInterceptTouchEventListener {
2424
* @return Return true to steal motion event from the children and have the dispatched to this
2525
* view, or return false to allow motion event to be delivered to children view
2626
*/
27-
public fun onInterceptTouchEvent(view: ViewGroup, event: MotionEvent): Boolean
27+
fun onInterceptTouchEvent(view: ViewGroup, event: MotionEvent): Boolean
2828
}

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/touch/ReactInterceptingViewGroup.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import android.view.ViewGroup
1515
* onInterceptTouch event listener which then is used to control touch event flow in cases in which
1616
* they requested to be intercepted by some parent view based on a JS gesture detector.
1717
*/
18-
public interface ReactInterceptingViewGroup {
18+
internal interface ReactInterceptingViewGroup {
1919

2020
/**
2121
* A [ViewGroup] instance that implement this interface is responsible for storing the listener
@@ -27,5 +27,5 @@ public interface ReactInterceptingViewGroup {
2727
* @param listener A callback that [ViewGroup] should delegate calls for
2828
* [ViewGroup#onInterceptTouchEvent] to
2929
*/
30-
public fun setOnInterceptTouchEventListener(listener: OnInterceptTouchEventListener)
30+
fun setOnInterceptTouchEventListener(listener: OnInterceptTouchEventListener)
3131
}

0 commit comments

Comments
 (0)