{% setvar book_path %}/reference/androidx/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}

VectorComposeKt

public final class VectorComposeKt


Summary

Public methods

static final void
@Composable
@VectorComposable
Group(
    @NonNull String name,
    float rotation,
    float pivotX,
    float pivotY,
    float scaleX,
    float scaleY,
    float translationX,
    float translationY,
    @NonNull List<@NonNull PathNode> clipPathData,
    @Composable @VectorComposable @NonNull Function0<Unit> content
)

Defines a group of Paths and other Groups inside a VectorPainter.

static final void
@Composable
@VectorComposable
Path(
    @NonNull List<@NonNull PathNode> pathData,
    @NonNull PathFillType pathFillType,
    @NonNull String name,
    Brush fill,
    float fillAlpha,
    Brush stroke,
    float strokeAlpha,
    float strokeLineWidth,
    @NonNull StrokeCap strokeLineCap,
    @NonNull StrokeJoin strokeLineJoin,
    float strokeLineMiter,
    float trimPathStart,
    float trimPathEnd,
    float trimPathOffset
)

Defines a path inside a VectorPainter.

Public methods

Group

@Composable
@VectorComposable
public static final void Group(
    @NonNull String name,
    float rotation,
    float pivotX,
    float pivotY,
    float scaleX,
    float scaleY,
    float translationX,
    float translationY,
    @NonNull List<@NonNull PathNode> clipPathData,
    @Composable @VectorComposable @NonNull Function0<Unit> content
)

Defines a group of Paths and other Groups inside a VectorPainter. This is not a regular UI composable, it can only be called inside composables called from the content parameter to rememberVectorPainter.

Parameters
@NonNull String name

Optional name of the group used when describing the vector as a string.

float rotation

The rotation of the group around the Z axis, in degrees.

float pivotX

The horizontal pivot point used for rotation, in pixels.

float pivotY

The vertical pivot point used for rotation, in pixels.

float scaleX

Factor to scale the group by horizontally.

float scaleY

Factor to scale the group by vertically.

float translationX

Horizontal offset of the group, in pixels.

float translationY

Vertical offset of the group, in pixels.

@NonNull List<@NonNull PathNode> clipPathData

A list of PathNodes that define how to clip the group. Empty by default.

@Composable @VectorComposable @NonNull Function0<Unit> content

A composable that defines the contents of the group.

Path

@Composable
@VectorComposable
public static final void Path(
    @NonNull List<@NonNull PathNode> pathData,
    @NonNull PathFillType pathFillType,
    @NonNull String name,
    Brush fill,
    float fillAlpha,
    Brush stroke,
    float strokeAlpha,
    float strokeLineWidth,
    @NonNull StrokeCap strokeLineCap,
    @NonNull StrokeJoin strokeLineJoin,
    float strokeLineMiter,
    float trimPathStart,
    float trimPathEnd,
    float trimPathOffset
)

Defines a path inside a VectorPainter. This is not a regular UI composable, it can only be called inside composables called from the content parameter to rememberVectorPainter.

Parameters
@NonNull List<@NonNull PathNode> pathData

List of PathNodes that define the path.

@NonNull PathFillType pathFillType

The PathFillType that specifies how to fill the path.

@NonNull String name

Optional name of the path used when describing the vector as a string.

Brush fill

The Brush used to fill the path.

float fillAlpha

The alpha value to use for fill.

Brush stroke

The Brush used to stroke the path.

float strokeAlpha

The alpha value to use for stroke.

float strokeLineWidth

The width of the stroke. See Stroke.width for details.

@NonNull StrokeCap strokeLineCap

The StrokeCap of stroke. See Stroke.cap for details.

@NonNull StrokeJoin strokeLineJoin

The StrokeJoin of stroke. See Stroke.join for details.

float strokeLineMiter

The stroke miter value. See Stroke.miter for details.

float trimPathStart

The fraction of the path that specifies the start of the clipped region of the path. See PathMeasure.getSegment.

float trimPathEnd

The fraction of the path that specifies the end of the clipped region of the path. See PathMeasure.getSegment.

float trimPathOffset

The amount to offset both trimPathStart and trimPathEnd.