Skip to content

Commit 9580a54

Browse files
cortinicometa-codesync[bot]
authored andcommitted
Migrate YogaDisplay enum to Kotlin (#56781)
Summary: X-link: react/yoga#1956 Pull Request resolved: #56781 Migrate YogaDisplay.java to YogaDisplay.kt by adding Display to KOTLIN_ENUM_NAMES in enums.py and regenerating. Reviewed By: fabriziocucci Differential Revision: D104666346 fbshipit-source-id: b49d06c947ce2fb2c24aee96a207e1ab737e5c10
1 parent 2d2b992 commit 9580a54

2 files changed

Lines changed: 31 additions & 37 deletions

File tree

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

0 commit comments

Comments
 (0)