ArcLayout.Widget

interface ArcLayout.Widget

Known direct subclasses
CurvedTextView

CurvedTextView is a component allowing developers to easily write curved text following the curvature of the largest circle that can be inscribed in the view.

WearCurvedLineView

A line, drawn inside an arc.

WearCurvedSpacer

A lightweight curved widget that represents space between elements inside an Arc.


Interface for a widget which knows it is being rendered inside an arc, and will draw itself accordingly. Any widget implementing this interface will receive the full-sized canvas, pre-rotated, in its draw call.

Summary

Public methods

abstract @NonNull void

Check whether the widget contains invalid attributes as a child of ArcLayout, throwing a Exception if something is wrong.

abstract @FloatRange(from = 0.0, to = 360.0, toInclusive = true) @NonNull float

Returns the sweep angle that this widget is drawn with.

abstract @Px @NonNull int

Returns the thickness of this widget inside the arc.

abstract @NonNull boolean
isPointInsideClickArea(@NonNull float x, @NonNull float y)

Return true when the given point is in the clickable area of the child widget.

Public methods

checkInvalidAttributeAsChild

@NonNull
abstract void checkInvalidAttributeAsChild()

Check whether the widget contains invalid attributes as a child of ArcLayout, throwing a Exception if something is wrong. This is important for widgets that can be both standalone or used inside an ArcLayout, some parameters used when the widget is standalone doesn't make sense when the widget is inside an ArcLayout.

getSweepAngleDegrees

@FloatRange(from = 0.0, to = 360.0, toInclusive = true)
@NonNull
abstract @FloatRange(from = 0.0, to = 360.0, toInclusive = true) float getSweepAngleDegrees()

Returns the sweep angle that this widget is drawn with.

getThickness

@Px
@NonNull
abstract @Px int getThickness()

Returns the thickness of this widget inside the arc.

isPointInsideClickArea

@NonNull
abstract boolean isPointInsideClickArea(@NonNull float x, @NonNull float y)

Return true when the given point is in the clickable area of the child widget. In particular, the coordinates should be considered as if the child was drawn centered at the default angle (12 o clock).