ModifiersBuilders.Modifiers


@RequiresSchemaVersion(major = 1, minor = 0)
public final class ModifiersBuilders.Modifiers


Modifiers for an element. These may change the way they are drawn (e.g. or Background), or change their behaviour (e.g. Clickable, or ).

Summary

Nested types

Builder for Modifiers

Public methods

@Nullable ModifiersBuilders.Background

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

@Nullable ModifiersBuilders.Border

Gets the border of the modified element.

@Nullable ModifiersBuilders.Clickable

Gets the clickable property of the modified element.

@Nullable ModifiersBuilders.AnimatedVisibility

Gets the content transition of an element.

@Nullable ModifiersBuilders.ElementMetadata

Gets metadata about an element.

@Nullable TypeBuilders.FloatProp

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

@Nullable ModifiersBuilders.Padding

Gets the padding of the modified element.

@Nullable ModifiersBuilders.Semantics

Gets the semantics of the modified element.

@Nullable ModifiersBuilders.Transformation

Gets the transformation applied to the element post-layout.

@NonNull TypeBuilders.BoolProp

Gets whether the attached element is visible, or hidden.

@NonNull String

Public methods

getBackground

Added in 1.0.0
public @Nullable ModifiersBuilders.Background getBackground()

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

getBorder

Added in 1.0.0
public @Nullable ModifiersBuilders.Border getBorder()

Gets the border of the modified element.

getClickable

Added in 1.0.0
public @Nullable ModifiersBuilders.Clickable getClickable()

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

getContentUpdateAnimation

Added in 1.0.0
@ProtoLayoutExperimental
public @Nullable ModifiersBuilders.AnimatedVisibility getContentUpdateAnimation()

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

getMetadata

Added in 1.0.0
public @Nullable ModifiersBuilders.ElementMetadata getMetadata()

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

getOpacity

Added in 1.2.0
public @Nullable TypeBuilders.FloatProp getOpacity()

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

getPadding

Added in 1.0.0
public @Nullable ModifiersBuilders.Padding getPadding()

Gets the padding of the modified element.

getSemantics

Added in 1.0.0
public @Nullable ModifiersBuilders.Semantics getSemantics()

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

getTransformation

Added in 1.2.0
public @Nullable ModifiersBuilders.Transformation getTransformation()

Gets the transformation applied to the element post-layout.

isVisible

Added in 1.1.0
@ProtoLayoutExperimental
public @NonNull TypeBuilders.BoolProp isVisible()

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

toString

public @NonNull String toString()