From 7df9dbbccf28f723645ff8fa22e286394714ce43 Mon Sep 17 00:00:00 2001 From: Fabrizio Cucci Date: Wed, 3 Apr 2024 02:43:36 -0700 Subject: [PATCH] Kotlinify NativeKind (#43775) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/43775 Changelog: [Internal] As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)). Reviewed By: cortinico Differential Revision: D55640039 fbshipit-source-id: 5e8f395db0b7010e9a8b225a472db3bb46459d00 --- .../react/uimanager/{NativeKind.java => NativeKind.kt} | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) rename packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/{NativeKind.java => NativeKind.kt} (86%) diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/NativeKind.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/NativeKind.kt similarity index 86% rename from packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/NativeKind.java rename to packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/NativeKind.kt index 35d40c38241..7cc3313bc07 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/NativeKind.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/NativeKind.kt @@ -5,16 +5,13 @@ * LICENSE file in the root directory of this source tree. */ -package com.facebook.react.uimanager; - -import com.facebook.infer.annotation.Nullsafe; +package com.facebook.react.uimanager // Common conditionals: // - `kind == PARENT` checks whether the node can host children in the native tree. // - `kind != NONE` checks whether the node appears in the native tree. -@Nullsafe(Nullsafe.Mode.LOCAL) -public enum NativeKind { +public enum class NativeKind { // Node is in the native hierarchy and the HierarchyOptimizer should assume it can host children // (e.g. because it's a ViewGroup). Note that it's okay if the node doesn't support children. When // the HierarchyOptimizer generates children manipulation commands for that node, the @@ -24,5 +21,5 @@ public enum NativeKind { // because it isn't a ViewGroup). Consequently, its children need to be hosted by an ancestor. LEAF, // Node is not in the native hierarchy. - NONE + NONE, }