# EdgeTreatment

[View Source](https://github.com/material-components/material-components-android/blob/1.14.0/lib/java/com/google/android/material/shape/EdgeTreatment.java)

*** ** * ** ***


```
public class EdgeTreatment
```

<br />

Known direct subclasses [BottomAppBarTopEdgeTreatment](https://developer.android.com/reference/com/google/android/material/bottomappbar/BottomAppBarTopEdgeTreatment), [MarkerEdgeTreatment](https://developer.android.com/reference/com/google/android/material/shape/MarkerEdgeTreatment), [OffsetEdgeTreatment](https://developer.android.com/reference/com/google/android/material/shape/OffsetEdgeTreatment), [TriangleEdgeTreatment](https://developer.android.com/reference/com/google/android/material/shape/TriangleEdgeTreatment)

|---|---|
| `https://developer.android.com/reference/com/google/android/material/bottomappbar/BottomAppBarTopEdgeTreatment` | Top edge treatment for the bottom app bar which "cradles" a circular `https://developer.android.com/reference/com/google/android/material/floatingactionbutton/FloatingActionButton`. |
| `https://developer.android.com/reference/com/google/android/material/shape/MarkerEdgeTreatment` | Draws an arrow on the edge given the radius of a circle. |
| `https://developer.android.com/reference/com/google/android/material/shape/OffsetEdgeTreatment` | Offsets a different edge treatment by the given amount. |
| `https://developer.android.com/reference/com/google/android/material/shape/TriangleEdgeTreatment` | An edge treatment which draws triangles at the midpoint of an edge, facing into or out of the shape. |

*** ** * ** ***

A basic edge treatment (a single straight line). Sub-classed for custom edge treatments.

Note: For edge treatments which result in a concave shape, the parent view must disable clipping of children by calling setClipChildren, or by setting \`android:clipChildren="false"\` in xml. \`clipToPadding\` may also need to be false if there is any padding on the parent that could intersect the shadow.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/com/google/android/material/shape/EdgeTreatment#EdgeTreatment()()` |

| ### Public methods |
|---|---|
| `void` | `[getEdgePath](https://developer.android.com/reference/com/google/android/material/shape/EdgeTreatment#getEdgePath(float,float,com.google.android.material.shape.ShapePath))(float length, float interpolation, https://developer.android.com/reference/com/google/android/material/shape/ShapePath shapePath)` **This method is deprecated.** Does not support interpolation. <br /> |
| `void` | `https://developer.android.com/reference/com/google/android/material/shape/EdgeTreatment#getEdgePath(float,float,float,com.google.android.material.shape.ShapePath)( float length, float center, float interpolation, https://developer.android.com/reference/com/google/android/material/shape/ShapePath shapePath )` Generates a `https://developer.android.com/reference/com/google/android/material/shape/ShapePath` for this edge treatment. |

## Public constructors

### EdgeTreatment

```
public EdgeTreatment()
```

## Public methods

### getEdgePath

```
public void [getEdgePath](https://developer.android.com/reference/com/google/android/material/shape/EdgeTreatment#getEdgePath(float,float,com.google.android.material.shape.ShapePath))(float length, float interpolation, ShapePath shapePath)
```

> [!CAUTION]
> **This method is deprecated.**   
>
> Does not support interpolation. Use `https://developer.android.com/reference/com/google/android/material/shape/EdgeTreatment#getEdgePath(float,float,float,com.google.android.material.shape.ShapePath)` instead.

### getEdgePath

```
public void getEdgePath(
    float length,
    float center,
    float interpolation,
    ShapePath shapePath
)
```

Generates a `https://developer.android.com/reference/com/google/android/material/shape/ShapePath` for this edge treatment.

EdgeTreatments have an origin of (0, 0) and a destination of (0, length) (i.e. they represent the top edge), and are automatically rotated and scaled as necessary when applied to other edges. Only the horizontal, top EdgeTreatment needs to be defined in order to apply it to all four edges.

| Parameters |
|---|---|
| `float length` | the length of the edge. |
| `float center` | the distance to the center of the edge. This takes into account any offset added by the proceeding corner. Drawing anything at (center, 0) will be center aligned with the shape. Normally you'll want to use this instead of length / 2. |
| `float interpolation` | the interpolation of the edge treatment. Ranges between 0 (none) and 1 (fully) interpolated. Custom edge treatments can implement interpolation to support shape transition between two arbitrary states. Typically, a value of 0 indicates that the custom edge treatment is not rendered (i.e. that it is a straight line), and a value of 1 indicates that the treatment is fully rendered. Animation between these two values can "heal" or "reveal" an edge treatment. |
| `https://developer.android.com/reference/com/google/android/material/shape/ShapePath shapePath` | the `https://developer.android.com/reference/com/google/android/material/shape/ShapePath` that this treatment should write to. |