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
+33-19Lines changed: 33 additions & 19 deletions
Original file line number
Diff line number
Diff line change
@@ -2223,57 +2223,61 @@ 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
2229
public field mDevToolsReactPerfLogger 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 attachRootView (Lcom/facebook/react/fabric/SurfaceHandlerBinding;Landroid/view/View;)V
2235
+
public final fun clearJSResponder ()V
2236
+
public final fun dispatchCommand (IIILcom/facebook/react/bridge/ReadableArray;)V
2236
2237
public fun dispatchCommand (IILcom/facebook/react/bridge/ReadableArray;)V
2237
-
public fun dispatchCommand (IILjava/lang/String;Lcom/facebook/react/bridge/ReadableArray;)V
2238
+
public final fun dispatchCommand (IILjava/lang/String;Lcom/facebook/react/bridge/ReadableArray;)V
2238
2239
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
2240
+
public final fun findNextFocusableElement (III)Ljava/lang/Integer;
2241
+
public final fun getColor (I[Ljava/lang/String;)I
2241
2242
public fun getEventDispatcher ()Lcom/facebook/react/uimanager/events/EventDispatcher;
2242
2243
public fun getPerformanceCounters ()Ljava/util/Map;
2243
-
public fun getRelativeAncestorList (II)[I
2244
-
public fun getThemeData (I[F)Z
2244
+
public final fun getRelativeAncestorList (II)[I
2245
+
public final fun getThemeData (I[F)Z
2245
2246
public fun initialize ()V
2246
2247
public fun invalidate ()V
2247
2248
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
2249
+
public final fun measure (ILjava/lang/String;Lcom/facebook/react/bridge/ReadableMap;Lcom/facebook/react/bridge/ReadableMap;Lcom/facebook/react/bridge/ReadableMap;FFFF)J
2250
+
public final fun onAllAnimationsComplete ()V
2251
+
public final fun onAnimationStarted ()V
2251
2252
public fun onHostDestroy ()V
2252
2253
public fun onHostPause ()V
2253
2254
public fun onHostResume ()V
2254
-
public fun onRequestEventBeat ()V
2255
-
public fun prependUIBlock (Lcom/facebook/react/fabric/interop/UIBlock;)V
2255
+
public final fun onRequestEventBeat ()V
2256
+
public final fun prependUIBlock (Lcom/facebook/react/fabric/interop/UIBlock;)V
2256
2257
public fun profileNextBatch ()V
2257
2258
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
2259
+
public final fun receiveEvent (IILjava/lang/String;ZLcom/facebook/react/bridge/WritableMap;I)V
2259
2260
public fun receiveEvent (IILjava/lang/String;ZLcom/facebook/react/bridge/WritableMap;IZ)V
2260
2261
public fun receiveEvent (IILjava/lang/String;ZLcom/facebook/react/bridge/WritableMap;IZJ)V
2261
2262
public fun receiveEvent (ILjava/lang/String;Lcom/facebook/react/bridge/WritableMap;)V
2262
2263
public fun removeUIManagerEventListener (Lcom/facebook/react/bridge/UIManagerListener;)V
2263
2264
public fun resolveCustomDirectEventName (Ljava/lang/String;)Ljava/lang/String;
2264
2265
public fun resolveView (I)Landroid/view/View;
2265
2266
public fun sendAccessibilityEvent (II)V
2266
-
public fun sendAccessibilityEventFromJS (IILjava/lang/String;)V
2267
-
public fun setJSResponder (IIIZ)V
2267
+
public final fun sendAccessibilityEventFromJS (IILjava/lang/String;)V
2268
+
public final fun setJSResponder (IIIZ)V
2268
2269
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
+
public final fun startSurface (Lcom/facebook/react/fabric/SurfaceHandlerBinding;Landroid/content/Context;Landroid/view/View;)V
2270
2271
public fun stopSurface (I)V
2271
-
public fun stopSurface (Lcom/facebook/react/fabric/SurfaceHandlerBinding;)V
2272
+
public final fun stopSurface (Lcom/facebook/react/fabric/SurfaceHandlerBinding;)V
2272
2273
public fun sweepActiveTouchForTag (II)V
2273
2274
public fun synchronouslyUpdateViewOnUIThread (ILcom/facebook/react/bridge/ReadableMap;)V
2274
2275
public fun updateRootLayoutSpecs (IIIII)V
2275
2276
}
2276
2277
2278
+
public final class com/facebook/react/fabric/FabricUIManager$Companion {
2279
+
}
2280
+
2277
2281
public final class com/facebook/react/fabric/FabricUIManagerProviderImpl : com/facebook/react/bridge/UIManagerProvider {
2278
2282
public fun <init> (Lcom/facebook/react/fabric/ComponentFactory;Lcom/facebook/react/uimanager/ViewManagerRegistry;)V
2279
2283
public fun createUIManager (Lcom/facebook/react/bridge/ReactApplicationContext;)Lcom/facebook/react/bridge/UIManager;
@@ -5967,6 +5971,16 @@ public final class com/facebook/react/views/text/DefaultStyleValuesUtil {
5967
5971
public static final fun getTextColorSecondary (Landroid/content/Context;)Landroid/content/res/ColorStateList;
5968
5972
}
5969
5973
5974
+
public final class com/facebook/react/views/text/PreparedLayout {
5975
+
public fun <init> (Landroid/text/Layout;IF[III)V
5976
+
public final fun getJustificationMode ()I
5977
+
public final fun getLayout ()Landroid/text/Layout;
5978
+
public final fun getMaximumNumberOfLines ()I
5979
+
public final fun getReactTags ()[I
5980
+
public final fun getTextBreakStrategy ()I
5981
+
public final fun getVerticalOffset ()F
5982
+
}
5983
+
5970
5984
public final class com/facebook/react/views/text/ReactFontManager {
5971
5985
public static final field Companion Lcom/facebook/react/views/text/ReactFontManager$Companion;
5972
5986
public synthetic fun <init> (Lcom/facebook/react/common/assets/ReactFontManager;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
0 commit comments