Skip to content

Commit 2d2b992

Browse files
cortinicometa-codesync[bot]
authored andcommitted
Migrate YogaDimension enum to Kotlin (#56795)
Summary: X-link: react/yoga#1951 Pull Request resolved: #56795 Migrate YogaDimension.java to YogaDimension.kt by adding Dimension to KOTLIN_ENUM_NAMES in enums.py and regenerating. Reviewed By: fabriziocucci Differential Revision: D104666342 fbshipit-source-id: 506c2ea8d1cb98c7a385168cdca9dba1892d8149
1 parent fe15456 commit 2d2b992

2 files changed

Lines changed: 27 additions & 33 deletions

File tree

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

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

0 commit comments

Comments
 (0)