BrushTip.Builder


public final class BrushTip.Builder


Builder for BrushTip.

For Java developers, use BrushTip.Builder to construct a BrushTip with default values, overriding only as needed. For example: BrushTip tip = BrushTip.builder().setCornerRounding(0.5).build();

Summary

Public constructors

Public methods

final @NonNull BrushTip.Builder

Adds a behavior to this brush tip.

final @NonNull BrushTip

Constructs a BrushTip from this Builder.

final @NonNull BrushTip.Builder

Sets the list of behaviors for this brush tip (replacing any previously-added behaviors).

final @NonNull BrushTip.Builder
setCornerRounding(@FloatRange(from = 0.0, to = 1.0) float cornerRounding)

Sets the corner rounding for this brush tip.

final @NonNull BrushTip.Builder
setParticleGapDistanceScale(
    @FloatRange(from = 0.0, toInclusive = false) float particleGapDistanceScale
)

Sets the distance-based particle gap for this brush tip.

final @NonNull BrushTip.Builder
setParticleGapDurationMillis(
    @IntRange(from = 0) long particleGapDurationMillis
)

Sets the time-based particle gap for this brush tip.

final @NonNull BrushTip.Builder
setPinch(@FloatRange(from = 0.0, to = 1.0) float pinch)

Sets the pinch for this brush tip.

final @NonNull BrushTip.Builder

Sets the rotation angle for this brush tip.

final @NonNull BrushTip.Builder
setScaleX(@FloatRange(from = 0.0, toInclusive = false) float scaleX)

Sets the horizontal scale for this brush tip.

final @NonNull BrushTip.Builder
setScaleY(@FloatRange(from = 0.0, toInclusive = false) float scaleY)

Sets the vertical scale for this brush tip.

final @NonNull BrushTip.Builder
setSlantDegrees(
    @FloatRange(from = -90.0, to = 90.0) @AngleDegreesFloat float degrees
)

Sets the slant angle for this brush tip.

Public constructors

Builder

Added in 1.1.0-alpha03
public Builder()

Public methods

addBehavior

Added in 1.1.0-alpha03
public final @NonNull BrushTip.Builder addBehavior(@NonNull BrushBehavior behavior)

Adds a behavior to this brush tip.

build

Added in 1.1.0-alpha03
public final @NonNull BrushTip build()

Constructs a BrushTip from this Builder.

setBehaviors

Added in 1.1.0-alpha03
public final @NonNull BrushTip.Builder setBehaviors(@NonNull List<@NonNull BrushBehavior> behaviors)

Sets the list of behaviors for this brush tip (replacing any previously-added behaviors).

setCornerRounding

Added in 1.1.0-alpha03
public final @NonNull BrushTip.Builder setCornerRounding(@FloatRange(from = 0.0, to = 1.0) float cornerRounding)

Sets the corner rounding for this brush tip.

setParticleGapDistanceScale

Added in 1.1.0-alpha03
public final @NonNull BrushTip.Builder setParticleGapDistanceScale(
    @FloatRange(from = 0.0, toInclusive = false) float particleGapDistanceScale
)

Sets the distance-based particle gap for this brush tip.

setParticleGapDurationMillis

Added in 1.1.0-alpha03
public final @NonNull BrushTip.Builder setParticleGapDurationMillis(
    @IntRange(from = 0) long particleGapDurationMillis
)

Sets the time-based particle gap for this brush tip.

setPinch

Added in 1.1.0-alpha03
public final @NonNull BrushTip.Builder setPinch(@FloatRange(from = 0.0, to = 1.0) float pinch)

Sets the pinch for this brush tip.

setRotationDegrees

Added in 1.1.0-alpha03
public final @NonNull BrushTip.Builder setRotationDegrees(@AngleDegreesFloat float degrees)

Sets the rotation angle for this brush tip.

setScaleX

Added in 1.1.0-alpha03
public final @NonNull BrushTip.Builder setScaleX(@FloatRange(from = 0.0, toInclusive = false) float scaleX)

Sets the horizontal scale for this brush tip.

setScaleY

Added in 1.1.0-alpha03
public final @NonNull BrushTip.Builder setScaleY(@FloatRange(from = 0.0, toInclusive = false) float scaleY)

Sets the vertical scale for this brush tip.

setSlantDegrees

Added in 1.1.0-alpha03
public final @NonNull BrushTip.Builder setSlantDegrees(
    @FloatRange(from = -90.0, to = 90.0) @AngleDegreesFloat float degrees
)

Sets the slant angle for this brush tip.