StockBrushes



Provides a fixed set of stock BrushFamily objects that any app can use.

All brush designs are versioned, so apps can safely store input points and brush specs instead of the pixel result, but be able to regenerate strokes from stored input points that look like the strokes originally drawn by the user. Brush designs are intended to evolve over time, and are released as update packs to the stock library.

Each successive brush version will keep to the spirit of the brush, but the actual effect can change between versions. For example, a new version of the highlighter may introduce a variation on how round the tip is, or what sort of curve maps color to pressure.

We generally recommend that applications use the latest brush version available; but some use cases, such as art, should be careful to track which version of a brush was used if the document is regenerated, so that the user gets the same visual result.

Summary

Public functions

BrushFamily
emojiHighlighterLatest(
    clientTextureId: String,
    showMiniEmojiTrail: Boolean
)

The latest version of emoji highlighter--a highlighter with an emoji at the head of the stroke, under the pointer tip.

android
BrushFamily
emojiHighlighterV1(clientTextureId: String, showMiniEmojiTrail: Boolean)

Version 1 of emoji highlighter--a highlighter with an emoji at the head of the stroke, under the pointer tip.

android

Public properties

BrushFamily

The latest version of a brush that appears as rounded rectangles with gaps in between them.

android
BrushFamily

Version 1 of a brush that appears as rounded rectangles with gaps in between them.

android
BrushFamily

The latest version of a chisel-tip brush that is intended for highlighting text in a document (when used with a translucent brush color).

android
BrushFamily

Version 1 of a chisel-tip brush that is intended for highlighting text in a document (when used with a translucent brush color).

android
BrushFamily

The latest version of a simple, circular fixed-width brush.

android
BrushFamily

Version 1 of a simple, circular fixed-width brush.

android
BrushFamily

The latest version of a pressure- and speed-sensitive brush that is optimized for handwriting with a stylus.

android
BrushFamily

Version 1 of a pressure- and speed-sensitive brush that is optimized for handwriting with a stylus.

android

Public functions

emojiHighlighterLatest

fun emojiHighlighterLatest(
    clientTextureId: String,
    showMiniEmojiTrail: Boolean = false
): BrushFamily

The latest version of emoji highlighter--a highlighter with an emoji at the head of the stroke, under the pointer tip.

In order to use this brush, the TextureBitmapStore provided to your renderer must map the clientTextureId to a bitmap; otherwise, no texture will be visible. The emoji bitmap should be a square, though the image can have a transparent background for emoji shapes that aren't square.

The behavior of this BrushFamily may change in future releases, as it always points to the latest version of the emoji highlighter.

Parameters
clientTextureId: String

The client texture ID of the emoji to appear at the end of the stroke.

showMiniEmojiTrail: Boolean = false

Whether to show a trail of miniature emojis disappearing from the stroke as it is drawn. Note that this will only render properly starting with Android U, and before Android U it is recommended to set this to false.

emojiHighlighterV1

fun emojiHighlighterV1(
    clientTextureId: String,
    showMiniEmojiTrail: Boolean = false
): BrushFamily

Version 1 of emoji highlighter--a highlighter with an emoji at the head of the stroke, under the pointer tip.

In order to use this brush, the TextureBitmapStore provided to your renderer must map the clientTextureId to a bitmap; otherwise, no texture will be visible. The emoji bitmap should be a square, though the image can have a transparent background for emoji shapes that aren't square.

The behavior of this BrushFamily will not meaningfully change in future releases. More significant updates would be contained in a BrushFamily with a different name specifying a later version number.

Parameters
clientTextureId: String

The client texture ID of the emoji to appear at the end of the stroke.

showMiniEmojiTrail: Boolean = false

Whether to show a trail of miniature emojis disappearing from the stroke as it is drawn. Note that this will only render properly starting with Android U, and before Android U it is recommended to set this to false.

Public properties

dashedLineLatest

val dashedLineLatestBrushFamily

The latest version of a brush that appears as rounded rectangles with gaps in between them. This may be decorative, or can be used to signify a user interaction like free-form (lasso) selection.

The behavior of this BrushFamily may change in future releases, as it always points to the latest version of the pressure pen.

dashedLineV1

val dashedLineV1BrushFamily

Version 1 of a brush that appears as rounded rectangles with gaps in between them. This may be decorative, or can be used to signify a user interaction like free-form (lasso) selection.

The behavior of this BrushFamily will not meaningfully change in future releases. More significant updates would be contained in a BrushFamily with a different name specifying a later version number.

highlighterLatest

val highlighterLatestBrushFamily

The latest version of a chisel-tip brush that is intended for highlighting text in a document (when used with a translucent brush color).

The behavior of this BrushFamily may change in future releases, as it always points to the latest version of the pressure pen.

highlighterV1

val highlighterV1BrushFamily

Version 1 of a chisel-tip brush that is intended for highlighting text in a document (when used with a translucent brush color).

The behavior of this BrushFamily will not meaningfully change in future releases. More significant updates would be contained in a BrushFamily with a different name specifying a later version number.

markerLatest

val markerLatestBrushFamily

The latest version of a simple, circular fixed-width brush.

The behavior of this BrushFamily may change in future releases, as it always points to the latest version of the marker.

markerV1

val markerV1BrushFamily

Version 1 of a simple, circular fixed-width brush.

The behavior of this BrushFamily will not meaningfully change in future releases. More significant updates would be contained in a BrushFamily with a different name specifying a later version number.

pressurePenLatest

val pressurePenLatestBrushFamily

The latest version of a pressure- and speed-sensitive brush that is optimized for handwriting with a stylus.

The behavior of this BrushFamily may change in future releases, as it always points to the latest version of the pressure pen.

pressurePenV1

val pressurePenV1BrushFamily

Version 1 of a pressure- and speed-sensitive brush that is optimized for handwriting with a stylus.

The behavior of this BrushFamily will not meaningfully change in future releases. More significant updates would be contained in a BrushFamily with a different name specifying a later version number.