From e5e8e637db69b0dc2d71189f235cfa696ee308ed Mon Sep 17 00:00:00 2001 From: David Vacca Date: Thu, 9 Oct 2025 14:49:30 -0700 Subject: [PATCH] Delete LayoutDirectionUtil from fbsource Summary: LayoutDirectionUtil is part of legacy architecutre, in this diff I'm deleting it from fbsource changelog: [internal] internal Reviewed By: shwanton, cortinico Differential Revision: D83984648 fbshipit-source-id: 161e4347ccab160fb1be66cba05f9474c0ad3b72 --- .../react/uimanager/LayoutDirectionUtil.kt | 36 ------------------- .../uimanager/NativeViewHierarchyManager.java | 2 -- 2 files changed, 38 deletions(-) delete mode 100644 packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/LayoutDirectionUtil.kt diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/LayoutDirectionUtil.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/LayoutDirectionUtil.kt deleted file mode 100644 index 0f8c0ff3861..00000000000 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/LayoutDirectionUtil.kt +++ /dev/null @@ -1,36 +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 android.view.View -import com.facebook.react.common.annotations.internal.LegacyArchitecture -import com.facebook.react.common.annotations.internal.LegacyArchitectureLogLevel -import com.facebook.react.common.annotations.internal.LegacyArchitectureLogger -import com.facebook.yoga.YogaDirection - -@LegacyArchitecture(logLevel = LegacyArchitectureLogLevel.ERROR) -@Deprecated( - message = "This class is part of Legacy Architecture and will be removed in a future release", - level = DeprecationLevel.WARNING, -) -internal object LayoutDirectionUtil { - init { - LegacyArchitectureLogger.assertLegacyArchitecture( - "LayoutDirectionUtil", - LegacyArchitectureLogLevel.ERROR, - ) - } - - @JvmStatic - fun toAndroidFromYoga(direction: YogaDirection): Int = - when (direction) { - YogaDirection.LTR -> View.LAYOUT_DIRECTION_LTR - YogaDirection.RTL -> View.LAYOUT_DIRECTION_RTL - else -> View.LAYOUT_DIRECTION_INHERIT - } -} diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/NativeViewHierarchyManager.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/NativeViewHierarchyManager.java index 2063e79fc67..8ff0580e36c 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/NativeViewHierarchyManager.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/NativeViewHierarchyManager.java @@ -188,8 +188,6 @@ public class NativeViewHierarchyManager { try { View viewToUpdate = resolveView(tag); - viewToUpdate.setLayoutDirection(LayoutDirectionUtil.toAndroidFromYoga(layoutDirection)); - // Even though we have exact dimensions, we still call measure because some platform views // (e.g. // Switch) assume that method will always be called before onLayout and onDraw. They use it to