Google is committed to advancing racial equity for Black communities. See how.

Builder

class Builder
kotlin.Any
   ↳ androidx.compose.ui.graphics.vector.ImageVector.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 rememberVectorPainter The generated ImageVector is recommended to be memoized across composition calls to avoid doing redundant work

Summary

Public constructors
<init>(name: String = DefaultGroupName, defaultWidth: Dp, defaultHeight: Dp, viewportWidth: Float, viewportHeight: Float)

Builder used to construct a Vector graphic tree.

Public methods
ImageVector.Builder
addGroup(name: String = DefaultGroupName, rotate: Float = DefaultRotation, pivotX: Float = DefaultPivotX, pivotY: Float = DefaultPivotY, scaleX: Float = DefaultScaleX, scaleY: Float = DefaultScaleY, translationX: Float = DefaultTranslationX, translationY: Float = DefaultTranslationY, clipPathData: List<PathNode> = EmptyPath)

Create a new group and push it to the front of the stack of ImageVector nodes

ImageVector.Builder
addPath(pathData: List<PathNode>, pathFillType: PathFillType = DefaultFillType, name: String = DefaultPathName, fill: Brush? = null, fillAlpha: Float = 1.0f, stroke: Brush? = null, strokeAlpha: Float = 1.0f, strokeLineWidth: Float = DefaultStrokeLineWidth, strokeLineCap: StrokeCap = DefaultStrokeLineCap, strokeLineJoin: StrokeJoin = DefaultStrokeLineJoin, strokeLineMiter: Float = DefaultStrokeLineMiter, trimPathStart: Float = DefaultTrimPathStart, trimPathEnd: Float = DefaultTrimPathEnd, trimPathOffset: Float = DefaultTrimPathOffset)

Add a path to the ImageVector graphic.

ImageVector

Construct a ImageVector.

ImageVector.Builder

Pops the topmost VectorGroup from this ImageVector.

ImageVector.Builder

Pops the topmost VectorGroup from this ImageVector.

ImageVector.Builder
pushGroup(name: String = DefaultGroupName, rotate: Float = DefaultRotation, pivotX: Float = DefaultPivotX, pivotY: Float = DefaultPivotY, scaleX: Float = DefaultScaleX, scaleY: Float = DefaultScaleY, translationX: Float = DefaultTranslationX, translationY: Float = DefaultTranslationY, clipPathData: List<PathNode> = EmptyPath)

Create a new group and push it to the front of the stack of ImageVector nodes

Extension functions
From androidx.compose.ui.graphics.vector
ImageVector.Builder
ImageVector.Builder.group(name: String = DefaultGroupName, rotate: Float = DefaultRotation, pivotX: Float = DefaultPivotX, pivotY: Float = DefaultPivotY, scaleX: Float = DefaultScaleX, scaleY: Float = DefaultScaleY, translationX: Float = DefaultTranslationX, translationY: Float = DefaultTranslationY, clipPathData: List<PathNode> = EmptyPath, block: ImageVector.Builder.() -> Unit)

DSL extension for adding a VectorGroup to this.

ImageVector.Builder
ImageVector.Builder.path(name: String = DefaultPathName, fill: Brush? = null, fillAlpha: Float = 1.0f, stroke: Brush? = null, strokeAlpha: Float = 1.0f, strokeLineWidth: Float = DefaultStrokeLineWidth, strokeLineCap: StrokeCap = DefaultStrokeLineCap, strokeLineJoin: StrokeJoin = DefaultStrokeLineJoin, strokeLineMiter: Float =