Skip to content

Commit d0f1197

Browse files
cortinicometa-codesync[bot]
authored andcommitted
Migrate YogaAlign enum to Kotlin (#56783)
Summary: X-link: react/yoga#1947 Pull Request resolved: #56783 Migrate YogaAlign.java to YogaAlign.kt by adding Align to KOTLIN_ENUM_NAMES in enums.py and regenerating. Changelog: [Internal] - Reviewed By: fabriziocucci Differential Revision: D104666334 fbshipit-source-id: b14bdd56104e41fd68c7f98aeae341e3f6e4ec23
1 parent efcab20 commit d0f1197

2 files changed

Lines changed: 45 additions & 51 deletions

File tree

packages/react-native/ReactAndroid/src/main/java/com/facebook/yoga/YogaAlign.java

Lines changed: 0 additions & 51 deletions
This file was deleted.
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/*
2+
* Copyright (c) Meta Platforms, Inc. and affiliates.
3+
*
4+
* This source code is licensed under the MIT license found in the
5+
* LICENSE file in the root directory of this source tree.
6+
*/
7+
8+
// @generated by enums.py
9+
10+
package com.facebook.yoga
11+
12+
public enum class YogaAlign(public val intValue: Int) {
13+
AUTO(0),
14+
FLEX_START(1),
15+
CENTER(2),
16+
FLEX_END(3),
17+
STRETCH(4),
18+
BASELINE(5),
19+
SPACE_BETWEEN(6),
20+
SPACE_AROUND(7),
21+
SPACE_EVENLY(8),
22+
START(9),
23+
END(10);
24+
25+
public fun intValue(): Int = intValue
26+
27+
public companion object {
28+
@JvmStatic
29+
public fun fromInt(value: Int): YogaAlign =
30+
when (value) {
31+
0 -> AUTO
32+
1 -> FLEX_START
33+
2 -> CENTER
34+
3 -> FLEX_END
35+
4 -> STRETCH
36+
5 -> BASELINE
37+
6 -> SPACE_BETWEEN
38+
7 -> SPACE_AROUND
39+
8 -> SPACE_EVENLY
40+
9 -> START
41+
10 -> END
42+
else -> throw IllegalArgumentException("Unknown enum value: $value")
43+
}
44+
}
45+
}

0 commit comments

Comments
 (0)