RoundedCornerTreatment

public class RoundedCornerTreatment
extends CornerTreatment

java.lang.Object
   ↳ com.google.android.material.shape.CornerTreatment
     ↳ com.google.android.material.shape.RoundedCornerTreatment


A corner treatment which rounds a corner of a shape.

Summary

Public constructors

RoundedCornerTreatment()
RoundedCornerTreatment(float radius)

This constructor is deprecated. Set the size using the ShapeAppearanceModel.Builder

Public methods

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

Generates a ShapePath for this corner treatment.

Inherited methods

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

Generates a ShapePath for this corner treatment.

void getCornerPath(float angle, float interpolation, ShapePath shapePath)

This method is deprecated. implement getCornerPath(ShapePath, float, float, float) or getCornerPath(ShapePath, float, float, RectF, CornerSize) instead.

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

Generates a ShapePath for this corner treatment.

Object clone()
boolean equals(Object arg0)
void finalize()
final Class<?> getClass()
int hashCode()
final void notify()
final void notifyAll()
String toString()
final void wait(long arg0, int arg1)
final void wait(long arg0)
final void wait()

Public constructors

RoundedCornerTreatment

public RoundedCornerTreatment ()

RoundedCornerTreatment

public RoundedCornerTreatment (float radius)

This constructor is deprecated.
Set the size using the ShapeAppearanceModel.Builder

Instantiates a rounded corner treatment.

Parameters
radius float: the radius, in pixels, of the rounded corner, which is rendered as a quarter circle.

Public methods

getCornerPath

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

Generates a 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
shapePath ShapePath: the ShapePath that this treatment should write to.

angle float: the angle of the corner, typically 90 degrees.

interpolation float: 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.

radius float: the radius or size of this corner.