Class

RemoteDrawScope

A remote-compatible drawing scope for RemoteCompose.

Source set: Android
public open class RemoteDrawScope internal constructor(
    @get:RestrictTo(RestrictTo.Scope.LIBRARY_GROUP) public val remoteCanvas: RemoteCanvas
) : RemoteStateScope

A remote-compatible drawing scope for RemoteCompose. Unlike DrawScope, this class uses remote types consistently and does not attempt to implement the standard DrawScope interface to avoid API incompatibilities.

Properties

remoteComposeCreationState

Source set: Android
public val remoteComposeCreationState: RemoteComposeCreationState

width

Source set: Android
public open val width: RemoteFloat

The width of the drawing area as a RemoteFloat.

height

Source set: Android
public open val height: RemoteFloat

The height of the drawing area as a RemoteFloat.

center

Source set: Android
public val center: RemoteOffset

The center of the drawing area as a RemoteOffset.

size

Source set: Android
public val size: RemoteSize

The size of the drawing area as a RemoteSize.

remote

Source set: Android
public val remote: RemoteAccess = RemoteAccess(this)

Access to remote-specific utilities like time and animations.

Functions

usePaint

Source set: Android
public fun usePaint(paint: RemotePaint, block: () -> Unit)

drawRect

Source set: Android
public fun drawRect(
        paint: RemotePaint?,
        topLeft: RemoteOffset = RemoteOffset.Zero,
        size: RemoteSize = [email protected],
    )

Draws a rectangle with the given paint, topLeft offset, and size.

Parameters

paint The RemotePaint to use for drawing the rectangle.
topLeft The top left offset of the rectangle.
size The size of the rectangle.

drawRoundRect

Source set: Android
public fun drawRoundRect(
        paint: RemotePaint?,
        topLeft: RemoteOffset = RemoteOffset.Zero,
        size: RemoteSize = [email protected],
        cornerRadius: RemoteOffset = RemoteOffset.Zero,
    )

drawCircle

Source set: Android
public fun drawCircle(
        paint: RemotePaint?,
        radius: RemoteFloat,
        center: RemoteOffset = [email protected],
    )

Draws a circle.

drawOval

Source set: Android
public fun drawOval(
        paint: RemotePaint?,
        topLeft: RemoteOffset = RemoteOffset.Zero,
        size: RemoteSize = [email protected],
    )

drawArc

Source set: Android
public fun drawArc(
        paint: RemotePaint?,
        startAngle: RemoteFloat,
        sweepAngle: RemoteFloat,
        useCenter: Boolean,
        topLeft: RemoteOffset = RemoteOffset.Zero,
        size: RemoteSize = [email protected],
    )

drawLine

Source set: Android
public fun drawLine(paint: RemotePaint?, start: RemoteOffset, end: RemoteOffset)

Draws a line.

drawTextOnCircle

Source set: Android
public fun drawTextOnCircle(
        text: RemoteString,
        centerX: RemoteFloat,
        centerY: RemoteFloat,
        radius: RemoteFloat,
        startAngle: RemoteFloat,
        warpRadiusOffset: RemoteFloat,
        paint: RemotePaint? = null,
        alignment: CircularAlignment = CircularAlignment.Center,
        placement: CircularPlacement = CircularPlacement.Outside,
    )

Draws text along a circle.

Parameters

text The text to draw.
centerX The x-coordinate of the circle's center.
centerY The y-coordinate of the circle's center.
radius The radius of the circle.
startAngle The starting angle for the text.
warpRadiusOffset The offset of the text from the circle.
paint Paint of the text.
alignment The alignment of the text relative to start.
placement The placement inside or outside the circle.

Members

CircularAlignment

Source set: Android
public enum class CircularAlignment {
        Start,
        Center,
        End;

        internal fun toCore(): DrawTextOnCircle.Alignment =
            when (this) {
                Start -> DrawTextOnCircle.Alignment.START
                Center -> DrawTextOnCircle.Alignment.CENTER
                End -> DrawTextOnCircle.Alignment.END
            }
    }

Alignment of text along a circular path.

Members

Start

Source set: Android
Start

Center

Source set: Android
Center

End

Source set: Android
End

CircularPlacement

Source set: Android
public enum class CircularPlacement {
        Outside,
        Inside;

        internal fun toCore(): DrawTextOnCircle.Placement =
            when (this) {
                Outside -> DrawTextOnCircle.Placement.OUTSIDE
                Inside -> DrawTextOnCircle.Placement.INSIDE
            }
    }

Placement of text relative to the circular path.

Members

Outside

Source set: Android
Outside

Inside

Source set: Android
Inside

Content updated: