androidx.xr.compose.subspace.draw

Classes

SpatialFeatheringEffect

Base class for feathering effects.

Top-level functions summary

SpatialFeatheringEffect
spatialSmoothFeatheringEffect(horizontal: Dp, vertical: Dp)

Defines a spatialSmoothFeatheringEffect using Dp.

SpatialFeatheringEffect
spatialSmoothFeatheringEffect(horizontal: Float, vertical: Float)

Defines a spatialSmoothFeatheringEffect using pixels.

SpatialFeatheringEffect
spatialSmoothFeatheringEffect(
    horizontalPercent: @IntRange(from = 0, to = 50) Int,
    verticalPercent: @IntRange(from = 0, to = 50) Int
)

Defines a spatialSmoothFeatheringEffect based on the percent width and height of the layout.

Extension functions summary

SubspaceModifier
SubspaceModifier.alpha(alpha: @FloatRange(from = 0.0, to = 1.0) Float)

Sets the opacity of this element (and its children) to a value between 0..1.

SubspaceModifier
SubspaceModifier.scale(
    scale: @FloatRange(from = 0.0, fromInclusive = false) Float
)

Scale the contents of the composable by the scale factor along horizontal, vertical, and depth axes.

Top-level functions

spatialSmoothFeatheringEffect

fun spatialSmoothFeatheringEffect(horizontal: Dp, vertical: Dp): SpatialFeatheringEffect

Defines a spatialSmoothFeatheringEffect using Dp.

Parameters
horizontal: Dp

Non-negative Dp value to feather horizontal edges. Value will be capped at 50% of canvas width if it is too large.

vertical: Dp

Non-negative Dp value to feather vertical edges. Value will be capped at 50% of canvas height if it is too large.

spatialSmoothFeatheringEffect

fun spatialSmoothFeatheringEffect(horizontal: Float, vertical: Float): SpatialFeatheringEffect

Defines a spatialSmoothFeatheringEffect using pixels.

Parameters
horizontal: Float

Non-negative pixels value to feather horizontal edges. Value will be capped at 50% of canvas width if it is too large.

vertical: Float

Non-negative pixels value to feather vertical edges. Value will be capped at 50% of canvas height if it is too large.

spatialSmoothFeatheringEffect

fun spatialSmoothFeatheringEffect(
    horizontalPercent: @IntRange(from = 0, to = 50) Int,
    verticalPercent: @IntRange(from = 0, to = 50) Int
): SpatialFeatheringEffect

Defines a spatialSmoothFeatheringEffect based on the percent width and height of the layout.

Parameters
horizontalPercent: @IntRange(from = 0, to = 50) Int

Value to feather horizontal edges. A value of 5 represents 5% of the width of the visible canvas. Accepted value range is 0 - 50 percent.

verticalPercent: @IntRange(from = 0, to = 50) Int

Value to feather vertical edges. A value of 5 represents 5% of the height the visible canvas. Accepted value range is 0 - 50 percent.

Extension functions

SubspaceModifier.alpha

fun SubspaceModifier.alpha(alpha: @FloatRange(from = 0.0, to = 1.0) Float): SubspaceModifier

Sets the opacity of this element (and its children) to a value between 0..1. An alpha value of 0.0f means fully transparent while a value of 1.0f is completely opaque. Elements with semi-transparent alpha values (> 0.0 but < 1.0f) will be rendered using alpha-blending.

Parameters
alpha: @FloatRange(from = 0.0, to = 1.0) Float

the opacity of this element (and its children). Must be a value between 0 and 1, inclusive. Values < 0 or > 1 will be clamped.

SubspaceModifier.scale

fun SubspaceModifier.scale(
    scale: @FloatRange(from = 0.0, fromInclusive = false) Float
): SubspaceModifier

Scale the contents of the composable by the scale factor along horizontal, vertical, and depth axes. Scaling does not change the measured size of the composable content during layout. Measured size of SubspaceComposable elements can be controlled using size Modifiers. Scale factor should be a positive number.

Parameters
scale: @FloatRange(from = 0.0, fromInclusive = false) Float

Multiplier to scale content along vertical, horizontal, depth axes.