Skip to content

Commit 8087eda

Browse files
mateoguzmanafacebook-github-bot
authored andcommitted
Migrate YogaLayoutType to Kotlin (#1837)
Summary: Migrate com.facebook.yoga.YogaLayoutType to Kotlin. Pull Request resolved: #1837 Test Plan: RN ```sh yarn android yarn test-android ``` Yoga ```sh ./gradlew :yoga:assembleDebug ``` Reviewed By: rshest Differential Revision: D79897708 Pulled By: cortinico fbshipit-source-id: e3c8a3cc60f806d151d2be956b26dd98963254a6
1 parent c90aecb commit 8087eda

2 files changed

Lines changed: 27 additions & 35 deletions

File tree

java/com/facebook/yoga/YogaLayoutType.java

Lines changed: 0 additions & 35 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+
package com.facebook.yoga
9+
10+
public enum class YogaLayoutType(public val intValue: Int) {
11+
LAYOUT(0),
12+
MEASURE(1),
13+
CACHED_LAYOUT(2),
14+
CACHED_MEASURE(3);
15+
16+
public companion object {
17+
@JvmStatic
18+
public fun fromInt(value: Int): YogaLayoutType =
19+
when (value) {
20+
0 -> LAYOUT
21+
1 -> MEASURE
22+
2 -> CACHED_LAYOUT
23+
3 -> CACHED_MEASURE
24+
else -> throw IllegalArgumentException("Unknown enum value: $value")
25+
}
26+
}
27+
}

0 commit comments

Comments
 (0)