From 41b188b7e6fabcc276b0c9acc56d6ebb37418723 Mon Sep 17 00:00:00 2001 From: Nicola Corti Date: Thu, 15 Aug 2024 10:29:13 +0100 Subject: [PATCH] [LOCAL] Fix further compilation error introduced by cherry-pick conflicts --- .../com/facebook/react/uimanager/BaseViewManager.java | 2 ++ .../java/com/facebook/react/uimanager/common/ViewUtil.kt | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/BaseViewManager.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/BaseViewManager.java index b125f23ed6465a..bb1f80bcc5ba25 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/BaseViewManager.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/BaseViewManager.java @@ -29,6 +29,8 @@ import com.facebook.react.common.ReactConstants; import com.facebook.react.uimanager.ReactAccessibilityDelegate.AccessibilityRole; import com.facebook.react.uimanager.ReactAccessibilityDelegate.Role; +import com.facebook.react.uimanager.common.UIManagerType; +import com.facebook.react.uimanager.common.ViewUtil; import com.facebook.react.uimanager.annotations.ReactProp; import com.facebook.react.uimanager.events.PointerEventHelper; import com.facebook.react.uimanager.util.ReactFindViewUtil; diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/common/ViewUtil.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/common/ViewUtil.kt index 1294d4315a4a9e..18d7094608d211 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/common/ViewUtil.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/common/ViewUtil.kt @@ -7,6 +7,8 @@ package com.facebook.react.uimanager.common +import android.view.View + public object ViewUtil { public const val NO_SURFACE_ID: Int = -1 @@ -26,6 +28,12 @@ public object ViewUtil { UIManagerType.DEFAULT } + /** + * Overload for {@link #getUIManagerType(int)} that uses the view's id to determine if it + * originated from Fabric + */ + @JvmStatic @UIManagerType public fun getUIManagerType(view: View): Int = getUIManagerType(view.id) + /** * Version of getUIManagerType that uses both surfaceId and viewTag heuristics *