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
ViewGroupKt.contains(ViewGroup receiver, View view)

Returns true if view is found in this view group.

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

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

static final void
ViewGroupKt.forEachIndexed(
    ViewGroup receiver,
    Function2<IntegerViewUnit> action
)

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

static final @NonNull View
ViewGroupKt.get(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(
    ViewGroup.MarginLayoutParams receiver,
    @Px int size
)

Sets the margins in the ViewGroup's MarginLayoutParams.

static final void
ViewGroupKt.updateMargins(
    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(
    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

public final @NonNull Sequence<@NonNull Viewchildren

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

descendants

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

public final int size

Returns the number of views in this view group.

Public methods

ViewGroupKt.contains

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

Returns true if view is found in this view group.

ViewGroupKt.forEach

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

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

ViewGroupKt.forEachIndexed

public static final void ViewGroupKt.forEachIndexed(
    ViewGroup receiver,
    Function2<IntegerViewUnit> action
)

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

ViewGroupKt.get