Skip to content

Commit cf124f6

Browse files
fabriziocuccimeta-codesync[bot]
authored andcommitted
Make ImportantForInteractionHelper internal and move to views.view package (#55181)
Summary: Pull Request resolved: #55181 Changelog: [Internal] This change makes `ImportantForInteractionHelper` internal to avoid exposing it as part of the public API. The class is moved from `com.facebook.react.uimanager` to `com.facebook.react.views.view` package since it's only used by `ReactViewGroup` and `ReactViewManager` within that package. This reduces the public API surface of ReactAndroid and keeps implementation details private. Reviewed By: cortinico Differential Revision: D90767295 fbshipit-source-id: 0c763f20330c516c0647c92c8bd53320865a1f63
1 parent 6167171 commit cf124f6

4 files changed

Lines changed: 7 additions & 16 deletions

File tree

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

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3359,14 +3359,6 @@ public class com/facebook/react/uimanager/IllegalViewOperationException : com/fa
33593359
public final fun getView ()Landroid/view/View;
33603360
}
33613361

3362-
public final class com/facebook/react/uimanager/ImportantForInteractionHelper {
3363-
public static final field IMPORTANT_FOR_INTERACTION_EXCLUDE_DESCENDANTS I
3364-
public static final field IMPORTANT_FOR_INTERACTION_NO I
3365-
public static final field IMPORTANT_FOR_INTERACTION_YES I
3366-
public static final field INSTANCE Lcom/facebook/react/uimanager/ImportantForInteractionHelper;
3367-
public static final fun setImportantForInteraction (Landroid/view/View;Lcom/facebook/react/uimanager/PointerEvents;)V
3368-
}
3369-
33703362
public class com/facebook/react/uimanager/JSPointerDispatcher {
33713363
public fun <init> (Landroid/view/ViewGroup;)V
33723364
public fun handleMotionEvent (Landroid/view/MotionEvent;Lcom/facebook/react/uimanager/events/EventDispatcher;Z)V

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/ImportantForInteractionHelper.kt renamed to packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/view/ImportantForInteractionHelper.kt

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@
55
* LICENSE file in the root directory of this source tree.
66
*/
77

8-
package com.facebook.react.uimanager
8+
package com.facebook.react.views.view
99

1010
import android.view.View
1111
import com.facebook.react.R
12+
import com.facebook.react.uimanager.PointerEvents
1213

1314
/**
1415
* Helper class for managing the important_for_interaction view tag. This tag determines how a view
@@ -20,15 +21,15 @@ import com.facebook.react.R
2021
* - [IMPORTANT_FOR_INTERACTION_EXCLUDE_DESCENDANTS]: Descendants should be excluded from
2122
* interaction
2223
*/
23-
public object ImportantForInteractionHelper {
24+
internal object ImportantForInteractionHelper {
2425
/** The view is important for interaction. */
25-
public const val IMPORTANT_FOR_INTERACTION_YES: Int = 0x1
26+
const val IMPORTANT_FOR_INTERACTION_YES: Int = 0x1
2627

2728
/** The view is not important for interaction. */
28-
public const val IMPORTANT_FOR_INTERACTION_NO: Int = 0x2
29+
const val IMPORTANT_FOR_INTERACTION_NO: Int = 0x2
2930

3031
/** Descendants of this view should be excluded from interaction handling. */
31-
public const val IMPORTANT_FOR_INTERACTION_EXCLUDE_DESCENDANTS: Int = 0x8
32+
const val IMPORTANT_FOR_INTERACTION_EXCLUDE_DESCENDANTS: Int = 0x8
3233

3334
/**
3435
* Sets the important_for_interaction tag on a view based on the given [PointerEvents] value.
@@ -45,7 +46,7 @@ public object ImportantForInteractionHelper {
4546
* @param pointerEvents The pointer events value to convert and set
4647
*/
4748
@JvmStatic
48-
public fun setImportantForInteraction(view: View, pointerEvents: PointerEvents) {
49+
fun setImportantForInteraction(view: View, pointerEvents: PointerEvents) {
4950
val value =
5051
when (pointerEvents) {
5152
PointerEvents.AUTO -> IMPORTANT_FOR_INTERACTION_YES

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewGroup.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ import com.facebook.react.uimanager.BackgroundStyleApplicator.setBorderStyle
4444
import com.facebook.react.uimanager.BackgroundStyleApplicator.setBorderWidth
4545
import com.facebook.react.uimanager.BackgroundStyleApplicator.setFeedbackUnderlay
4646
import com.facebook.react.uimanager.BlendModeHelper.needsIsolatedLayer
47-
import com.facebook.react.uimanager.ImportantForInteractionHelper
4847
import com.facebook.react.uimanager.LengthPercentage
4948
import com.facebook.react.uimanager.LengthPercentageType
5049
import com.facebook.react.uimanager.MeasureSpecAssertions.assertExplicitMeasureSpec

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewManager.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import com.facebook.react.common.ReactConstants
2121
import com.facebook.react.internal.featureflags.ReactNativeFeatureFlags
2222
import com.facebook.react.module.annotations.ReactModule
2323
import com.facebook.react.uimanager.BackgroundStyleApplicator
24-
import com.facebook.react.uimanager.ImportantForInteractionHelper
2524
import com.facebook.react.uimanager.LengthPercentage
2625
import com.facebook.react.uimanager.LengthPercentageType
2726
import com.facebook.react.uimanager.PixelUtil.dpToPx

0 commit comments

Comments
 (0)