Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
* 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.bridge.UiThreadUtil

/** Interface providing children management API for view managers of classes extending ViewGroup. */
public interface IViewGroupManager<T : View> : IViewManagerWithChildren {

/** Adds a child view into the parent at the index specified as a parameter */
public fun addView(parent: T, child: View, index: Int)

/** @return child of the parent view at the index specified as a parameter. */
public fun getChildAt(parent: T, index: Int): View?

/** Removes View from the parent View at the index specified as a parameter. */
public fun removeViewAt(parent: T, index: Int)

/** Remove all child views from the parent View. */
public fun removeAllViews(parent: T) {
UiThreadUtil.assertOnUiThread()
for (i in getChildCount(parent) - 1 downTo 0) {
removeViewAt(parent, i)
}
}

/** Return the amount of children contained by the view specified as a parameter. */
public fun getChildCount(parent: T): Int
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* LICENSE file in the root directory of this source tree.
*/

package com.facebook.react.uimanager;
package com.facebook.react.uimanager

public interface IViewManagerWithChildren {
/**
Expand All @@ -16,5 +16,5 @@ public interface IViewManagerWithChildren {
* of automatically laying out children without going through the ViewGroup's onLayout method. In
* that case, onLayout for this View type must *not* call layout on its children.
*/
boolean needsCustomLayoutForChildren();
public fun needsCustomLayoutForChildren(): Boolean
}