From d1037226c0576350302a5e9aff4c939ee27d2ae6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateo=20Guzm=C3=A1n?= Date: Tue, 12 Aug 2025 07:40:31 -0700 Subject: [PATCH] Migrate `YogaMeasureFunction` to Kotlin (#1835) Summary: Migrate com.facebook.yoga.YogaMeasureFunction to Kotlin. Pull Request resolved: https://github.com/facebook/yoga/pull/1835 Test Plan: RN ```sh yarn android yarn test-android ``` Yoga ```sh ./gradlew :yoga:assembleDebug ``` Reviewed By: mdvacca Differential Revision: D79897728 Pulled By: cortinico fbshipit-source-id: 959ae976622838147685cf6088674dce25f5cc99 --- .../facebook/yoga/YogaMeasureFunction.java | 20 ------------------- java/com/facebook/yoga/YogaMeasureFunction.kt | 19 ++++++++++++++++++ 2 files changed, 19 insertions(+), 20 deletions(-) delete mode 100644 java/com/facebook/yoga/YogaMeasureFunction.java create mode 100644 java/com/facebook/yoga/YogaMeasureFunction.kt diff --git a/java/com/facebook/yoga/YogaMeasureFunction.java b/java/com/facebook/yoga/YogaMeasureFunction.java deleted file mode 100644 index 21da35fe..00000000 --- a/java/com/facebook/yoga/YogaMeasureFunction.java +++ /dev/null @@ -1,20 +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.yoga; - -public interface YogaMeasureFunction { - /** - * Return a value created by YogaMeasureOutput.make(width, height); - */ - long measure( - YogaNode node, - float width, - YogaMeasureMode widthMode, - float height, - YogaMeasureMode heightMode); -} diff --git a/java/com/facebook/yoga/YogaMeasureFunction.kt b/java/com/facebook/yoga/YogaMeasureFunction.kt new file mode 100644 index 00000000..10b5cfc0 --- /dev/null +++ b/java/com/facebook/yoga/YogaMeasureFunction.kt @@ -0,0 +1,19 @@ +/* + * 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.yoga + +public fun interface YogaMeasureFunction { + /** Return a value created by YogaMeasureOutput.make(width, height); */ + public fun measure( + node: YogaNode, + width: Float, + widthMode: YogaMeasureMode, + height: Float, + heightMode: YogaMeasureMode + ): Long +}