From b4da61c7ce411f05427f00c825e00e4f37e3f743 Mon Sep 17 00:00:00 2001 From: David Vacca Date: Wed, 12 Feb 2025 13:31:44 -0800 Subject: [PATCH] Migrate ReactStage to kotlin Summary: Migrate ReactStage to kotlin changelog: [intenral] internal Differential Revision: D69544706 --- .../facebook/react/uimanager/ReactStage.java | 38 ------------------- .../facebook/react/uimanager/ReactStage.kt | 36 ++++++++++++++++++ 2 files changed, 36 insertions(+), 38 deletions(-) delete mode 100644 packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactStage.java create mode 100644 packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactStage.kt diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactStage.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactStage.java deleted file mode 100644 index f322f2ef1970..000000000000 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactStage.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -package com.facebook.react.uimanager; - -import static java.lang.annotation.RetentionPolicy.SOURCE; - -import androidx.annotation.IntDef; -import java.lang.annotation.Retention; - -/** The stage of the Surface */ -@Retention(SOURCE) -@IntDef({ - ReactStage.SURFACE_DID_INITIALIZE, - ReactStage.BRIDGE_DID_LOAD, - ReactStage.MODULE_DID_LOAD, - ReactStage.SURFACE_DID_RUN, - ReactStage.SURFACE_DID_INITIAL_RENDERING, - ReactStage.SURFACE_DID_INITIAL_LAYOUT, - ReactStage.SURFACE_DID_INITIAL_MOUNTING, - ReactStage.SURFACE_DID_STOP -}) -public @interface ReactStage { - int SURFACE_DID_INITIALIZE = 0; - int BRIDGE_DID_LOAD = 1; - int MODULE_DID_LOAD = 2; - int SURFACE_DID_RUN = 3; - int SURFACE_DID_INITIAL_RENDERING = 4; - int SURFACE_DID_INITIAL_LAYOUT = 5; - int SURFACE_DID_INITIAL_MOUNTING = 6; - int SURFACE_DID_STOP = 7; - - int ON_ATTACH_TO_INSTANCE = 101; -} diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactStage.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactStage.kt new file mode 100644 index 000000000000..883d874eaedb --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactStage.kt @@ -0,0 +1,36 @@ +/* + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +package com.facebook.react.uimanager + +import androidx.annotation.IntDef + +/** The stage of the Surface */ +@Retention(AnnotationRetention.SOURCE) +@IntDef( + value = + [ + ReactStage.SURFACE_DID_INITIALIZE, + ReactStage.BRIDGE_DID_LOAD, + ReactStage.MODULE_DID_LOAD, + ReactStage.SURFACE_DID_RUN, + ReactStage.SURFACE_DID_INITIAL_RENDERING, + ReactStage.SURFACE_DID_INITIAL_LAYOUT, + ReactStage.SURFACE_DID_INITIAL_MOUNTING, + ReactStage.SURFACE_DID_STOP]) +public annotation class ReactStage { + public companion object { + public const val SURFACE_DID_INITIALIZE: Int = 0 + public const val BRIDGE_DID_LOAD: Int = 1 + public const val MODULE_DID_LOAD: Int = 2 + public const val SURFACE_DID_RUN: Int = 3 + public const val SURFACE_DID_INITIAL_RENDERING: Int = 4 + public const val SURFACE_DID_INITIAL_LAYOUT: Int = 5 + public const val SURFACE_DID_INITIAL_MOUNTING: Int = 6 + public const val SURFACE_DID_STOP: Int = 7 + public const val ON_ATTACH_TO_INSTANCE: Int = 101 + } +}