ViewGroupKt

public final class ViewGroupKt


Summary

Public fields

final @NonNull Sequence<@NonNull View>

Returns a Sequence over the immediate child views in this view group.

final @NonNull Sequence<@NonNull View>

Returns a Sequence over the child views in this view group recursively.

final int

Returns the number of views in this view group.

Public methods

static final boolean

Returns true if view is found in this view group.

static final void
ViewGroupKt.forEach(
    @NonNull ViewGroup receiver,
    @NonNull Function1<@NonNull ViewUnit> action
)

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

static final void
ViewGroupKt.forEachIndexed(
    @NonNull ViewGroup receiver,
    @NonNull Function2<@NonNull Integer, @NonNull ViewUnit> action
)

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

static final @NonNull View
ViewGroupKt.get(@NonNull ViewGroup receiver, int index)

Returns the view at index.

static final boolean

Returns true if this view group contains no views.

static final boolean

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

static final @NonNull Iterator<@NonNull View>

Returns a MutableIterator over the views in this view group.

static final void

Removes view from this view group.

static final void

Adds view to this view group.

static final void
ViewGroupKt.setMargins(
    @NonNull ViewGroup.MarginLayoutParams receiver,
    @Px int size
)

Sets the margins in the ViewGroup's MarginLayoutParams.

static final void
ViewGroupKt.updateMargins(
    @NonNull ViewGroup.MarginLayoutParams receiver,
    @Px int left,
    @Px int top,
    @Px int right,
    @Px int bottom
)

Updates the margins in the ViewGroup's ViewGroup.MarginLayoutParams.

static final @RequiresApi(value = "17") void
ViewGroupKt.updateMarginsRelative(
    @NonNull ViewGroup.MarginLayoutParams receiver,
    @Px int start,
    @Px int top,
    @Px int end,
    @Px int bottom
)

Updates the relative margins in the ViewGroup's MarginLayoutParams.

Public fields

children

@NonNull
public final @NonNull Sequence<@NonNull Viewchildren

Returns a Sequence over the immediate child views in this view group.

descendants

@NonNull
public final @NonNull Sequence<@NonNull Viewdescendants

Returns a Sequence over the child views in this view group recursively. This performs a depth-first traversal. A view with no children will return a zero-element sequence.

size

@NonNull
public final int size

Returns the number of views in this view group.

Public methods

ViewGroupKt.contains

@NonNull
public static final boolean ViewGroupKt.contains(@NonNull ViewGroup receiver, @NonNull View view)

Returns true if view is found in this view group.

ViewGroupKt.forEach

@NonNull
public static final void ViewGroupKt.forEach(
    @NonNull ViewGroup receiver,
    @NonNull Function1<@NonNull ViewUnit> action
)

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

ViewGroupKt.forEachIndexed

@NonNull
public static final void ViewGroupKt.forEachIndexed(
    @NonNull ViewGroup receiver,
    @NonNull Function2<@NonNull Integer, @NonNull ViewUnit> action
)

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

ViewGroupKt.get

@NonNull
public static final View ViewGroupKt.get(@NonNull ViewGroup receiver, int index)

Returns the view at index.

Throws
kotlin.IndexOutOfBoundsException

if index is less than 0 or greater than or equal to the count.

ViewGroupKt.isEmpty

@NonNull
public static final boolean ViewGroupKt.isEmpty(@NonNull ViewGroup receiver)

Returns true if this view group contains no views.

ViewGroupKt.isNotEmpty

@NonNull
public static final boolean ViewGroupKt.isNotEmpty(@NonNull ViewGroup receiver)

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

ViewGroupKt.iterator

@NonNull
public static final Iterator<@NonNull ViewViewGroupKt.iterator(@NonNull ViewGroup receiver)

Returns a MutableIterator over the views in this view group.

ViewGroupKt.minusAssign

@NonNull
public static final void ViewGroupKt.minusAssign(@NonNull ViewGroup receiver, @NonNull View view)

Removes view from this view group.

ViewGroupKt.plusAssign

@NonNull
public static final void ViewGroupKt.plusAssign(@NonNull ViewGroup receiver, @NonNull View view)

Adds view to this view group.

ViewGroupKt.setMargins

@NonNull
public static final void ViewGroupKt.setMargins(
    @NonNull ViewGroup.MarginLayoutParams receiver,
    @Px int size
)

Sets the margins in the ViewGroup's MarginLayoutParams. This version of the method sets all axes to the provided size.

See also
setMargins

ViewGroupKt.updateMargins

@NonNull
public static final void ViewGroupKt.updateMargins(
    @NonNull ViewGroup.MarginLayoutParams receiver,
    @Px int left,
    @Px int top,
    @Px int right,
    @Px int bottom
)

Updates the margins in the ViewGroup's ViewGroup.MarginLayoutParams. This version of the method allows using named parameters to just set one or more axes.

See also
setMargins

ViewGroupKt.updateMarginsRelative

@RequiresApi(value = "17")
@NonNull
public static final @RequiresApi(value = "17") void ViewGroupKt.updateMarginsRelative(
    @NonNull ViewGroup.MarginLayoutParams receiver,
    @Px int start,
    @Px int top,
    @Px int end,
    @Px int bottom
)

Updates the relative margins in the ViewGroup's MarginLayoutParams. This version of the method allows using named parameters to just set one or more axes.

See also
setMargins