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
This commit is contained in:
David Vacca
2022-11-21 12:27:24 -08:00
committed by Facebook GitHub Bot
parent 78e7311cd5
commit c0a0481656
@@ -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<T extends View> 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);
}