Skip to content

Commit d181829

Browse files
cortinicometa-codesync[bot]
authored andcommitted
Migrate YogaPositionType enum to Kotlin (#56789)
Summary: X-link: react/yoga#1945 Pull Request resolved: #56789 Migrate YogaPositionType.java to YogaPositionType.kt by adding PositionType to KOTLIN_ENUM_NAMES in enums.py and regenerating. Reviewed By: fabriziocucci Differential Revision: D104666349 fbshipit-source-id: 7f81f15000f561fc11283313f74b4ae3112c2f75
1 parent 14c1d16 commit d181829

2 files changed

Lines changed: 29 additions & 35 deletions

File tree

packages/react-native/ReactAndroid/src/main/java/com/facebook/yoga/YogaPositionType.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 YogaPositionType(public val intValue: Int) {
13+
STATIC(0),
14+
RELATIVE(1),
15+
ABSOLUTE(2);
16+
17+
public fun intValue(): Int = intValue
18+
19+
public companion object {
20+
@JvmStatic
21+
public fun fromInt(value: Int): YogaPositionType =
22+
when (value) {
23+
0 -> STATIC
24+
1 -> RELATIVE
25+
2 -> ABSOLUTE
26+
else -> throw IllegalArgumentException("Unknown enum value: $value")
27+
}
28+
}
29+
}

0 commit comments

Comments
 (0)