ModifiersBuilders.Modifiers.Builder


class ModifiersBuilders.Modifiers.Builder


Builder for Modifiers

Summary

Public constructors

Creates an instance of Builder.

Public functions

ModifiersBuilders.Modifiers

Builds an instance from accumulated values.

ModifiersBuilders.Modifiers.Builder
@RequiresSchemaVersion(major = 1, minor = 0)
setBackground(background: ModifiersBuilders.Background)

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

ModifiersBuilders.Modifiers.Builder
@RequiresSchemaVersion(major = 1, minor = 0)
setBorder(border: ModifiersBuilders.Border)

Sets the border of the modified element.

ModifiersBuilders.Modifiers.Builder
@RequiresSchemaVersion(major = 1, minor = 0)
setClickable(clickable: ModifiersBuilders.Clickable)

Sets the clickable property of the modified element.

ModifiersBuilders.Modifiers.Builder

Sets the content transition of an element.

ModifiersBuilders.Modifiers.Builder

Sets metadata about an element.

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

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.

ModifiersBuilders.Modifiers.Builder
@RequiresSchemaVersion(major = 1, minor = 0)
setPadding(padding: ModifiersBuilders.Padding)

Sets the padding of the modified element.

ModifiersBuilders.Modifiers.Builder
@RequiresSchemaVersion(major = 1, minor = 0)
setSemantics(semantics: ModifiersBuilders.Semantics)

Sets the semantics of the modified element.

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

Sets the transformation applied to the element post-layout.

ModifiersBuilders.Modifiers.Builder

Sets whether the attached element is visible, or hidden.

Public constructors

Builder

Added in 1.0.0
Builder()

Creates an instance of Builder.

Public functions

build

Added in 1.0.0
fun build(): ModifiersBuilders.Modifiers

Builds an instance from accumulated values.

setBackground

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

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

setBorder

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

Sets the border of the modified element.

setClickable

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

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
fun setContentUpdateAnimation(
    contentUpdateAnimation: ModifiersBuilders.AnimatedVisibility
): ModifiersBuilders.Modifiers.Builder

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)
fun setMetadata(metadata: ModifiersBuilders.ElementMetadata): ModifiersBuilders.Modifiers.Builder

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)
fun setOpacity(opacity: TypeBuilders.FloatProp): ModifiersBuilders.Modifiers.Builder

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)
fun setPadding(padding: ModifiersBuilders.Padding): ModifiersBuilders.Modifiers.Builder

Sets the padding of the modified element.

setSemantics

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

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)
fun setTransformation(transformation: ModifiersBuilders.Transformation): ModifiersBuilders.Modifiers.Builder

Sets the transformation applied to the element post-layout.

setVisible

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

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).