Class

CanvasOp.DrawConditionally

Represents a conditional drawing block (drawConditionally).

Source set: Android
class DrawConditionally(
        val condition: RemoteBoolean,
        val childSpan: CanvasOperationBuffer.Span,
        val action: (RemoteComposeWriter, RemoteComposeCreationState) -> Unit,
    ) : CanvasOp()

Represents a conditional drawing block (drawConditionally).

Typically childSpan will be a CanvasOperationBuffer.Span, which if hasChildCommands will return false if empty.

Functions

write

Source set: Android
override fun write(writer: RemoteComposeWriter, creationState: RemoteComposeCreationState)

hasTransformsOrClips

Source set: Android
override fun hasTransformsOrClips(): Boolean

containsDrawingPrimitives

Source set: Android
override fun containsDrawingPrimitives(): Boolean

switchesCanvasOrHasCondition

Source set: Android
override fun switchesCanvasOrHasCondition(): Boolean

emitsWireCommands

Source set: Android
override fun emitsWireCommands(): Boolean

optimizeChildScopes

Source set: Android
override fun optimizeChildScopes(buffer: CanvasOperationBuffer)

shouldPrune

Source set: Android
override fun shouldPrune(buffer: CanvasOperationBuffer) = !childSpan.emitsWireCommands()

toString

Source set: Android
override fun toString(): String
Jetpack Compose beyond MaterialFree components, screens and templates for apps that don’t look like Google’s. Copy them into your app, or let your coding agent add them.Browse for free

Content updated: