# CornerTreatment

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

*** ** * ** ***


```
public class CornerTreatment
```

<br />

Known direct subclasses [CutCornerTreatment](https://developer.android.com/reference/com/google/android/material/shape/CutCornerTreatment), [RoundedCornerTreatment](https://developer.android.com/reference/com/google/android/material/shape/RoundedCornerTreatment)

|---|---|
| `https://developer.android.com/reference/com/google/android/material/shape/CutCornerTreatment` | A corner treatment which cuts or clips the original corner of a shape with a straight line. |
| `https://developer.android.com/reference/com/google/android/material/shape/RoundedCornerTreatment` | A corner treatment which rounds a corner of a shape. |

*** ** * ** ***

A basic corner treatment (a single point which does not affect the shape).

Note: For corner 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/CornerTreatment#CornerTreatment()()` |

| ### Public methods |
|---|---|
| `void` | `[getCornerPath](https://developer.android.com/reference/com/google/android/material/shape/CornerTreatment#getCornerPath(float,float,com.google.android.material.shape.ShapePath))(float angle, float interpolation, https://developer.android.com/reference/com/google/android/material/shape/ShapePath shapePath)` **This method is deprecated.** implement `https://developer.android.com/reference/com/google/android/material/shape/CornerTreatment#getCornerPath(com.google.android.material.shape.ShapePath,float,float,float)` or `https://developer.android.com/reference/com/google/android/material/shape/CornerTreatment#getCornerPath(com.google.android.material.shape.ShapePath,float,float,RectF,com.google.android.material.shape.CornerSize)` instead. <br /> |
| `void` | `https://developer.android.com/reference/com/google/android/material/shape/CornerTreatment#getCornerPath(com.google.android.material.shape.ShapePath,float,float,float)( https://developer.android.com/reference/com/google/android/material/shape/ShapePath shapePath, float angle, float interpolation, float radius )` Generates a `https://developer.android.com/reference/com/google/android/material/shape/ShapePath` using a single radius value for this corner treatment. |
| `void` | `https://developer.android.com/reference/com/google/android/material/shape/CornerTreatment#getCornerPath(com.google.android.material.shape.ShapePath,float,float,RectF,com.google.android.material.shape.CornerSize)( https://developer.android.com/reference/com/google/android/material/shape/ShapePath shapePath, float angle, float interpolation, RectF bounds, https://developer.android.com/reference/com/google/android/material/shape/CornerSize size )` Generates a `https://developer.android.com/reference/com/google/android/material/shape/ShapePath` for this corner treatment. |

## Public constructors

### CornerTreatment

```
public CornerTreatment()
```

## Public methods

### getCornerPath

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

> [!CAUTION]
> **This method is deprecated.**   
>
> implement `https://developer.android.com/reference/com/google/android/material/shape/CornerTreatment#getCornerPath(com.google.android.material.shape.ShapePath,float,float,float)` or `https://developer.android.com/reference/com/google/android/material/shape/CornerTreatment#getCornerPath(com.google.android.material.shape.ShapePath,float,float,RectF,com.google.android.material.shape.CornerSize)` instead.

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

CornerTreatments are assumed to have an origin of (0, 0) (i.e. they represent the top-left corner), and are automatically rotated and scaled as necessary when applied to other corners.

| Parameters |
|---|---|
| `float angle` | the angle of the corner, typically 90 degrees. |
| `float interpolation` | the interpolation of the corner treatment. Ranges between 0 (none) and 1 (fully) interpolated. Custom corner treatments can implement interpolation to support shape transition between two arbitrary states. Typically, a value of 0 indicates that the custom corner treatment is not rendered (i.e. that it is a 90 degree angle), and a value of 1 indicates that the treatment is fully rendered. Animation between these two values can "heal" or "reveal" a corner 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. |

### getCornerPath

```
public void getCornerPath(
    ShapePath shapePath,
    float angle,
    float interpolation,
    float radius
)
```

Generates a `https://developer.android.com/reference/com/google/android/material/shape/ShapePath` using a single radius value for this corner treatment.

CornerTreatments are assumed to have an origin of (0, 0) (i.e. they represent the top-left corner), and are automatically rotated and scaled as necessary when applied to other corners.

| Parameters |
|---|---|
| `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. |
| `float angle` | the angle of the corner, typically 90 degrees. |
| `float interpolation` | the interpolation of the corner treatment. Ranges between 0 (none) and 1 (fully) interpolated. Custom corner treatments can implement interpolation to support shape transition between two arbitrary states. Typically, a value of 0 indicates that the custom corner treatment is not rendered (i.e. that it is a 90 degree angle), and a value of 1 indicates that the treatment is fully rendered. Animation between these two values can "heal" or "reveal" a corner treatment. |
| `float radius` | the radius or size of this corner. |

### getCornerPath

```
public void getCornerPath(
    ShapePath shapePath,
    float angle,
    float interpolation,
    RectF bounds,
    CornerSize size
)
```

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

CornerTreatments are assumed to have an origin of (0, 0) (i.e. they represent the top-left corner), and are automatically rotated and scaled as necessary when applied to other corners.

| Parameters |
|---|---|
| `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. |
| `float angle` | the angle of the corner, typically 90 degrees. |
| `float interpolation` | the interpolation of the corner treatment. Ranges between 0 (none) and 1 (fully) interpolated. Custom corner treatments can implement interpolation to support shape transition between two arbitrary states. Typically, a value of 0 indicates that the custom corner treatment is not rendered (i.e. that it is a 90 degree angle), and a value of 1 indicates that the treatment is fully rendered. Animation between these two values can "heal" or "reveal" a corner treatment. |
| `RectF bounds` | the bounds of the full shape that will be drawn. This could be used change the behavior of the CornerTreatment depending on how much space is available for the full shape. |
| `https://developer.android.com/reference/com/google/android/material/shape/CornerSize size` | the `https://developer.android.com/reference/com/google/android/material/shape/CornerSize` used for this corner |