diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/yoga/YogaAlign.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/yoga/YogaAlign.java deleted file mode 100644 index 6f1c4565818c..000000000000 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/yoga/YogaAlign.java +++ /dev/null @@ -1,51 +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 YogaAlign { - AUTO(0), - FLEX_START(1), - CENTER(2), - FLEX_END(3), - STRETCH(4), - BASELINE(5), - SPACE_BETWEEN(6), - SPACE_AROUND(7), - SPACE_EVENLY(8), - START(9), - END(10); - - private final int mIntValue; - - YogaAlign(int intValue) { - mIntValue = intValue; - } - - public int intValue() { - return mIntValue; - } - - public static YogaAlign fromInt(int value) { - switch (value) { - case 0: return AUTO; - case 1: return FLEX_START; - case 2: return CENTER; - case 3: return FLEX_END; - case 4: return STRETCH; - case 5: return BASELINE; - case 6: return SPACE_BETWEEN; - case 7: return SPACE_AROUND; - case 8: return SPACE_EVENLY; - case 9: return START; - case 10: return END; - default: throw new IllegalArgumentException("Unknown enum value: " + value); - } - } -} diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/yoga/YogaAlign.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/yoga/YogaAlign.kt new file mode 100644 index 000000000000..e8fa92d454e4 --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/yoga/YogaAlign.kt @@ -0,0 +1,45 @@ +/* + * 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 YogaAlign(public val intValue: Int) { + AUTO(0), + FLEX_START(1), + CENTER(2), + FLEX_END(3), + STRETCH(4), + BASELINE(5), + SPACE_BETWEEN(6), + SPACE_AROUND(7), + SPACE_EVENLY(8), + START(9), + END(10); + + public fun intValue(): Int = intValue + + public companion object { + @JvmStatic + public fun fromInt(value: Int): YogaAlign = + when (value) { + 0 -> AUTO + 1 -> FLEX_START + 2 -> CENTER + 3 -> FLEX_END + 4 -> STRETCH + 5 -> BASELINE + 6 -> SPACE_BETWEEN + 7 -> SPACE_AROUND + 8 -> SPACE_EVENLY + 9 -> START + 10 -> END + else -> throw IllegalArgumentException("Unknown enum value: $value") + } + } +} diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/yoga/YogaBoxSizing.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/yoga/YogaBoxSizing.java deleted file mode 100644 index fcd25f55ddc0..000000000000 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/yoga/YogaBoxSizing.java +++ /dev/null @@ -1,33 +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 YogaBoxSizing { - BORDER_BOX(0), - CONTENT_BOX(1); - - private final int mIntValue; - - YogaBoxSizing(int intValue) { - mIntValue = intValue; - } - - public int intValue() { - return mIntValue; - } - - public static YogaBoxSizing fromInt(int value) { - switch (value) { - case 0: return BORDER_BOX; - case 1: return CONTENT_BOX; - default: throw new IllegalArgumentException("Unknown enum value: " + value); - } - } -} diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/yoga/YogaBoxSizing.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/yoga/YogaBoxSizing.kt new file mode 100644 index 000000000000..c7d055fc7f95 --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/yoga/YogaBoxSizing.kt @@ -0,0 +1,27 @@ +/* + * 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 YogaBoxSizing(public val intValue: Int) { + BORDER_BOX(0), + CONTENT_BOX(1); + + public fun intValue(): Int = intValue + + public companion object { + @JvmStatic + public fun fromInt(value: Int): YogaBoxSizing = + when (value) { + 0 -> BORDER_BOX + 1 -> CONTENT_BOX + else -> throw IllegalArgumentException("Unknown enum value: $value") + } + } +} diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/yoga/YogaDimension.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/yoga/YogaDimension.java deleted file mode 100644 index a949ddc3ce1c..000000000000 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/yoga/YogaDimension.java +++ /dev/null @@ -1,33 +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 YogaDimension { - WIDTH(0), - HEIGHT(1); - - private final int mIntValue; - - YogaDimension(int intValue) { - mIntValue = intValue; - } - - public int intValue() { - return mIntValue; - } - - public static YogaDimension fromInt(int value) { - switch (value) { - case 0: return WIDTH; - case 1: return HEIGHT; - default: throw new IllegalArgumentException("Unknown enum value: " + value); - } - } -} diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/yoga/YogaDimension.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/yoga/YogaDimension.kt new file mode 100644 index 000000000000..132cc2929307 --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/yoga/YogaDimension.kt @@ -0,0 +1,27 @@ +/* + * 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 YogaDimension(public val intValue: Int) { + WIDTH(0), + HEIGHT(1); + + public fun intValue(): Int = intValue + + public companion object { + @JvmStatic + public fun fromInt(value: Int): YogaDimension = + when (value) { + 0 -> WIDTH + 1 -> HEIGHT + else -> throw IllegalArgumentException("Unknown enum value: $value") + } + } +} diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/yoga/YogaDisplay.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/yoga/YogaDisplay.java deleted file mode 100644 index 8e7e0f83cd9c..000000000000 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/yoga/YogaDisplay.java +++ /dev/null @@ -1,37 +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 YogaDisplay { - FLEX(0), - NONE(1), - CONTENTS(2), - GRID(3); - - private final int mIntValue; - - YogaDisplay(int intValue) { - mIntValue = intValue; - } - - public int intValue() { - return mIntValue; - } - - public static YogaDisplay fromInt(int value) { - switch (value) { - case 0: return FLEX; - case 1: return NONE; - case 2: return CONTENTS; - case 3: return GRID; - default: throw new IllegalArgumentException("Unknown enum value: " + value); - } - } -} diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/yoga/YogaDisplay.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/yoga/YogaDisplay.kt new file mode 100644 index 000000000000..6a56a048bbde --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/yoga/YogaDisplay.kt @@ -0,0 +1,31 @@ +/* + * 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 YogaDisplay(public val intValue: Int) { + FLEX(0), + NONE(1), + CONTENTS(2), + GRID(3); + + public fun intValue(): Int = intValue + + public companion object { + @JvmStatic + public fun fromInt(value: Int): YogaDisplay = + when (value) { + 0 -> FLEX + 1 -> NONE + 2 -> CONTENTS + 3 -> GRID + else -> throw IllegalArgumentException("Unknown enum value: $value") + } + } +} diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/yoga/YogaEdge.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/yoga/YogaEdge.java deleted file mode 100644 index 6b915348230d..000000000000 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/yoga/YogaEdge.java +++ /dev/null @@ -1,47 +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 YogaEdge { - LEFT(0), - TOP(1), - RIGHT(2), - BOTTOM(3), - START(4), - END(5), - HORIZONTAL(6), - VERTICAL(7), - ALL(8); - - private final int mIntValue; - - YogaEdge(int intValue) { - mIntValue = intValue; - } - - public int intValue() { - return mIntValue; - } - - public static YogaEdge fromInt(int value) { - switch (value) { - case 0: return LEFT; - case 1: return TOP; - case 2: return RIGHT; - case 3: return BOTTOM; - case 4: return START; - case 5: return END; - case 6: return HORIZONTAL; - case 7: return VERTICAL; - case 8: return ALL; - default: throw new IllegalArgumentException("Unknown enum value: " + value); - } - } -} diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/yoga/YogaEdge.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/yoga/YogaEdge.kt new file mode 100644 index 000000000000..0ab62ebbf3b4 --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/yoga/YogaEdge.kt @@ -0,0 +1,41 @@ +/* + * 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 YogaEdge(public val intValue: Int) { + LEFT(0), + TOP(1), + RIGHT(2), + BOTTOM(3), + START(4), + END(5), + HORIZONTAL(6), + VERTICAL(7), + ALL(8); + + public fun intValue(): Int = intValue + + public companion object { + @JvmStatic + public fun fromInt(value: Int): YogaEdge = + when (value) { + 0 -> LEFT + 1 -> TOP + 2 -> RIGHT + 3 -> BOTTOM + 4 -> START + 5 -> END + 6 -> HORIZONTAL + 7 -> VERTICAL + 8 -> ALL + else -> throw IllegalArgumentException("Unknown enum value: $value") + } + } +} diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/yoga/YogaErrata.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/yoga/YogaErrata.java deleted file mode 100644 index e0521b3fbb52..000000000000 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/yoga/YogaErrata.java +++ /dev/null @@ -1,41 +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 YogaErrata { - NONE(0), - STRETCH_FLEX_BASIS(1), - ABSOLUTE_POSITION_WITHOUT_INSETS_EXCLUDES_PADDING(2), - ABSOLUTE_PERCENT_AGAINST_INNER_SIZE(4), - ALL(2147483647), - CLASSIC(2147483646); - - private final int mIntValue; - - YogaErrata(int intValue) { - mIntValue = intValue; - } - - public int intValue() { - return mIntValue; - } - - public static YogaErrata fromInt(int value) { - switch (value) { - case 0: return NONE; - case 1: return STRETCH_FLEX_BASIS; - case 2: return ABSOLUTE_POSITION_WITHOUT_INSETS_EXCLUDES_PADDING; - case 4: return ABSOLUTE_PERCENT_AGAINST_INNER_SIZE; - case 2147483647: return ALL; - case 2147483646: return CLASSIC; - default: throw new IllegalArgumentException("Unknown enum value: " + value); - } - } -} diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/yoga/YogaErrata.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/yoga/YogaErrata.kt new file mode 100644 index 000000000000..940f2861e1d3 --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/yoga/YogaErrata.kt @@ -0,0 +1,35 @@ +/* + * 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 YogaErrata(public val intValue: Int) { + NONE(0), + STRETCH_FLEX_BASIS(1), + ABSOLUTE_POSITION_WITHOUT_INSETS_EXCLUDES_PADDING(2), + ABSOLUTE_PERCENT_AGAINST_INNER_SIZE(4), + ALL(2147483647), + CLASSIC(2147483646); + + public fun intValue(): Int = intValue + + public companion object { + @JvmStatic + public fun fromInt(value: Int): YogaErrata = + when (value) { + 0 -> NONE + 1 -> STRETCH_FLEX_BASIS + 2 -> ABSOLUTE_POSITION_WITHOUT_INSETS_EXCLUDES_PADDING + 4 -> ABSOLUTE_PERCENT_AGAINST_INNER_SIZE + 2147483647 -> ALL + 2147483646 -> CLASSIC + else -> throw IllegalArgumentException("Unknown enum value: $value") + } + } +} diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/yoga/YogaExperimentalFeature.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/yoga/YogaExperimentalFeature.java deleted file mode 100644 index 32e643439e3d..000000000000 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/yoga/YogaExperimentalFeature.java +++ /dev/null @@ -1,33 +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 YogaExperimentalFeature { - WEB_FLEX_BASIS(0), - FIX_FLEX_BASIS_FIT_CONTENT(1); - - private final int mIntValue; - - YogaExperimentalFeature(int intValue) { - mIntValue = intValue; - } - - public int intValue() { - return mIntValue; - } - - public static YogaExperimentalFeature fromInt(int value) { - switch (value) { - case 0: return WEB_FLEX_BASIS; - case 1: return FIX_FLEX_BASIS_FIT_CONTENT; - default: throw new IllegalArgumentException("Unknown enum value: " + value); - } - } -} diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/yoga/YogaExperimentalFeature.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/yoga/YogaExperimentalFeature.kt new file mode 100644 index 000000000000..aec70ac24698 --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/yoga/YogaExperimentalFeature.kt @@ -0,0 +1,27 @@ +/* + * 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 YogaExperimentalFeature(public val intValue: Int) { + WEB_FLEX_BASIS(0), + FIX_FLEX_BASIS_FIT_CONTENT(1); + + public fun intValue(): Int = intValue + + public companion object { + @JvmStatic + public fun fromInt(value: Int): YogaExperimentalFeature = + when (value) { + 0 -> WEB_FLEX_BASIS + 1 -> FIX_FLEX_BASIS_FIT_CONTENT + else -> throw IllegalArgumentException("Unknown enum value: $value") + } + } +} diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/yoga/YogaFlexDirection.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/yoga/YogaFlexDirection.java deleted file mode 100644 index 719888a1864e..000000000000 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/yoga/YogaFlexDirection.java +++ /dev/null @@ -1,37 +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 YogaFlexDirection { - COLUMN(0), - COLUMN_REVERSE(1), - ROW(2), - ROW_REVERSE(3); - - private final int mIntValue; - - YogaFlexDirection(int intValue) { - mIntValue = intValue; - } - - public int intValue() { - return mIntValue; - } - - public static YogaFlexDirection fromInt(int value) { - switch (value) { - case 0: return COLUMN; - case 1: return COLUMN_REVERSE; - case 2: return ROW; - case 3: return ROW_REVERSE; - default: throw new IllegalArgumentException("Unknown enum value: " + value); - } - } -} diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/yoga/YogaFlexDirection.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/yoga/YogaFlexDirection.kt new file mode 100644 index 000000000000..d9ed0e32862e --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/yoga/YogaFlexDirection.kt @@ -0,0 +1,31 @@ +/* + * 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 YogaFlexDirection(public val intValue: Int) { + COLUMN(0), + COLUMN_REVERSE(1), + ROW(2), + ROW_REVERSE(3); + + public fun intValue(): Int = intValue + + public companion object { + @JvmStatic + public fun fromInt(value: Int): YogaFlexDirection = + when (value) { + 0 -> COLUMN + 1 -> COLUMN_REVERSE + 2 -> ROW + 3 -> ROW_REVERSE + else -> throw IllegalArgumentException("Unknown enum value: $value") + } + } +} diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/yoga/YogaGridTrackType.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/yoga/YogaGridTrackType.java deleted file mode 100644 index e3d22d25be3f..000000000000 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/yoga/YogaGridTrackType.java +++ /dev/null @@ -1,39 +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 YogaGridTrackType { - AUTO(0), - POINTS(1), - PERCENT(2), - FR(3), - MINMAX(4); - - private final int mIntValue; - - YogaGridTrackType(int intValue) { - mIntValue = intValue; - } - - public int intValue() { - return mIntValue; - } - - public static YogaGridTrackType fromInt(int value) { - switch (value) { - case 0: return AUTO; - case 1: return POINTS; - case 2: return PERCENT; - case 3: return FR; - case 4: return MINMAX; - default: throw new IllegalArgumentException("Unknown enum value: " + value); - } - } -} diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/yoga/YogaGridTrackType.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/yoga/YogaGridTrackType.kt new file mode 100644 index 000000000000..61dc61559033 --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/yoga/YogaGridTrackType.kt @@ -0,0 +1,33 @@ +/* + * 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 YogaGridTrackType(public val intValue: Int) { + AUTO(0), + POINTS(1), + PERCENT(2), + FR(3), + MINMAX(4); + + public fun intValue(): Int = intValue + + public companion object { + @JvmStatic + public fun fromInt(value: Int): YogaGridTrackType = + when (value) { + 0 -> AUTO + 1 -> POINTS + 2 -> PERCENT + 3 -> FR + 4 -> MINMAX + else -> throw IllegalArgumentException("Unknown enum value: $value") + } + } +} 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 2b4be1c08d98..000000000000 --- 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 000000000000..873423a589c3 --- /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") + } + } +} diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/yoga/YogaJustify.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/yoga/YogaJustify.java deleted file mode 100644 index 778238ec6636..000000000000 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/yoga/YogaJustify.java +++ /dev/null @@ -1,49 +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 YogaJustify { - AUTO(0), - FLEX_START(1), - CENTER(2), - FLEX_END(3), - SPACE_BETWEEN(4), - SPACE_AROUND(5), - SPACE_EVENLY(6), - STRETCH(7), - START(8), - END(9); - - private final int mIntValue; - - YogaJustify(int intValue) { - mIntValue = intValue; - } - - public int intValue() { - return mIntValue; - } - - public static YogaJustify fromInt(int value) { - switch (value) { - case 0: return AUTO; - case 1: return FLEX_START; - case 2: return CENTER; - case 3: return FLEX_END; - case 4: return SPACE_BETWEEN; - case 5: return SPACE_AROUND; - case 6: return SPACE_EVENLY; - case 7: return STRETCH; - case 8: return START; - case 9: return END; - default: throw new IllegalArgumentException("Unknown enum value: " + value); - } - } -} diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/yoga/YogaJustify.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/yoga/YogaJustify.kt new file mode 100644 index 000000000000..731b034ef264 --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/yoga/YogaJustify.kt @@ -0,0 +1,43 @@ +/* + * 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 YogaJustify(public val intValue: Int) { + AUTO(0), + FLEX_START(1), + CENTER(2), + FLEX_END(3), + SPACE_BETWEEN(4), + SPACE_AROUND(5), + SPACE_EVENLY(6), + STRETCH(7), + START(8), + END(9); + + public fun intValue(): Int = intValue + + public companion object { + @JvmStatic + public fun fromInt(value: Int): YogaJustify = + when (value) { + 0 -> AUTO + 1 -> FLEX_START + 2 -> CENTER + 3 -> FLEX_END + 4 -> SPACE_BETWEEN + 5 -> SPACE_AROUND + 6 -> SPACE_EVENLY + 7 -> STRETCH + 8 -> START + 9 -> END + else -> throw IllegalArgumentException("Unknown enum value: $value") + } + } +} diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/yoga/YogaLogLevel.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/yoga/YogaLogLevel.java deleted file mode 100644 index 761f302eb29d..000000000000 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/yoga/YogaLogLevel.java +++ /dev/null @@ -1,45 +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; - -import com.facebook.yoga.annotations.DoNotStrip; - -@DoNotStrip -public enum YogaLogLevel { - ERROR(0), - WARN(1), - INFO(2), - DEBUG(3), - VERBOSE(4), - FATAL(5); - - private final int mIntValue; - - YogaLogLevel(int intValue) { - mIntValue = intValue; - } - - public int intValue() { - return mIntValue; - } - - @DoNotStrip - public static YogaLogLevel fromInt(int value) { - switch (value) { - case 0: return ERROR; - case 1: return WARN; - case 2: return INFO; - case 3: return DEBUG; - case 4: return VERBOSE; - case 5: return FATAL; - default: throw new IllegalArgumentException("Unknown enum value: " + value); - } - } -} diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/yoga/YogaLogLevel.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/yoga/YogaLogLevel.kt new file mode 100644 index 000000000000..a8ff53fdd930 --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/yoga/YogaLogLevel.kt @@ -0,0 +1,39 @@ +/* + * 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 + +import com.facebook.yoga.annotations.DoNotStrip + +@DoNotStrip +public enum class YogaLogLevel(public val intValue: Int) { + ERROR(0), + WARN(1), + INFO(2), + DEBUG(3), + VERBOSE(4), + FATAL(5); + + public fun intValue(): Int = intValue + + public companion object { + @DoNotStrip + @JvmStatic + public fun fromInt(value: Int): YogaLogLevel = + when (value) { + 0 -> ERROR + 1 -> WARN + 2 -> INFO + 3 -> DEBUG + 4 -> VERBOSE + 5 -> FATAL + else -> throw IllegalArgumentException("Unknown enum value: $value") + } + } +}