ShapePathModel

public class ShapePathModel
extends Object

java.lang.Object
   ↳ com.google.android.material.shape.ShapePathModel


This class models the edges and corners of a shape, which are used by MaterialShapeDrawable to generate and render the shape for a view's background.

Summary

Public constructors

ShapePathModel()

Construct a default path generator with default edge and corner treatments.

Public methods

EdgeTreatment getBottomEdge()

Get the edge treatment for the bottom edge.

CornerTreatment getBottomLeftCorner()

Get the corner treatment for the bottom-left corner.

CornerTreatment getBottomRightCorner()

Get the corner treatment for the bottom-right corner.

EdgeTreatment getLeftEdge()

Get the edge treatment for the left edge.

EdgeTreatment getRightEdge()

Get the edge treatment for the right edge.

EdgeTreatment getTopEdge()

Get the edge treatment for the top edge.

CornerTreatment getTopLeftCorner()

Get the corner treatment for the top-left corner.

CornerTreatment getTopRightCorner()

Get the corner treatment for the top-right corner.

void setAllCorners(CornerTreatment cornerTreatment)

Set all corner treatments.

void setAllEdges(EdgeTreatment edgeTreatment)

Set all edge treatments.

void setBottomEdge(EdgeTreatment bottomEdge)

Set the edge treatment for the bottom edge.

void setBottomLeftCorner(CornerTreatment bottomLeftCorner)

Set the corner treatment for the bottom-left corner.

void setBottomRightCorner(CornerTreatment bottomRightCorner)

Set the corner treatment for the bottom-right corner.

void setCornerTreatments(CornerTreatment topLeftCorner, CornerTreatment topRightCorner, CornerTreatment bottomRightCorner, CornerTreatment bottomLeftCorner)

Set corner treatments.

void setEdgeTreatments(EdgeTreatment leftEdge, EdgeTreatment topEdge, EdgeTreatment rightEdge, EdgeTreatment bottomEdge)

Set edge treatments.

void setLeftEdge(EdgeTreatment leftEdge)

Set the edge treatment for the left edge.

void setRightEdge(EdgeTreatment rightEdge)

Set the edge treatment for the right edge.

void setTopEdge(EdgeTreatment topEdge)

Set the edge treatment for the top edge.

void setTopLeftCorner(CornerTreatment topLeftCorner)

Set the corner treatment for the top-left corner.

void setTopRightCorner(CornerTreatment topRightCorner)

Set the corner treatment for the top-right corner.

Inherited methods

From class java.lang.Object

Public constructors

ShapePathModel

ShapePathModel ()

Construct a default path generator with default edge and corner treatments.

Public methods

getBottomEdge

EdgeTreatment getBottomEdge ()

Get the edge treatment for the bottom edge.

Returns
EdgeTreatment the edge treatment for the bottom edge.

getBottomLeftCorner

CornerTreatment getBottomLeftCorner ()

Get the corner treatment for the bottom-left corner.

Returns
CornerTreatment the corner treatment for the bottom-left corner.

getBottomRightCorner

CornerTreatment getBottomRightCorner ()

Get the corner treatment for the bottom-right corner.

Returns
CornerTreatment the corner treatment for the bottom-right corner.

getLeftEdge

EdgeTreatment getLeftEdge ()

Get the edge treatment for the left edge.

Returns
EdgeTreatment the edge treatment for the left edge.

getRightEdge

EdgeTreatment getRightEdge ()

Get the edge treatment for the right edge.

Returns
EdgeTreatment the edge treatment for the right edge.

getTopEdge

EdgeTreatment getTopEdge ()

Get the edge treatment for the top edge.

Returns
EdgeTreatment the edge treatment for the top edge.

getTopLeftCorner

CornerTreatment getTopLeftCorner ()

Get the corner treatment for the top-left corner.

Returns
CornerTreatment the corner treatment for the top-left corner.

getTopRightCorner

CornerTreatment getTopRightCorner ()

Get the corner treatment for the top-right corner.

Returns
CornerTreatment the corner treatment for the top-right corner.

setAllCorners

void setAllCorners (CornerTreatment cornerTreatment)

Set all corner treatments.

Parameters
cornerTreatment CornerTreatment: the corner treatment to use in all four corners.

setAllEdges

void setAllEdges (EdgeTreatment edgeTreatment)

Set all edge treatments.

Parameters
edgeTreatment EdgeTreatment: the edge treatment to use for all four edges.

setBottomEdge

void setBottomEdge (EdgeTreatment bottomEdge)

Set the edge treatment for the bottom edge.

Parameters
bottomEdge EdgeTreatment: the desired treatment.

setBottomLeftCorner

void setBottomLeftCorner (CornerTreatment bottomLeftCorner)

Set the corner treatment for the bottom-left corner.

Parameters
bottomLeftCorner CornerTreatment: the desired treatment.

setBottomRightCorner

void setBottomRightCorner (CornerTreatment bottomRightCorner)

Set the corner treatment for the bottom-right corner.

Parameters
bottomRightCorner CornerTreatment: the desired treatment.

setCornerTreatments

void setCornerTreatments (CornerTreatment topLeftCorner, 
                CornerTreatment topRightCorner, 
                CornerTreatment bottomRightCorner, 
                CornerTreatment bottomLeftCorner)

Set corner treatments.

Parameters
topLeftCorner CornerTreatment: the corner treatment to use in the top-left corner.

topRightCorner CornerTreatment: the corner treatment to use in the top-right corner.

bottomRightCorner CornerTreatment: the corner treatment to use in the bottom-right corner.

bottomLeftCorner CornerTreatment: the corner treatment to use in the bottom-left corner.

setEdgeTreatments

void setEdgeTreatments (EdgeTreatment leftEdge, 
                EdgeTreatment topEdge, 
                EdgeTreatment rightEdge, 
                EdgeTreatment bottomEdge)

Set edge treatments.

Parameters
leftEdge EdgeTreatment: the edge treatment to use on the left edge.

topEdge EdgeTreatment: the edge treatment to use on the top edge.

rightEdge EdgeTreatment: the edge treatment to use on the right edge.

bottomEdge EdgeTreatment: the edge treatment to use on the bottom edge.

setLeftEdge

void setLeftEdge (EdgeTreatment leftEdge)

Set the edge treatment for the left edge.

Parameters
leftEdge EdgeTreatment: the desired treatment.

setRightEdge

void setRightEdge (EdgeTreatment rightEdge)

Set the edge treatment for the right edge.

Parameters
rightEdge EdgeTreatment: the desired treatment.

setTopEdge

void setTopEdge (EdgeTreatment topEdge)

Set the edge treatment for the top edge.

Parameters
topEdge EdgeTreatment: the desired treatment.

setTopLeftCorner

void setTopLeftCorner (CornerTreatment topLeftCorner)

Set the corner treatment for the top-left corner.

Parameters
topLeftCorner CornerTreatment: the desired treatment.

setTopRightCorner

void setTopRightCorner (CornerTreatment topRightCorner)

Set the corner treatment for the top-right corner.

Parameters
topRightCorner CornerTreatment: the desired treatment.