public interface

ArcLayout.Widget

 androidx.wear.widget.ArcLayout.Widget

Subclasses:

WearCurvedLineView, WearCurvedSpacer, CurvedTextView

Overview

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

Methods
public voidcheckInvalidAttributeAsChild()

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

public floatgetSweepAngleDegrees()

Returns the sweep angle that this widget is drawn with.

public intgetThickness()

Returns the thickness of this widget inside the arc.

public booleanisPointInsideClickArea(float x, float y)

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

Methods

public float getSweepAngleDegrees()

Returns the sweep angle that this widget is drawn with.

public int getThickness()

Returns the thickness of this widget inside the arc.

public 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.

public boolean isPointInsideClickArea(float x, 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).