Skip to content

Commit f24bedb

Browse files
committed
Migrate YogaConstants to Kotlin
1 parent c5fb371 commit f24bedb

2 files changed

Lines changed: 18 additions & 25 deletions

File tree

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

Lines changed: 0 additions & 25 deletions
This file was deleted.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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 object YogaConstants {
11+
@JvmField public val UNDEFINED: Float = Float.NaN
12+
13+
@JvmStatic public fun isUndefined(value: Float): Boolean = value.compareTo(UNDEFINED) == 0
14+
15+
@JvmStatic public fun isUndefined(value: YogaValue): Boolean = value.unit == YogaUnit.UNDEFINED
16+
17+
@JvmStatic public fun getUndefined(): Float = UNDEFINED
18+
}

0 commit comments

Comments
 (0)