ModifiersBuilders.Modifiers.Builder


public final class ModifiersBuilders.Modifiers.Builder


Builder for Modifiers

Summary

Public constructors

Creates an instance of Builder.

Public methods

@NonNull ModifiersBuilders.Modifiers

Builds an instance from accumulated values.

@NonNull ModifiersBuilders.Modifiers.Builder

Sets the background (with optional corner radius) of the modified element.

@NonNull ModifiersBuilders.Modifiers.Builder

Sets the border of the modified element.

@NonNull ModifiersBuilders.Modifiers.Builder

Sets the clickable property of the modified element.

@NonNull ModifiersBuilders.Modifiers.Builder

Sets the content transition of an element.

@NonNull ModifiersBuilders.Modifiers.Builder

Sets metadata about an element.

@NonNull ModifiersBuilders.Modifiers.Builder
@RequiresSchemaVersion(major = 1, minor = 400)
setOpacity(@NonNull TypeBuilders.FloatProp opacity)

Sets the opacity of the element with a value from 0 to 1, where 0 means the element is completely transparent and 1 means the element is completely opaque.

@NonNull ModifiersBuilders.Modifiers.Builder

Sets the padding of the modified element.

@NonNull ModifiersBuilders.Modifiers.Builder

Sets the semantics of the modified element.

@NonNull ModifiersBuilders.Modifiers.Builder
@RequiresSchemaVersion(major = 1, minor = 400)
setTransformation(
    @NonNull ModifiersBuilders.Transformation transformation
)

Sets the transformation applied to the element post-layout.

@NonNull ModifiersBuilders.Modifiers.Builder

Sets whether the attached element is visible, or hidden.

Public constructors

Builder

Added in 1.0.0
public Builder()

Creates an instance of Builder.

Public methods

build

Added in 1.0.0
public @NonNull ModifiersBuilders.Modifiers build()

Builds an instance from accumulated values.

setBackground

Added in 1.0.0
@RequiresSchemaVersion(major = 1, minor = 0)
public @NonNull ModifiersBuilders.Modifiers.Builder setBackground(@NonNull ModifiersBuilders.Background background)

Sets the background (with optional corner radius) of the modified element.

setBorder

Added in 1.0.0
@RequiresSchemaVersion(major = 1, minor = 0)
public @NonNull ModifiersBuilders.Modifiers.Builder setBorder(@NonNull ModifiersBuilders.Border border)

Sets the border of the modified element.

setClickable

Added in 1.0.0
@RequiresSchemaVersion(major = 1, minor = 0)
public @NonNull ModifiersBuilders.Modifiers.Builder setClickable(@NonNull ModifiersBuilders.Clickable clickable)

Sets the clickable property of the modified element. It allows its wrapped element to have actions associated with it, which will be executed when the element is tapped.

setContentUpdateAnimation

Added in 1.0.0
@RequiresSchemaVersion(major = 1, minor = 200)
@ProtoLayoutExperimental
public @NonNull ModifiersBuilders.Modifiers.Builder setContentUpdateAnimation(
    @NonNull ModifiersBuilders.AnimatedVisibility contentUpdateAnimation
)

Sets the content transition of an element. Any update to the element or its children will trigger this animation for this element and everything underneath it.

setMetadata

Added in 1.0.0
@RequiresSchemaVersion(major = 1, minor = 0)
public @NonNull ModifiersBuilders.Modifiers.Builder setMetadata(@NonNull ModifiersBuilders.ElementMetadata metadata)

Sets metadata about an element. For use by libraries building higher-level components only. This can be used to track component metadata.

setOpacity

Added in 1.2.0
@RequiresSchemaVersion(major = 1, minor = 400)
public @NonNull ModifiersBuilders.Modifiers.Builder setOpacity(@NonNull TypeBuilders.FloatProp opacity)

Sets the opacity of the element with a value from 0 to 1, where 0 means the element is completely transparent and 1 means the element is completely opaque. Dynamic value is supported.

setPadding

Added in 1.0.0
@RequiresSchemaVersion(major = 1, minor = 0)
public @NonNull ModifiersBuilders.Modifiers.Builder setPadding(@NonNull ModifiersBuilders.Padding padding)

Sets the padding of the modified element.

setSemantics

Added in 1.0.0
@RequiresSchemaVersion(major = 1, minor = 0)
public @NonNull ModifiersBuilders.Modifiers.Builder setSemantics(@NonNull ModifiersBuilders.Semantics semantics)

Sets the semantics of the modified element. This can be used to add metadata to the modified element (eg. screen reader content descriptions).

setTransformation

Added in 1.2.0
@RequiresSchemaVersion(major = 1, minor = 400)
public @NonNull ModifiersBuilders.Modifiers.Builder setTransformation(
    @NonNull ModifiersBuilders.Transformation transformation
)

Sets the transformation applied to the element post-layout.

setVisible

Added in 1.1.0
@RequiresSchemaVersion(major = 1, minor = 300)
@ProtoLayoutExperimental
public @NonNull ModifiersBuilders.Modifiers.Builder setVisible(@NonNull TypeBuilders.BoolProp visible)

Sets whether the attached element is visible, or hidden. If the element is hidden, then it will still consume space in the layout, but will not render any contents, nor will any children render any contents. Defaults to visible.

Note that a hidden element also cannot be clickable (i.e. a Clickable modifier would be ignored).

This field is bindable and will use the dynamic value (if set).