Skip to content

Commit 984621b

Browse files
cortinicometa-codesync[bot]
authored andcommitted
Migrate YogaFlexDirection enum to Kotlin (#56788)
Summary: X-link: react/yoga#1948 Pull Request resolved: #56788 Migrate YogaFlexDirection.java to YogaFlexDirection.kt by adding FlexDirection to KOTLIN_ENUM_NAMES in enums.py and regenerating. Reviewed By: fabriziocucci Differential Revision: D104666341 fbshipit-source-id: ea52f553ad0ebdbf9392c7c0ed125a33685e2c31
1 parent 70ebd43 commit 984621b

2 files changed

Lines changed: 31 additions & 37 deletions

File tree

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

Lines changed: 0 additions & 37 deletions
This file was deleted.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
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 YogaFlexDirection(public val intValue: Int) {
13+
COLUMN(0),
14+
COLUMN_REVERSE(1),
15+
ROW(2),
16+
ROW_REVERSE(3);
17+
18+
public fun intValue(): Int = intValue
19+
20+
public companion object {
21+
@JvmStatic
22+
public fun fromInt(value: Int): YogaFlexDirection =
23+
when (value) {
24+
0 -> COLUMN
25+
1 -> COLUMN_REVERSE
26+
2 -> ROW
27+
3 -> ROW_REVERSE
28+
else -> throw IllegalArgumentException("Unknown enum value: $value")
29+
}
30+
}
31+
}

0 commit comments

Comments
 (0)