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

Stroke

data class Stroke : DrawStyle
kotlin.Any
   ↳ androidx.ui.graphics.drawscope.DrawStyle
   ↳ androidx.ui.graphics.drawscope.Stroke

DrawStyle that provides information for drawing content with a stroke

Summary

Constants
const Float

Default miter length used in combination with joins

const Float

Width to indicate a hairline stroke of 1 pixel

Public constructors
<init>(width: Float = 0.0f, miter: Float = DefaultMiter, cap: StrokeCap = StrokeCap.butt, join: StrokeJoin = StrokeJoin.miter, pathEffect: NativePathEffect? = null)

DrawStyle that provides information for drawing content with a stroke

Properties
StrokeCap

Return the paint's Cap, controlling how the start and end of stroked lines and paths are treated.

StrokeJoin

Set's the treatment where lines and curve segments join on a stroked path.

Float

Set the stroke miter value.

NativePathEffect?

Effect to apply to the stroke, null indicates a solid stroke line is to be drawn

Float

Configure the width of the stroke in pixels

Companion properties
StrokeCap

Default cap used for line endings

StrokeJoin

Default join style used for connections between line and curve segments

Constants

DefaultMiter

const val DefaultMiter: Float

Default miter length used in combination with joins

Value: 4.0f

HairlineWidth

const val HairlineWidth: Float

Width to indicate a hairline stroke of 1 pixel

Value: 0.0f

Public constructors

<init>

Stroke(
    width: Float = 0.0f,
    miter: Float = DefaultMiter,
    cap: StrokeCap = StrokeCap.butt,
    join: StrokeJoin = StrokeJoin.miter,
    pathEffect: NativePathEffect? = null)

DrawStyle that provides information for drawing content with a stroke

Properties

cap

val cap: StrokeCap

Return the paint's Cap, controlling how the start and end of stroked lines and paths are treated. The default is StrokeCap.butt

join

val join: StrokeJoin

Set's the treatment where lines and curve segments join on a stroked path. The default is StrokeJoin.miter

miter

val miter: Float

Set the stroke miter value. This is used to control the behavior of miter joins when the joins angle is sharp. This value must be >= 0.

pathEffect

val pathEffect: NativePathEffect?

Effect to apply to the stroke, null indicates a solid stroke line is to be drawn

width

val width: Float

Configure the width of the stroke in pixels

Companion properties

DefaultCap

val DefaultCap: StrokeCap

Default cap used for line endings

DefaultJoin

val DefaultJoin: StrokeJoin

Default join style used for connections between line and curve segments