Skip to content

Commit 2be96e8

Browse files
cortinicometa-codesync[bot]
authored andcommitted
Migrate YogaEdge enum to Kotlin (#56782)
Summary: X-link: react/yoga#1942 Pull Request resolved: #56782 Migrate YogaEdge.java to YogaEdge.kt by adding Edge to KOTLIN_ENUM_NAMES in enums.py and regenerating. Reviewed By: fabriziocucci Differential Revision: D104666351 fbshipit-source-id: d771d8ad80c5f1f85d15ab5dc1d7b50eeb789b4e
1 parent 9580a54 commit 2be96e8

2 files changed

Lines changed: 41 additions & 47 deletions

File tree

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

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

0 commit comments

Comments
 (0)