OpacityKt

Added in 1.3.0-alpha07

public final class OpacityKt


Summary

Public methods

static final @NonNull LayoutModifier
@RequiresSchemaVersion(major = 1, minor = 400)
opacity(
    @NonNull LayoutModifier receiver,
    @FloatRange(from = 0.0, to = 1.0) float staticValue,
    DynamicBuilders.DynamicFloat dynamicValue
)

Adds a modifier to specify 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.

Public methods

@RequiresSchemaVersion(major = 1, minor = 400)
public static final @NonNull LayoutModifier opacity(
    @NonNull LayoutModifier receiver,
    @FloatRange(from = 0.0, to = 1.0) float staticValue,
    DynamicBuilders.DynamicFloat dynamicValue
)

Adds a modifier to specify 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.

Parameters
@FloatRange(from = 0.0, to = 1.0) float staticValue

The static value for opacity. This value will be used if dynamicValue is null, or if can't be resolved.

DynamicBuilders.DynamicFloat dynamicValue

The dynamic value for opacity. This can be used to change the opacity of the element dynamically (without changing the layout definition). To create a smooth transition for the dynamic change, you can use one of DynamicFloat.animate methods.