ModifiersBuilders.Modifiers.Builder
public final class ModifiersBuilders.Modifiers.Builder
Builder for Modifiers
Summary
Public methods
build
public @NonNull ModifiersBuilders.Modifiers build()
Builds an instance from accumulated values.
setBackground
@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
@RequiresSchemaVersion(major = 1, minor = 0)
public @NonNull ModifiersBuilders.Modifiers.Builder setBorder(@NonNull ModifiersBuilders.Border border)
Sets the border of the modified element.
setClickable
@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
@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
@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
@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
@RequiresSchemaVersion(major = 1, minor = 0)
public @NonNull ModifiersBuilders.Modifiers.Builder setPadding(@NonNull ModifiersBuilders.Padding padding)
Sets the padding of the modified element.
setSemantics
@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
@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
@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).