ModifiersBuilders.Modifiers


@RequiresSchemaVersion(major = 1, minor = 0)
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 functions

ModifiersBuilders.Background?

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

ModifiersBuilders.Border?

Gets the border of the modified element.

ModifiersBuilders.Clickable?

Gets the clickable property of the modified element.

ModifiersBuilders.AnimatedVisibility?

Gets the content transition of an element.

ModifiersBuilders.ElementMetadata?

Gets metadata about an element.

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.

ModifiersBuilders.Padding?

Gets the padding of the modified element.

ModifiersBuilders.Semantics?

Gets the semantics of the modified element.

ModifiersBuilders.Transformation?

Gets the transformation applied to the element post-layout.

TypeBuilders.BoolProp

Gets whether the attached element is visible, or hidden.

String

Public functions

getBackground

Added in 1.0.0
fun getBackground(): ModifiersBuilders.Background?

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

getBorder

Added in 1.0.0
fun getBorder(): ModifiersBuilders.Border?

Gets the border of the modified element.

getClickable

Added in 1.0.0
fun getClickable(): ModifiersBuilders.Clickable?

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
fun getContentUpdateAnimation(): ModifiersBuilders.AnimatedVisibility?

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
fun getMetadata(): ModifiersBuilders.ElementMetadata?

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
fun getOpacity(): 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.

getPadding

Added in 1.0.0
fun getPadding(): ModifiersBuilders.Padding?

Gets the padding of the modified element.

getSemantics

Added in 1.0.0
fun getSemantics(): ModifiersBuilders.Semantics?

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
fun getTransformation(): ModifiersBuilders.Transformation?

Gets the transformation applied to the element post-layout.

isVisible

Added in 1.1.0
@ProtoLayoutExperimental
fun isVisible(): TypeBuilders.BoolProp

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

fun toString(): String