Skip to content

Commit 1b421ff

Browse files
mateoguzmanafacebook-github-bot
authored andcommitted
Initial Kotlin setup and migrate YogaConstants
Summary: # Changelog: [Internal] - As part of the ongoing effort to migrate the React Native codebase to Kotlin, this PR introduces the initial setup required for Kotlin support in Yoga. - Added initial basic Kotlin configuration to the project. - Migrated `YogaConstants` as an initial file to try out the first migration steps. X-link: react/yoga#1829 Reviewed By: cortinico Differential Revision: D79545992 Pulled By: rshest
1 parent 9bb53c0 commit 1b421ff

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)