core-ktx / androidx.view / android.view.ViewGroup

Extensions for android.view.ViewGroup

contains

operator fun ViewGroup.contains(view: View): Boolean

Returns true if view is found in this view group.

forEach

fun ViewGroup.forEach(action: (view: View) -> Unit): Unit

Performs the given action on each view in this view group.

forEachIndexed

fun ViewGroup.forEachIndexed(action: (index: Int, view: View) -> Unit): Unit

Performs the given action on each view in this view group, providing its sequential index.

get

operator fun ViewGroup.get(index: Int): View

Returns the view at index.

isEmpty

fun ViewGroup.isEmpty(): Boolean

Returns true if this view group contains no views.

isNotEmpty

fun ViewGroup.isNotEmpty(): Boolean

Returns true if this view group contains one or more views.

iterator

operator fun ViewGroup.iterator(): MutableIterator<View>

Returns a MutableIterator over the views in this view group.

minusAssign

operator fun ViewGroup.minusAssign(view: View): Unit

Removes view from this view group.

plusAssign

operator fun ViewGroup.plusAssign(view: View): Unit

Adds view to this view group.

size

val ViewGroup.size: Int

Returns the number of views in this view group.