Kotlinify ReactYogaConfigProvider (#43773)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43773

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: cortinico

Differential Revision: D55638955

fbshipit-source-id: 068e0e43367e8f11d43dcbd811b881bdc27d801c
This commit is contained in:
Fabrizio Cucci
2024-04-02 16:17:39 -07:00
committed by Facebook GitHub Bot
parent 16fd4e4c0f
commit 79fa565b8c
3 changed files with 31 additions and 31 deletions
@@ -4753,9 +4753,9 @@ public class com/facebook/react/uimanager/ReactStylesDiffMap {
public fun toString ()Ljava/lang/String;
}
public class com/facebook/react/uimanager/ReactYogaConfigProvider {
public fun <init> ()V
public static fun get ()Lcom/facebook/yoga/YogaConfig;
public final class com/facebook/react/uimanager/ReactYogaConfigProvider {
public static final field INSTANCE Lcom/facebook/react/uimanager/ReactYogaConfigProvider;
public static final fun get ()Lcom/facebook/yoga/YogaConfig;
}
public abstract interface class com/facebook/react/uimanager/ReactZIndexedViewGroup {
@@ -1,28 +0,0 @@
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
package com.facebook.react.uimanager;
import com.facebook.infer.annotation.Nullsafe;
import com.facebook.yoga.YogaConfig;
import com.facebook.yoga.YogaConfigFactory;
import com.facebook.yoga.YogaErrata;
@Nullsafe(Nullsafe.Mode.LOCAL)
public class ReactYogaConfigProvider {
private static YogaConfig YOGA_CONFIG;
public static YogaConfig get() {
if (YOGA_CONFIG == null) {
YOGA_CONFIG = YogaConfigFactory.create();
YOGA_CONFIG.setPointScaleFactor(0f);
YOGA_CONFIG.setErrata(YogaErrata.ALL);
}
return YOGA_CONFIG;
}
}
@@ -0,0 +1,28 @@
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
package com.facebook.react.uimanager
import com.facebook.yoga.YogaConfig
import com.facebook.yoga.YogaConfigFactory
import com.facebook.yoga.YogaErrata
public object ReactYogaConfigProvider {
private val yogaConfig: YogaConfig by
lazy(LazyThreadSafetyMode.NONE) {
val config = YogaConfigFactory.create()
config.setPointScaleFactor(0f)
config.setErrata(YogaErrata.ALL)
config
}
@JvmStatic
public fun get(): YogaConfig {
return yogaConfig
}
}