Skip to content

Commit 59ea139

Browse files
cortinicometa-codesync[bot]
authored andcommitted
Migrate YogaNodeJNIBase.java to Kotlin (#56780)
Summary: X-link: facebook/yoga#1939 Pull Request resolved: #56780 Migrate YogaNodeJNIBase.java to YogaNodeJNIBase.kt, the last hand-written Java source file in the Yoga core library. This required converting all function overrides to Kotlin property overrides where the abstract YogaNode class declares them as val/var properties. Also changed nativePointer visibility in YogaConfigJNIBase from protected to internal to maintain same-module access that Java protected provided via package access. Changelog: [Internal] - Differential Revision: D104666335
1 parent f220b8e commit 59ea139

5 files changed

Lines changed: 724 additions & 933 deletions

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import com.facebook.yoga.YogaNative.jni_YGConfigSetPointScaleFactorJNI
1616
import com.facebook.yoga.YogaNative.jni_YGConfigSetUseWebDefaultsJNI
1717

1818
public abstract class YogaConfigJNIBase
19-
private constructor(@JvmField protected var nativePointer: Long) : YogaConfig() {
19+
private constructor(@JvmField internal var nativePointer: Long) : YogaConfig() {
2020
private var _logger: YogaLogger? = null
2121

2222
init {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,9 +226,9 @@ public abstract class YogaNode : YogaProps {
226226

227227
public abstract val layoutDirection: YogaDirection
228228

229-
abstract override fun setMeasureFunction(measureFunction: YogaMeasureFunction)
229+
abstract override fun setMeasureFunction(measureFunction: YogaMeasureFunction?)
230230

231-
abstract override fun setBaselineFunction(yogaBaselineFunction: YogaBaselineFunction)
231+
abstract override fun setBaselineFunction(yogaBaselineFunction: YogaBaselineFunction?)
232232

233233
public abstract val isMeasureDefined: Boolean
234234

0 commit comments

Comments
 (0)