CircleArcView

public final class CircleArcView extends View

Custom view to draw a circle and arc based on the direction of user actions for an Active Face Capture session.

Constructors

Link copied to clipboard

Types

Link copied to clipboard

Enum class to define the color of the circle based on the state

Properties

Link copied to clipboard
private final Paint arcPaint

Paint to draw the arc (empty color)

Link copied to clipboard
private final RectF circle

To draw the arc and the directional strength indicator

Link copied to clipboard

Color of the circle currently

Link copied to clipboard
private ActiveFaceCaptureStateName direction

Direction of the arc

Link copied to clipboard

Animator to rotate the arc as the expected user action changes

Link copied to clipboard

Directional score of the current head position

Link copied to clipboard

Color of the circle initially

Link copied to clipboard
private final RectF innerRect

Rect to draw the inner circle (shrinks rect by width/10 - the stroke width of the arc)

Link copied to clipboard
private final Float offsetValue

Offset value to set the start angle of the arc

Link copied to clipboard
private final Paint paint

Paint to draw the circle and arc

Link copied to clipboard
private final RectF rect

Rect to track the size of this view

Link copied to clipboard
private Float startAngle

Start angle of the arc

Link copied to clipboard

Color of the circle when the user should stay still

Functions

Link copied to clipboard
private final Paint getArcPaint()

Paint to draw the arc (empty color)

Link copied to clipboard
private final RectF getCircle()

To draw the arc and the directional strength indicator

Link copied to clipboard

Color of the circle currently

Link copied to clipboard
private final ActiveFaceCaptureStateName getDirection()

Direction of the arc

Link copied to clipboard

Animator to rotate the arc as the expected user action changes

Link copied to clipboard
private final Float getDirectionalScores()

Directional score of the current head position

Link copied to clipboard
private final Integer getInitialColor()

Color of the circle initially

Link copied to clipboard
private final RectF getInnerRect()

Rect to draw the inner circle (shrinks rect by width/10 - the stroke width of the arc)

Link copied to clipboard
private final Float getOffsetValue()

Offset value to set the start angle of the arc

Link copied to clipboard
private final Paint getPaint()

Paint to draw the circle and arc

Link copied to clipboard
private final RectF getRect()

Rect to track the size of this view

Link copied to clipboard
private final Float getStartAngle()

Start angle of the arc

Link copied to clipboard
private final Integer getStayStillColor()

Color of the circle when the user should stay still

Link copied to clipboard
protected Unit onDraw(Canvas canvas)
Link copied to clipboard
protected Unit onSizeChanged(Integer w, Integer h, Integer oldw, Integer oldh)
Link copied to clipboard

Color of the circle currently

Link copied to clipboard
private final Unit setDirection(ActiveFaceCaptureStateName direction)

Direction of the arc

public final Unit setDirection(ActiveFaceCaptureStateName direction, DirectionalScores directionalScore)

Set the direction of the arc based on expected instruction

Link copied to clipboard
private final Unit setDirectionalArcAnimator(ValueAnimator directionalArcAnimator)

Animator to rotate the arc as the expected user action changes

Link copied to clipboard
private final Unit setDirectionalScores(Float directionalScores)

Directional score of the current head position

Link copied to clipboard
private final Unit setInitialColor(Integer initialColor)

Color of the circle initially

Link copied to clipboard
private final Unit setStartAngle(Float startAngle)

Start angle of the arc

Link copied to clipboard
private final Unit setStayStillColor(Integer stayStillColor)

Color of the circle when the user should stay still

Link copied to clipboard

Update the color of the circle