RemoteImageVector.Builder

class RemoteImageVector.Builder


Builder used to construct a Vector graphic tree. This is useful for caching the result of expensive operations used to construct a vector graphic for compose. For example, the vector graphic could be serialized and downloaded from a server and represented internally in a ImageVector before it is composed through The generated ImageVector is recommended to be memoized across composition calls to avoid doing redundant work

Summary

Public constructors

Builder(
    viewportWidth: RemoteFloat,
    viewportHeight: RemoteFloat,
    tintColor: RemoteColor,
    name: String,
    tintBlendMode: BlendMode,
    autoMirror: Boolean
)

Public functions

RemoteImageVector

Construct a ImageVector.

Extension functions

RemoteImageVector.Builder
RemoteImageVector.Builder.path(
    name: String,
    fill: Brush?,
    fillAlpha: RemoteFloat,
    stroke: Brush?,
    strokeAlpha: RemoteFloat,
    strokeLineWidth: RemoteFloat,
    strokeLineCap: StrokeCap,
    strokeLineJoin: StrokeJoin,
    strokeLineMiter: RemoteFloat,
    pathFillType: PathFillType,
    pathBuilder: RemotePathBuilder.() -> Unit
)

DSL extension for adding a RemoteVectorPath to this.

Public constructors

Builder

Added in 1.0.0-alpha07
Builder(
    viewportWidth: RemoteFloat,
    viewportHeight: RemoteFloat,
    tintColor: RemoteColor,
    name: String = DefaultGroupName,
    tintBlendMode: BlendMode = BlendMode.SrcIn,
    autoMirror: Boolean = false
)

Public functions

build

Added in 1.0.0-alpha07
fun build(): RemoteImageVector

Construct a ImageVector. This concludes the creation process of a ImageVector graphic This builder cannot be re-used to create additional ImageVector instances

Returns
RemoteImageVector

The newly created ImageVector instance

Extension functions

fun RemoteImageVector.Builder.path(
    name: String = DefaultPathName,
    fill: Brush? = null,
    fillAlpha: RemoteFloat = 1.0f.rf,
    stroke: Brush? = null,
    strokeAlpha: RemoteFloat = 1.0f.rf,
    strokeLineWidth: RemoteFloat = DefaultStrokeLineWidth,
    strokeLineCap: StrokeCap = DefaultStrokeLineCap,
    strokeLineJoin: StrokeJoin = DefaultStrokeLineJoin,
    strokeLineMiter: RemoteFloat = DefaultStrokeLineMiter,
    pathFillType: PathFillType = DefaultFillType,
    pathBuilder: RemotePathBuilder.() -> Unit
): RemoteImageVector.Builder

DSL extension for adding a RemoteVectorPath to this.

Parameters
name: String = DefaultPathName

the name for this path

fill: Brush? = null

specifies the Brush used to fill the path

fillAlpha: RemoteFloat = 1.0f.rf

the alpha to fill the path

stroke: Brush? = null

specifies the Brush used to fill the stroke

strokeAlpha: RemoteFloat = 1.0f.rf

the alpha to stroke the path

strokeLineWidth: RemoteFloat = DefaultStrokeLineWidth

the width of the line to stroke the path

strokeLineCap: StrokeCap = DefaultStrokeLineCap

specifies the linecap for a stroked path

strokeLineJoin: StrokeJoin = DefaultStrokeLineJoin

specifies the linejoin for a stroked path

strokeLineMiter: RemoteFloat = DefaultStrokeLineMiter

specifies the miter limit for a stroked path

pathFillType: PathFillType = DefaultFillType

specifies the winding rule that decides how the interior of a Path is calculated.

pathBuilder: RemotePathBuilder.() -> Unit

RemotePathBuilder lambda for adding RemotePathNodes to this path.