Skip to content

Commit 990e8fd

Browse files
cortinicometa-codesync[bot]
authored andcommitted
Migrate YogaOverflow enum to Kotlin
Summary: X-link: react/react-native#56790 Migrate YogaOverflow.java to YogaOverflow.kt by adding Overflow to KOTLIN_ENUM_NAMES in enums.py and regenerating. Differential Revision: D104666340
1 parent 8f0018e commit 990e8fd

3 files changed

Lines changed: 30 additions & 35 deletions

File tree

enums.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@
111111
"LogLevel",
112112
"MeasureMode",
113113
"NodeType",
114+
"Overflow",
114115
}
115116

116117
ENUMS_KOTLIN = {name: ENUMS[name] for name in KOTLIN_ENUM_NAMES}

java/com/facebook/yoga/YogaOverflow.java

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

0 commit comments

Comments
 (0)