# ArcLayout.Widget

Artifact: [androidx.wear:wear](https://developer.android.com/jetpack/androidx/releases/wear) [View Source](https://cs.android.com/search?q=file:androidx/wear/widget/ArcLayout.java+class:androidx.wear.widget.ArcLayout.Widget) Added in [1.2.0](https://developer.android.com/jetpack/androidx/releases/wear#1.2.0)

*** ** * ** ***


```
public interface ArcLayout.Widget
```

<br />

Known direct subclasses [CurvedTextView](https://developer.android.com/reference/androidx/wear/widget/CurvedTextView)

|---|---|
| `https://developer.android.com/reference/androidx/wear/widget/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. |

*** ** * ** ***

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 void` | `https://developer.android.com/reference/androidx/wear/widget/ArcLayout.Widget#checkInvalidAttributeAsChild()()` Check whether the widget contains invalid attributes as a child of ArcLayout, throwing a Exception if something is wrong. |
| `abstract @https://developer.android.com/reference/androidx/annotation/FloatRange(from = 0.0, to = 360.0, toInclusive = true) float` | `https://developer.android.com/reference/androidx/wear/widget/ArcLayout.Widget#getSweepAngleDegrees()()` Returns the sweep angle that this widget is drawn with. |
| `abstract @https://developer.android.com/reference/androidx/annotation/Px int` | `https://developer.android.com/reference/androidx/wear/widget/ArcLayout.Widget#getThickness()()` Returns the thickness of this widget inside the arc. |
| `abstract boolean` | `https://developer.android.com/reference/androidx/wear/widget/ArcLayout.Widget#isPointInsideClickArea(float,float)(float x, float y)` Return true when the given point is in the clickable area of the child widget. |
| `default void` | `https://developer.android.com/reference/androidx/wear/widget/ArcLayout.Widget#setSweepAngleDegrees(float)( @https://developer.android.com/reference/androidx/annotation/FloatRange(from = 0.0, to = 360.0, toInclusive = true) float sweepAngleDegrees )` Set the sweep angle that this widget is drawn with. |

## Public methods

### checkInvalidAttributeAsChild

Added in [1.2.0](https://developer.android.com/jetpack/androidx/releases/wear#1.2.0)

```
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

Added in [1.2.0](https://developer.android.com/jetpack/androidx/releases/wear#1.2.0)

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

Returns the sweep angle that this widget is drawn with.

### getThickness

Added in [1.2.0](https://developer.android.com/jetpack/androidx/releases/wear#1.2.0)

```
abstract @Px int getThickness()
```

Returns the thickness of this widget inside the arc.

### isPointInsideClickArea

Added in [1.2.0](https://developer.android.com/jetpack/androidx/releases/wear#1.2.0)

```
abstract 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).

### setSweepAngleDegrees

Added in [1.3.0](https://developer.android.com/jetpack/androidx/releases/wear#1.3.0)

```
default void setSweepAngleDegrees(
    @FloatRange(from = 0.0, to = 360.0, toInclusive = true) float sweepAngleDegrees
)
```

Set the sweep angle that this widget is drawn with. This is only called during layout, and only if the `https://developer.android.com/reference/androidx/wear/widget/ArcLayout.LayoutParams#mWeight()` is non-zero. Note your widget will need to handle alignment.