ArcControlDrawer

A ControlDrawer that draws an arc. Draws the arc positioned almost in Control.viewParametricPosition.

Inheritors

Constructors

Link copied to clipboard
public ArcControlDrawer ArcControlDrawer(ColorsScheme colors, Float strokeWidth, Float sweepAngle)
public ArcControlDrawer ArcControlDrawer(@ColorInt() Integer color, Float strokeWidth, Float sweepAngle)

Types

Link copied to clipboard

Properties

Link copied to clipboard
Link copied to clipboard
private final Circle arcCircle

A Circle representation for the arc position.

Link copied to clipboard
private final ColorsScheme colors

The drawer colors.

Link copied to clipboard
private final IntArray colorsArray

An IntArray of the current colors properties.

Link copied to clipboard
public final static Float MAX_SWEEP_ANGLE

The maximum arc sweep angle.

Link copied to clipboard
public final static Float MIN_STROKE_WIDTH

The minimum stroke width of arc arrow.

Link copied to clipboard
public final static Float MIN_SWEEP_ANGLE

The minimum arc sweep angle.

Link copied to clipboard
private final Paint paint

The drawer paint.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
private Float sweepAngle

Functions

Link copied to clipboard
public Unit draw(Canvas canvas, Control control)

Draw the control representation.

Link copied to clipboard
protected Unit drawArc(Canvas canvas, Control control, Float startArcAngle)

Draws the arc shape.

Link copied to clipboard
protected Unit drawArrow(Canvas canvas, Control control, Double angle)

Draws the arc arrow in the center of the arc pointing outward.

public final static Unit drawArrow(Canvas canvas, ImmutablePosition position, Float arrowLength, Paint paint)
public final static Unit drawArrow(Canvas canvas, ImmutablePosition position, Float arrowLength, Float rotateAngle, Paint paint)
public final static Unit drawArrow(Canvas canvas, Float x, Float y, Float arrowLength, Paint paint)
public final static Unit drawArrow(Canvas canvas, Float x, Float y, Float arrowLength, Float rotateAngle, Paint paint)

Draws an arrow path with the give canvas.

Link copied to clipboard
protected Unit drawShapes(Canvas canvas, Control control)

Draws the arc and arc arrow shapes.

Link copied to clipboard

Gets the accent color of colors.

Link copied to clipboard
protected Circle getArcCircle()

A Circle representation for the arc position.

Link copied to clipboard
protected final ColorsScheme getColors()
Link copied to clipboard
protected final IntArray getColorsArray()
Link copied to clipboard
protected Double getDistance(Control control)

Gets the distance value between the arc position and the control center.

Link copied to clipboard
protected RectF getOval(Control control)

The bounds of oval used to define the shape and size of the arc.

Link copied to clipboard
protected final Paint getPaint()
Link copied to clipboard
protected Shader getPaintShader(Control control, Double angle, Double startAngle)

The Shader for the drawer paint.

Link copied to clipboard

Gets the primary color of colors.

Link copied to clipboard
public final Float getStrokeWidth()

Gets the stroke width of the paint.

@FloatRange(from = 30.0)
public final static Float getStrokeWidth(Float strokeWidth)

Checks if the strokeWidth value meets the valid range.

Link copied to clipboard
public final Float getSweepAngle()

Gets the arc sweep angle.

@FloatRange(from = 30.0, to = 180.0)
public final static Float getSweepAngle(Float sweepAngle)

Checks if the sweepAngle value meets the valid range.

Link copied to clipboard
public final static Path pathArrow(ImmutablePosition position, Float length)
public final static Path pathArrow(Float x, Float y, Float length)

Creates a path for an simple arrow.

Link copied to clipboard
public Unit setAccentColor(Integer accentColor)

Sets the accent color of colors.

Link copied to clipboard
public Unit setColors(ColorsScheme colors)

Sets the primary and accent colors of drawer based on a schema.

public Unit setColors(@ColorInt() Integer primary, @ColorInt() Integer accent)

Sets the primary and accent colors of drawer.

Link copied to clipboard
public Unit setPrimaryColor(Integer primaryColor)

Sets the primary color of colors and paint.

Link copied to clipboard
public final Unit setStrokeWidth(Float strokeWidth)

Sets the stroke width of the paint.

Link copied to clipboard
public final Unit setSweepAngle(Float sweepAngle)

Sets the arc sweep angle.