Skip to content

Commit 084a776

Browse files
cortinicometa-codesync[bot]
authored andcommitted
Migrate YogaJustify enum to Kotlin (#56796)
Summary: X-link: react/yoga#1950 Pull Request resolved: #56796 Migrate YogaJustify.java to YogaJustify.kt by adding Justify to KOTLIN_ENUM_NAMES in enums.py and regenerating. Reviewed By: fabriziocucci Differential Revision: D104666331 fbshipit-source-id: c28e62b7e411d317bb1b10edec4995d29684cb90
1 parent 26862a0 commit 084a776

2 files changed

Lines changed: 43 additions & 49 deletions

File tree

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

Lines changed: 0 additions & 49 deletions
This file was deleted.
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
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 YogaJustify(public val intValue: Int) {
13+
AUTO(0),
14+
FLEX_START(1),
15+
CENTER(2),
16+
FLEX_END(3),
17+
SPACE_BETWEEN(4),
18+
SPACE_AROUND(5),
19+
SPACE_EVENLY(6),
20+
STRETCH(7),
21+
START(8),
22+
END(9);
23+
24+
public fun intValue(): Int = intValue
25+
26+
public companion object {
27+
@JvmStatic
28+
public fun fromInt(value: Int): YogaJustify =
29+
when (value) {
30+
0 -> AUTO
31+
1 -> FLEX_START
32+
2 -> CENTER
33+
3 -> FLEX_END
34+
4 -> SPACE_BETWEEN
35+
5 -> SPACE_AROUND
36+
6 -> SPACE_EVENLY
37+
7 -> STRETCH
38+
8 -> START
39+
9 -> END
40+
else -> throw IllegalArgumentException("Unknown enum value: $value")
41+
}
42+
}
43+
}

0 commit comments

Comments
 (0)