From c0a04816564f3d307733eb2d139d15bb44c9178c Mon Sep 17 00:00:00 2001 From: David Vacca Date: Mon, 21 Nov 2022 12:27:24 -0800 Subject: [PATCH] Introduce IViewGroupManager Summary: In this diff I'm introducing IViewGroupManager to extract methods required to add/remove views from a viewGroup This will be used by ViewManagers that require to add views but don't depend on ViewGroupmanager changelog: [internal] internal Reviewed By: javache Differential Revision: D41386920 fbshipit-source-id: a7d893d92d0f12766dcc71dfd1b22539c3b9687d --- .../react/uimanager/IViewGroupManager.java | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 ReactAndroid/src/main/java/com/facebook/react/uimanager/IViewGroupManager.java diff --git a/ReactAndroid/src/main/java/com/facebook/react/uimanager/IViewGroupManager.java b/ReactAndroid/src/main/java/com/facebook/react/uimanager/IViewGroupManager.java new file mode 100644 index 00000000000..95b2531de41 --- /dev/null +++ b/ReactAndroid/src/main/java/com/facebook/react/uimanager/IViewGroupManager.java @@ -0,0 +1,26 @@ +/* + * 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; + +/** Interface providing children management API for view managers of classes extending ViewGroup. */ +public interface IViewGroupManager extends IViewManagerWithChildren { + + /** Adds a child view into the parent at the index specified as a parameter */ + void addView(T parent, View child, int index); + + /** @return child of the parent view at the index specified as a parameter. */ + View getChildAt(T parent, int index); + + /** Removes View from the parent View at the index specified as a parameter. */ + void removeViewAt(T parent, int index); + + /** Return the amount of children contained by the view specified as a parameter. */ + int getChildCount(T parent); +}