You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Summary:
This diff converts `FabricUIManager.java` to Kotlin as part of the ongoing React Native Android Java-to-Kotlin migration effort.
Key changes:
- Converted the class from Java to Kotlin with idiomatic patterns
- Removed Hungarian notation from all private fields (e.g. `mBinding` -> `uiManagerBinding`, `mDestroyed` -> `destroyed`)
- Static fields (`TAG`, `IS_DEVELOPMENT_ENVIRONMENT`) and static initializer moved to `companion object` with `JvmField` for binary compatibility
- `eventDispatcher` and `performanceCounters` implemented as `override val` properties matching Kotlin interface definitions
- Package-private methods (`setBinding`, `createDispatchCommandMountItemForInterop`) mapped to `internal`
- All `!!` operator usages replaced with `checkNotNull`/`requireNotNull` for safer null handling
- Nullable `commandArgs` passed through via unchecked cast to preserve original Java null-pass-through behavior
- `OptIn(UnstableReactNativeAPI::class)` added at class level
Supporting changes required by the migration:
- `DevToolsReactPerfLogger.kt`: `private companion object` changed to `internal companion object` since Kotlin enforces companion visibility that Java did not
- `SynchronousMountItem.kt`: Import path updated to use `FabricUIManager.Companion.IS_DEVELOPMENT_ENVIRONMENT`
- `PreparedLayout.kt`: Changed from `internal` to `public` because `FabricUIManager` public JNI-facing methods return/accept this type
- `ReactAndroid.api`: Regenerated to reflect the updated API surface
Changelog: [Internal]
Differential Revision: D107865206
Copy file name to clipboardExpand all lines: packages/react-native/ReactAndroid/api/ReactAndroid.api
+21-20Lines changed: 21 additions & 20 deletions
Original file line number
Diff line number
Diff line change
@@ -2223,57 +2223,58 @@ public final class com/facebook/react/fabric/DevToolsReactPerfLogger$FabricCommi
2223
2223
}
2224
2224
2225
2225
public class com/facebook/react/fabric/FabricUIManager : com/facebook/react/bridge/LifecycleEventListener, com/facebook/react/bridge/UIManager, com/facebook/react/fabric/interop/UIBlockViewResolver, com/facebook/react/uimanager/events/SynchronousEventReceiver {
2226
+
public static final field Companion Lcom/facebook/react/fabric/FabricUIManager$Companion;
2226
2227
public static final field IS_DEVELOPMENT_ENVIRONMENT Z
2227
2228
public static final field TAG Ljava/lang/String;
2228
-
public field mDevToolsReactPerfLogger Lcom/facebook/react/fabric/DevToolsReactPerfLogger;
2229
+
public field devToolsReactPerfLogger Lcom/facebook/react/fabric/DevToolsReactPerfLogger;
2229
2230
public fun <init> (Lcom/facebook/react/bridge/ReactApplicationContext;Lcom/facebook/react/uimanager/ViewManagerRegistry;Lcom/facebook/react/uimanager/events/BatchEventDispatchedListener;)V
2230
2231
public fun addRootView (Landroid/view/View;Lcom/facebook/react/bridge/WritableMap;)I
2231
-
public fun addUIBlock (Lcom/facebook/react/fabric/interop/UIBlock;)V
2232
+
public final fun addUIBlock (Lcom/facebook/react/fabric/interop/UIBlock;)V
2232
2233
public fun addUIManagerEventListener (Lcom/facebook/react/bridge/UIManagerListener;)V
2233
-
public fun attachRootView (Lcom/facebook/react/fabric/SurfaceHandlerBinding;Landroid/view/View;)V
2234
-
public fun clearJSResponder ()V
2235
-
public fun dispatchCommand (IIILcom/facebook/react/bridge/ReadableArray;)V
2234
+
public final fun clearJSResponder ()V
2235
+
public final fun dispatchCommand (IIILcom/facebook/react/bridge/ReadableArray;)V
2236
2236
public fun dispatchCommand (IILcom/facebook/react/bridge/ReadableArray;)V
2237
-
public fun dispatchCommand (IILjava/lang/String;Lcom/facebook/react/bridge/ReadableArray;)V
2237
+
public final fun dispatchCommand (IILjava/lang/String;Lcom/facebook/react/bridge/ReadableArray;)V
2238
2238
public fun dispatchCommand (ILjava/lang/String;Lcom/facebook/react/bridge/ReadableArray;)V
2239
-
public fun findNextFocusableElement (III)Ljava/lang/Integer;
2240
-
public fun getColor (I[Ljava/lang/String;)I
2239
+
public final fun findNextFocusableElement (III)Ljava/lang/Integer;
2240
+
public final fun getColor (I[Ljava/lang/String;)I
2241
2241
public fun getEventDispatcher ()Lcom/facebook/react/uimanager/events/EventDispatcher;
2242
2242
public fun getPerformanceCounters ()Ljava/util/Map;
2243
-
public fun getRelativeAncestorList (II)[I
2244
-
public fun getThemeData (I[F)Z
2243
+
public final fun getRelativeAncestorList (II)[I
2244
+
public final fun getThemeData (I[F)Z
2245
2245
public fun initialize ()V
2246
2246
public fun invalidate ()V
2247
2247
public fun markActiveTouchForTag (II)V
2248
-
public fun measure (ILjava/lang/String;Lcom/facebook/react/bridge/ReadableMap;Lcom/facebook/react/bridge/ReadableMap;Lcom/facebook/react/bridge/ReadableMap;FFFF)J
2249
-
public fun onAllAnimationsComplete ()V
2250
-
public fun onAnimationStarted ()V
2248
+
public final fun measure (ILjava/lang/String;Lcom/facebook/react/bridge/ReadableMap;Lcom/facebook/react/bridge/ReadableMap;Lcom/facebook/react/bridge/ReadableMap;FFFF)J
2249
+
public final fun onAllAnimationsComplete ()V
2250
+
public final fun onAnimationStarted ()V
2251
2251
public fun onHostDestroy ()V
2252
2252
public fun onHostPause ()V
2253
2253
public fun onHostResume ()V
2254
-
public fun onRequestEventBeat ()V
2255
-
public fun prependUIBlock (Lcom/facebook/react/fabric/interop/UIBlock;)V
2254
+
public final fun onRequestEventBeat ()V
2255
+
public final fun prependUIBlock (Lcom/facebook/react/fabric/interop/UIBlock;)V
2256
2256
public fun profileNextBatch ()V
2257
2257
public fun receiveEvent (IILjava/lang/String;Lcom/facebook/react/bridge/WritableMap;)V
2258
-
public fun receiveEvent (IILjava/lang/String;ZLcom/facebook/react/bridge/WritableMap;I)V
2258
+
public final fun receiveEvent (IILjava/lang/String;ZLcom/facebook/react/bridge/WritableMap;I)V
2259
2259
public fun receiveEvent (IILjava/lang/String;ZLcom/facebook/react/bridge/WritableMap;IZ)V
2260
2260
public fun receiveEvent (IILjava/lang/String;ZLcom/facebook/react/bridge/WritableMap;IZJ)V
2261
2261
public fun receiveEvent (ILjava/lang/String;Lcom/facebook/react/bridge/WritableMap;)V
2262
2262
public fun removeUIManagerEventListener (Lcom/facebook/react/bridge/UIManagerListener;)V
2263
2263
public fun resolveCustomDirectEventName (Ljava/lang/String;)Ljava/lang/String;
2264
2264
public fun resolveView (I)Landroid/view/View;
2265
2265
public fun sendAccessibilityEvent (II)V
2266
-
public fun sendAccessibilityEventFromJS (IILjava/lang/String;)V
2267
-
public fun setJSResponder (IIIZ)V
2266
+
public final fun sendAccessibilityEventFromJS (IILjava/lang/String;)V
2267
+
public final fun setJSResponder (IIIZ)V
2268
2268
public fun startSurface (Landroid/view/View;Ljava/lang/String;Lcom/facebook/react/bridge/WritableMap;II)I
2269
-
public fun startSurface (Lcom/facebook/react/fabric/SurfaceHandlerBinding;Landroid/content/Context;Landroid/view/View;)V
2270
2269
public fun stopSurface (I)V
2271
-
public fun stopSurface (Lcom/facebook/react/fabric/SurfaceHandlerBinding;)V
2272
2270
public fun sweepActiveTouchForTag (II)V
2273
2271
public fun synchronouslyUpdateViewOnUIThread (ILcom/facebook/react/bridge/ReadableMap;)V
2274
2272
public fun updateRootLayoutSpecs (IIIII)V
2275
2273
}
2276
2274
2275
+
public final class com/facebook/react/fabric/FabricUIManager$Companion {
2276
+
}
2277
+
2277
2278
public final class com/facebook/react/fabric/FabricUIManagerProviderImpl : com/facebook/react/bridge/UIManagerProvider {
2278
2279
public fun <init> (Lcom/facebook/react/fabric/ComponentFactory;Lcom/facebook/react/uimanager/ViewManagerRegistry;)V
2279
2280
public fun createUIManager (Lcom/facebook/react/bridge/ReactApplicationContext;)Lcom/facebook/react/bridge/UIManager;
0 commit comments