From 26862a0251b2acdfbade84da46753318a62c700d Mon Sep 17 00:00:00 2001 From: Nicola Corti Date: Tue, 12 May 2026 07:48:48 -0700 Subject: [PATCH] Migrate YogaGutter enum to Kotlin (#56791) Summary: X-link: https://github.com/facebook/yoga/pull/1955 Pull Request resolved: https://github.com/facebook/react-native/pull/56791 Migrate YogaGutter.java to YogaGutter.kt by adding Gutter to KOTLIN_ENUM_NAMES in enums.py and regenerating. Reviewed By: fabriziocucci Differential Revision: D104666345 fbshipit-source-id: 12dbfc582c07be31cfb37d7a520961bea1f212b4 --- .../java/com/facebook/yoga/YogaGutter.java | 35 ------------------- .../main/java/com/facebook/yoga/YogaGutter.kt | 29 +++++++++++++++ 2 files changed, 29 insertions(+), 35 deletions(-) delete mode 100644 packages/react-native/ReactAndroid/src/main/java/com/facebook/yoga/YogaGutter.java create mode 100644 packages/react-native/ReactAndroid/src/main/java/com/facebook/yoga/YogaGutter.kt diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/yoga/YogaGutter.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/yoga/YogaGutter.java deleted file mode 100644 index 2b4be1c08d9..00000000000 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/yoga/YogaGutter.java +++ /dev/null @@ -1,35 +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. - */ - -// @generated by enums.py - -package com.facebook.yoga; - -public enum YogaGutter { - COLUMN(0), - ROW(1), - ALL(2); - - private final int mIntValue; - - YogaGutter(int intValue) { - mIntValue = intValue; - } - - public int intValue() { - return mIntValue; - } - - public static YogaGutter fromInt(int value) { - switch (value) { - case 0: return COLUMN; - case 1: return ROW; - case 2: return ALL; - default: throw new IllegalArgumentException("Unknown enum value: " + value); - } - } -} diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/yoga/YogaGutter.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/yoga/YogaGutter.kt new file mode 100644 index 00000000000..873423a589c --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/yoga/YogaGutter.kt @@ -0,0 +1,29 @@ +/* + * 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. + */ + +// @generated by enums.py + +package com.facebook.yoga + +public enum class YogaGutter(public val intValue: Int) { + COLUMN(0), + ROW(1), + ALL(2); + + public fun intValue(): Int = intValue + + public companion object { + @JvmStatic + public fun fromInt(value: Int): YogaGutter = + when (value) { + 0 -> COLUMN + 1 -> ROW + 2 -> ALL + else -> throw IllegalArgumentException("Unknown enum value: $value") + } + } +}