Package-level declarations

Types

Link copied to clipboard

Component is a generic concept of an object that can be drawn on a canvas at a given pair of coordinates. Its subclasses are used throughout the library.

Link copied to clipboard
open class LineComponent(fill: Fill, val thickness: Dp = Defaults.LINE_COMPONENT_THICKNESS_DP.dp, shape: Shape = Shape.Rectangle, margins: Insets = Insets.Zero, strokeFill: Fill = Fill.Transparent, strokeThickness: Dp = 0.dp) : ShapeComponent

Draws lines.

Link copied to clipboard
open class ShapeComponent(val fill: Fill = Fill.Black, val shape: Shape = Shape.Rectangle, margins: Insets = Insets.Zero, val strokeFill: Fill = Fill.Transparent, strokeThickness: Dp = 0.dp) : Component

Draws Shapes.

Link copied to clipboard
open class TextComponent(textStyle: TextStyle = TextStyle.Default, lineCount: Int = TEXT_COMPONENT_LINE_COUNT, textOverflow: TextOverflow = TextOverflow.Ellipsis, margins: Insets = Insets.Zero, padding: Insets = Insets.Zero, val background: Component? = null, minWidth: TextComponent.MinWidth = MinWidth.fixed())

Uses Canvas to render text. This class utilizes TextMeasurer and supports the following:

Functions

Link copied to clipboard
fun rememberLineComponent(fill: Fill = Fill.Black, thickness: Dp = Defaults.LINE_COMPONENT_THICKNESS_DP.dp, shape: Shape = Shape.Rectangle, margins: Insets = Insets.Zero, strokeFill: Fill = Fill.Transparent, strokeThickness: Dp = 0.dp): LineComponent

Creates and remembers a LineComponent.

Link copied to clipboard
fun rememberShapeComponent(fill: Fill = Fill.Black, shape: Shape = Shape.Rectangle, margins: Insets = Insets.Zero, strokeFill: Fill = Fill.Transparent, strokeThickness: Dp = 0.dp): ShapeComponent

Creates and remembers a ShapeComponent.

Link copied to clipboard
fun rememberTextComponent(style: TextStyle = TextStyle(fontSize = Defaults.TEXT_COMPONENT_TEXT_SIZE.sp), lineCount: Int = Defaults.TEXT_COMPONENT_LINE_COUNT, overflow: TextOverflow = TextOverflow.Ellipsis, margins: Insets = Insets.Zero, padding: Insets = Insets.Zero, background: Component? = null, minWidth: TextComponent.MinWidth = TextComponent.MinWidth.fixed()): TextComponent

Creates and remembers a TextComponent.