diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/ViewHierarchyUtil.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/ViewHierarchyUtil.java deleted file mode 100644 index b676ed160c30..000000000000 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/ViewHierarchyUtil.java +++ /dev/null @@ -1,40 +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.devsupport; - -import android.util.Pair; -import android.view.View; -import android.view.ViewGroup; -import java.util.LinkedList; -import java.util.Queue; - -/** Helper for computing information about the view hierarchy */ -class ViewHierarchyUtil { - - /** Returns the view instance and depth of the deepest leaf view from the given root view. */ - public static Pair getDeepestLeaf(View root) { - Queue> queue = new LinkedList<>(); - Pair maxPair = new Pair<>(root, 1); - - queue.add(maxPair); - while (!queue.isEmpty()) { - Pair current = queue.poll(); - if (current.second > maxPair.second) { - maxPair = current; - } - if (current.first instanceof ViewGroup) { - ViewGroup viewGroup = (ViewGroup) current.first; - Integer depth = current.second + 1; - for (int i = 0; i < viewGroup.getChildCount(); i++) { - queue.add(new Pair<>(viewGroup.getChildAt(i), depth)); - } - } - } - return maxPair; - } -}