BackgroundKt

Added in 1.3.0-alpha06

public final class BackgroundKt


Summary

Public methods

static final @NonNull LayoutModifier
background(
    @NonNull LayoutModifier receiver,
    @NonNull LayoutColor color,
    ModifiersBuilders.Corner corner
)

Sets the background color and clipping.

static final @NonNull LayoutModifier
backgroundColor(
    @NonNull LayoutModifier receiver,
    @NonNull LayoutColor color
)

Sets the background color to color.

static final @NonNull LayoutModifier
clip(
    @NonNull LayoutModifier receiver,
    @NonNull ModifiersBuilders.Corner corner
)

Clips the element to a rounded rectangle with corners specified in corner.

static final @NonNull LayoutModifier
clip(
    @NonNull LayoutModifier receiver,
    @Dimension(unit = 0) float cornerRadius
)

Clips the element to a rounded rectangle with four corners with cornerRadius radius.

static final @NonNull LayoutModifier
@RequiresSchemaVersion(major = 1, minor = 400)
clip(
    @NonNull LayoutModifier receiver,
    @Dimension(unit = 0) float x,
    @Dimension(unit = 0) float y
)

Clips the element to a rounded shape with x as the radius on the horizontal axis and y as the radius on the vertical axis for the four corners.

static final @NonNull LayoutModifier
@RequiresSchemaVersion(major = 1, minor = 400)
clipBottomLeft(
    @NonNull LayoutModifier receiver,
    @Dimension(unit = 0) float x,
    @Dimension(unit = 0) float y
)

Clips the bottom left corner of the element with x as the radius on the horizontal axis and y as the radius on the vertical axis.

static final @NonNull LayoutModifier
@RequiresSchemaVersion(major = 1, minor = 400)
clipBottomRight(
    @NonNull LayoutModifier receiver,
    @Dimension(unit = 0) float x,
    @Dimension(unit = 0) float y
)

Clips the bottom right corner of the element with x as the radius on the horizontal axis and y as the radius on the vertical axis.

static final @NonNull LayoutModifier
@RequiresSchemaVersion(major = 1, minor = 400)
clipTopLeft(
    @NonNull LayoutModifier receiver,
    @Dimension(unit = 0) float x,
    @Dimension(unit = 0) float y
)

Clips the top left corner of the element with x as the radius on the horizontal axis and y as the radius on the vertical axis.

static final @NonNull LayoutModifier
@RequiresSchemaVersion(major = 1, minor = 400)
clipTopRight(
    @NonNull LayoutModifier receiver,
    @Dimension(unit = 0) float x,
    @Dimension(unit = 0) float y
)

Clips the top right corner of the element with x as the radius on the horizontal axis and y as the radius on the vertical axis.

Public methods

public static final @NonNull LayoutModifier background(
    @NonNull LayoutModifier receiver,
    @NonNull LayoutColor color,
    ModifiersBuilders.Corner corner
)

Sets the background color and clipping.

Parameters
@NonNull LayoutColor color

for the background

ModifiersBuilders.Corner corner

to use for clipping the background

public static final @NonNull LayoutModifier backgroundColor(
    @NonNull LayoutModifier receiver,
    @NonNull LayoutColor color
)

Sets the background color to color.

public static final @NonNull LayoutModifier clip(
    @NonNull LayoutModifier receiver,
    @NonNull ModifiersBuilders.Corner corner
)

Clips the element to a rounded rectangle with corners specified in corner.

public static final @NonNull LayoutModifier clip(
    @NonNull LayoutModifier receiver,
    @Dimension(unit = 0) float cornerRadius
)

Clips the element to a rounded rectangle with four corners with cornerRadius radius.

@RequiresSchemaVersion(major = 1, minor = 400)
public static final @NonNull LayoutModifier clip(
    @NonNull LayoutModifier receiver,
    @Dimension(unit = 0) float x,
    @Dimension(unit = 0) float y
)

Clips the element to a rounded shape with x as the radius on the horizontal axis and y as the radius on the vertical axis for the four corners.

@RequiresSchemaVersion(major = 1, minor = 400)
public static final @NonNull LayoutModifier clipBottomLeft(
    @NonNull LayoutModifier receiver,
    @Dimension(unit = 0) float x,
    @Dimension(unit = 0) float y
)

Clips the bottom left corner of the element with x as the radius on the horizontal axis and y as the radius on the vertical axis.

@RequiresSchemaVersion(major = 1, minor = 400)
public static final @NonNull LayoutModifier clipBottomRight(
    @NonNull LayoutModifier receiver,
    @Dimension(unit = 0) float x,
    @Dimension(unit = 0) float y
)

Clips the bottom right corner of the element with x as the radius on the horizontal axis and y as the radius on the vertical axis.

@RequiresSchemaVersion(major = 1, minor = 400)
public static final @NonNull LayoutModifier clipTopLeft(
    @NonNull LayoutModifier receiver,
    @Dimension(unit = 0) float x,
    @Dimension(unit = 0) float y
)

Clips the top left corner of the element with x as the radius on the horizontal axis and y as the radius on the vertical axis.

@RequiresSchemaVersion(major = 1, minor = 400)
public static final @NonNull LayoutModifier clipTopRight(
    @NonNull LayoutModifier receiver,
    @Dimension(unit = 0) float x,
    @Dimension(unit = 0) float y
)

Clips the top right corner of the element with x as the radius on the horizontal axis and y as the radius on the vertical axis.