Join us for ⁠#Android11: The Beta Launch Show on June 3!

DrawLayerProperties

interface DrawLayerProperties
androidx.ui.core.DrawLayerProperties

A set of properties that can be modified in a DrawLayerModifier.

import androidx.ui.core.drawLayer
import androidx.ui.core.Text

Text("Hello World", drawLayer(alpha = 0.5f))

Summary

Properties

open Float

The alpha of the drawn area.

open Boolean

Set to true to clip the content to the size of the layer or false to allow drawing outside of the layer's bounds.

open Boolean

Clips the content to the outlineShape.

open Float

Sets the Z coordinate of the layer in pixels.

open Shape?

The Shape of the layer.

open Float

The rotation of the contents around the horizontal axis in degrees.

open Float

The rotation of the contents around the vertical axis in degrees.

open Float

The rotation of the contents around the Z axis in degrees.

open Float

The horizontal scale of the drawn area.

open Float

The vertical scale of the drawn area.

Properties

alpha

open val alpha: Float

The alpha of the drawn area. Setting this to something other than 1 will cause the drawn contents to be translucent and setting it to 0 will cause it to be fully invisible.

clipToBounds

open val clipToBounds: Boolean

Set to true to clip the content to the size of the layer or false to allow drawing outside of the layer's bounds. This a convenient way to clip to the bounding rectangle. When clipToOutline is true the contents are clipped by both the bounding rectangle and the outlineShape.

See Also

clipToOutline

open val clipToOutline: Boolean

Clips the content to the outlineShape. If outlineShape is null, no clipping will occur. When both clipToBounds and clipToOutline are true, the content will be clipped by both the bounding rectangle and the outlineShape.

elevation

open val elevation: Float

Sets the Z coordinate of the layer in pixels. With outlineShape set, this will cause a shadow. Varying the elevation can also change the order in which layers are drawn.

outlineShape

open val outlineShape: Shape?

The Shape of the layer. When elevation is non-zero and outlineShape is non-null, a shadow is produced. When clipToOutline is true and outlineShape is non-null, the contents will be clipped to the outline.

rotationX

open val rotationX: Float

The rotation of the contents around the horizontal axis in degrees.

rotationY

open val rotationY: Float

The rotation of the contents around the vertical axis in degrees.

rotationZ

open val rotationZ: Float

The rotation of the contents around the Z axis in degrees.

scaleX

open val scaleX: Float

The horizontal scale of the drawn area. This would typically default to 1.

scaleY

open val scaleY: Float

The vertical scale of the drawn area. This would typically default to 1.