LayoutModifier.Element


public interface LayoutModifier.Element extends LayoutModifier


A single element contained within a LayoutModifier chain.

Summary

Public methods

default @NonNull R
<R extends Object> foldIn(
    @NonNull R initial,
    @NonNull Function2<@NonNull R, @NonNull LayoutModifier.Element, @NonNull R> operation
)

Accumulates a value starting with initial and applying operation to the current value and each element from outside in.

Inherited methods

From androidx.wear.protolayout.modifiers.LayoutModifier
default @NonNull LayoutModifier

Concatenates this modifier with another.

Public methods

foldIn

Added in 1.3.0-alpha06
default @NonNull R <R extends Object> foldIn(
    @NonNull R initial,
    @NonNull Function2<@NonNull R, @NonNull LayoutModifier.Element, @NonNull R> operation
)

Accumulates a value starting with initial and applying operation to the current value and each element from outside in.

Elements wrap one another in a chain from left to right; an Element that appears to the left of another in a + expression or in operation's parameter order affects all of the elements that appear after it. foldIn may be used to accumulate a value starting from the parent or head of the modifier chain to the final wrapped child.