Skip to content

Commit f1b488f

Browse files
cortinicometa-codesync[bot]
authored andcommitted
Migrate YogaGridTrackType enum to Kotlin (#56786)
Summary: X-link: react/yoga#1952 Pull Request resolved: #56786 Migrate YogaGridTrackType.java to YogaGridTrackType.kt by adding GridTrackType to KOTLIN_ENUM_NAMES in enums.py and regenerating. Reviewed By: fabriziocucci Differential Revision: D104666336 fbshipit-source-id: 4b2966b14f09bfce9a64854bbfe161b7849195a8
1 parent 984621b commit f1b488f

2 files changed

Lines changed: 33 additions & 39 deletions

File tree

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

Lines changed: 0 additions & 39 deletions
This file was deleted.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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 YogaGridTrackType(public val intValue: Int) {
13+
AUTO(0),
14+
POINTS(1),
15+
PERCENT(2),
16+
FR(3),
17+
MINMAX(4);
18+
19+
public fun intValue(): Int = intValue
20+
21+
public companion object {
22+
@JvmStatic
23+
public fun fromInt(value: Int): YogaGridTrackType =
24+
when (value) {
25+
0 -> AUTO
26+
1 -> POINTS
27+
2 -> PERCENT
28+
3 -> FR
29+
4 -> MINMAX
30+
else -> throw IllegalArgumentException("Unknown enum value: $value")
31+
}
32+
}
33+
}

0 commit comments

Comments
 (0)