Android 12 Developer Preview is here! Try it out, and give us your feedback!

BorderStroke

@Immutable class BorderStroke
kotlin.Any
   ↳ androidx.compose.foundation.BorderStroke

Class to specify the stroke to draw border with.

Summary

Public constructors
<init>(width: Dp, brush: Brush)

Class to specify the stroke to draw border with.

Public methods
BorderStroke
copy(width: Dp = this.width, brush: Brush = this.brush)

Boolean
equals(other: Any?)

Int

String

Properties
Brush

brush to paint the border with

Dp

width of the border in Dp.

Public constructors

<init>

BorderStroke(
    width: Dp,
    brush: Brush)

Class to specify the stroke to draw border with.

Parameters
width: Dp width of the border in Dp. Use Dp.Hairline for one-pixel border.
brush: Brush brush to paint the border with

Public methods

copy

fun copy(
    width: Dp = this.width,
    brush: Brush = this.brush
): BorderStroke

equals

fun equals(other: Any?): Boolean

hashCode

fun hashCode(): Int

toString

fun toString(): String

Properties

brush

val brush: Brush

brush to paint the border with

width

val width: Dp

width of the border in Dp. Use Dp.Hairline for one-pixel border.